Package net.bytebuddy.dynamic
Class DynamicType.Builder.AbstractBase.Adapter.ModuleDefinitionAdapter
- java.lang.Object
-
- net.bytebuddy.dynamic.DynamicType.Builder.AbstractBase<U>
-
- net.bytebuddy.dynamic.DynamicType.Builder.AbstractBase.Delegator<U>
-
- net.bytebuddy.dynamic.DynamicType.Builder.ModuleDefinition.AbstractBase<U>
-
- net.bytebuddy.dynamic.DynamicType.Builder.AbstractBase.Adapter.ModuleDefinitionAdapter
-
- All Implemented Interfaces:
DynamicType.Builder<U>,DynamicType.Builder.ModuleDefinition<U>
- Enclosing class:
- DynamicType.Builder.AbstractBase.Adapter<U>
@Enhance(includeSyntheticFields=true) protected class DynamicType.Builder.AbstractBase.Adapter.ModuleDefinitionAdapter extends DynamicType.Builder.ModuleDefinition.AbstractBase<U>
An adapter for defining a module.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classDynamicType.Builder.AbstractBase.Adapter.ModuleDefinitionAdapter.ExportsDefinitionAdapterAn adapter for defining a module export.protected classDynamicType.Builder.AbstractBase.Adapter.ModuleDefinitionAdapter.OpensDefinitionAdapterAn adapter for defining a module opening.protected classDynamicType.Builder.AbstractBase.Adapter.ModuleDefinitionAdapter.RequiresDefinitionAdapterAn adapter for definining a module requirement.-
Nested classes/interfaces inherited from class net.bytebuddy.dynamic.DynamicType.Builder.ModuleDefinition.AbstractBase
DynamicType.Builder.ModuleDefinition.AbstractBase.Delegator<V>
-
Nested classes/interfaces inherited from class net.bytebuddy.dynamic.DynamicType.Builder.AbstractBase
DynamicType.Builder.AbstractBase.Adapter<U>, DynamicType.Builder.AbstractBase.UsingTypeWriter<U>
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.DynamicType.Builder
DynamicType.Builder.AbstractBase<S>, DynamicType.Builder.FieldDefinition<S>, DynamicType.Builder.InnerTypeDefinition<S>, DynamicType.Builder.MethodDefinition<S>, DynamicType.Builder.ModuleDefinition<S>, DynamicType.Builder.RecordComponentDefinition<S>, DynamicType.Builder.TypeVariableDefinition<S>
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.DynamicType.Builder.ModuleDefinition
DynamicType.Builder.ModuleDefinition.AbstractBase<U>, DynamicType.Builder.ModuleDefinition.ExportsDefinition<U>, DynamicType.Builder.ModuleDefinition.OpensDefinition<S>, DynamicType.Builder.ModuleDefinition.RequiresDefinition<U>
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,ModuleDescription.Exports>exportsThe packages that this module exports.private java.lang.StringmainClassThe module's main class ornullif no main class was specified.private intmodifiersThe modifiers of the module.private java.lang.StringnameThe name of the module.private java.util.Map<java.lang.String,ModuleDescription.Opens>opensThe packages that this module opens.private java.util.Set<java.lang.String>packagesThe module's packages.private java.util.Map<java.lang.String,ModuleDescription.Provides>providesThe services that this module provides.private java.util.Map<java.lang.String,ModuleDescription.Requires>requiresThe modules that this module requires.private java.util.Set<java.lang.String>usesThe services that this module uses.private java.lang.StringversionThe module version ornullif no version was specified.
-
Constructor Summary
Constructors Modifier Constructor Description protectedModuleDefinitionAdapter(java.lang.String name, int modifiers)protectedModuleDefinitionAdapter(java.lang.String name, int modifiers, java.lang.String version, java.lang.String mainClass, java.util.Set<java.lang.String> packages, java.util.Map<java.lang.String,ModuleDescription.Requires> requires, java.util.Map<java.lang.String,ModuleDescription.Exports> exports, java.util.Map<java.lang.String,ModuleDescription.Opens> opens, java.util.Set<java.lang.String> uses, java.util.Map<java.lang.String,ModuleDescription.Provides> provides)Creates a new module definition adapter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DynamicType.Builder.ModuleDefinition.ExportsDefinition<U>export(java.lang.String aPackage, int modifiers)Specifies a package export with explicit modifiers.DynamicType.Builder.ModuleDefinition<U>mainClass(java.lang.String name)Specifies the main class of the module being defined.protected DynamicType.Builder<U>materialize()Creates a new builder that realizes the current state of the builder.DynamicType.Builder.ModuleDefinition.OpensDefinition<U>open(java.lang.String aPackage, int modifiers)Specifies a package opening with explicit modifiers.DynamicType.Builder.ModuleDefinition<U>packages(java.util.Collection<java.lang.String> packages)Specifies the packages that are contained within the module being defined.DynamicType.Builder.ModuleDefinition<U>provides(java.lang.String service, java.util.Collection<java.lang.String> implementations)Specifies service implementations that are provided by the module being defined.DynamicType.Builder.ModuleDefinition.RequiresDefinition<U>require(java.lang.String module, int modifiers)Specifies a module requirement with explicit modifiers.DynamicType.Builder.ModuleDefinition<U>uses(java.util.Collection<java.lang.String> services)Specifies services that are used by the module being defined.DynamicType.Builder.ModuleDefinition<U>version(java.lang.String version)Specifies the version of the module being defined.-
Methods inherited from class net.bytebuddy.dynamic.DynamicType.Builder.ModuleDefinition.AbstractBase
export, export, exports, exports, mainClass, mainClass, open, open, opens, opens, packages, provides, provides, provides, provides, provides, require, require, requires, requires, uses, uses, uses
-
Methods inherited from class net.bytebuddy.dynamic.DynamicType.Builder.AbstractBase.Delegator
adjustModule, adjustModule, annotateType, attribute, declaredTypes, define, defineConstructor, defineField, defineMethod, defineRecordComponent, field, ignoreAlso, ignoreAlso, implement, initializer, initializer, innerTypeOf, innerTypeOf, invokable, make, make, make, make, merge, modifiers, module, name, nestHost, nestMembers, permittedSubclass, recordComponent, recordComponent, require, suffix, topLevelType, toTypeDescription, transform, typeVariable, unsealed, visit, wrap, wrap
-
Methods inherited from class net.bytebuddy.dynamic.DynamicType.Builder.AbstractBase
annotateType, annotateType, annotateType, constructor, declaredTypes, declaredTypes, declaredTypes, define, define, define, define, define, defineConstructor, defineConstructor, defineField, defineField, defineField, defineField, defineField, defineMethod, defineMethod, defineMethod, defineMethod, defineMethod, defineProperty, defineProperty, defineProperty, defineProperty, defineRecordComponent, field, implement, implement, implement, innerTypeOf, innerTypeOf, innerTypeOf, invokable, merge, method, modifiers, modifiers, module, module, nestHost, nestMembers, nestMembers, nestMembers, noNestMate, permittedSubclass, permittedSubclass, permittedSubclass, require, require, require, serialVersionUid, typeVariable, typeVariable, typeVariable, typeVariable, withHashCodeEquals, withToString, wrap, wrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.bytebuddy.dynamic.DynamicType.Builder
adjustModule, adjustModule, annotateType, annotateType, annotateType, annotateType, attribute, constructor, declaredTypes, declaredTypes, declaredTypes, declaredTypes, define, define, define, define, define, define, defineConstructor, defineConstructor, defineConstructor, defineField, defineField, defineField, defineField, defineField, defineField, defineMethod, defineMethod, defineMethod, defineMethod, defineMethod, defineMethod, defineProperty, defineProperty, defineProperty, defineProperty, defineRecordComponent, defineRecordComponent, field, field, ignoreAlso, ignoreAlso, implement, implement, implement, implement, initializer, initializer, innerTypeOf, innerTypeOf, innerTypeOf, innerTypeOf, innerTypeOf, invokable, invokable, make, make, make, make, merge, merge, method, modifiers, modifiers, modifiers, module, module, module, name, nestHost, nestHost, nestMembers, nestMembers, nestMembers, nestMembers, noNestMate, permittedSubclass, permittedSubclass, permittedSubclass, permittedSubclass, recordComponent, recordComponent, require, require, require, require, serialVersionUid, suffix, topLevelType, toTypeDescription, transform, typeVariable, typeVariable, typeVariable, typeVariable, typeVariable, unsealed, visit, withHashCodeEquals, withToString, wrap, wrap, wrap, wrap
-
-
-
-
Field Detail
-
name
private final java.lang.String name
The name of the module.
-
modifiers
private final int modifiers
The modifiers of the module.
-
version
@MaybeNull @ValueHandling(REVERSE_NULLABILITY) private final java.lang.String version
The module version ornullif no version was specified.
-
mainClass
@MaybeNull @ValueHandling(REVERSE_NULLABILITY) private final java.lang.String mainClass
The module's main class ornullif no main class was specified.
-
packages
private final java.util.Set<java.lang.String> packages
The module's packages.
-
requires
private final java.util.Map<java.lang.String,ModuleDescription.Requires> requires
The modules that this module requires.
-
exports
private final java.util.Map<java.lang.String,ModuleDescription.Exports> exports
The packages that this module exports.
-
opens
private final java.util.Map<java.lang.String,ModuleDescription.Opens> opens
The packages that this module opens.
-
uses
private final java.util.Set<java.lang.String> uses
The services that this module uses.
-
provides
private final java.util.Map<java.lang.String,ModuleDescription.Provides> provides
The services that this module provides.
-
-
Constructor Detail
-
ModuleDefinitionAdapter
protected ModuleDefinitionAdapter(java.lang.String name, int modifiers)
-
ModuleDefinitionAdapter
protected ModuleDefinitionAdapter(java.lang.String name, int modifiers, @MaybeNull java.lang.String version, @MaybeNull java.lang.String mainClass, java.util.Set<java.lang.String> packages, java.util.Map<java.lang.String,ModuleDescription.Requires> requires, java.util.Map<java.lang.String,ModuleDescription.Exports> exports, java.util.Map<java.lang.String,ModuleDescription.Opens> opens, java.util.Set<java.lang.String> uses, java.util.Map<java.lang.String,ModuleDescription.Provides> provides)Creates a new module definition adapter.- Parameters:
name- The name of the module.modifiers- The modifiers of the module.version- The module version ornullif no version was specified.mainClass- The module's main class ornullif no main class was specified.packages- The module's packages.requires- The modules that this module requires.exports- The packages that this module exports.opens- The packages that this module opens.uses- The services that this module uses.provides- The services that this module provides.
-
-
Method Detail
-
version
public DynamicType.Builder.ModuleDefinition<U> version(@MaybeNull java.lang.String version)
Specifies the version of the module being defined.- Parameters:
version- The version of the module ornullif no version is to be specified.- Returns:
- A new builder that is equal to this builder but with the given version specification.
-
mainClass
public DynamicType.Builder.ModuleDefinition<U> mainClass(@MaybeNull java.lang.String name)
Specifies the main class of the module being defined.- Parameters:
name- The name of the main class of the module ornullif no main class is to be specified.- Returns:
- A new builder that is equal to this builder but with the given main class specification.
-
packages
public DynamicType.Builder.ModuleDefinition<U> packages(java.util.Collection<java.lang.String> packages)
Specifies the packages that are contained within the module being defined.- Parameters:
packages- The names of the packages contained within the module.- Returns:
- A new builder that is equal to this builder but with the given package specifications.
-
require
public DynamicType.Builder.ModuleDefinition.RequiresDefinition<U> require(java.lang.String module, int modifiers)
Specifies a module requirement with explicit modifiers.- Parameters:
module- The name of the module that is required.modifiers- The modifiers to apply to the module requirement.- Returns:
- A builder for defining the module requirement.
-
export
public DynamicType.Builder.ModuleDefinition.ExportsDefinition<U> export(java.lang.String aPackage, int modifiers)
Specifies a package export with explicit modifiers.- Parameters:
aPackage- The name of the package to export.modifiers- The modifiers to apply to the package export.- Returns:
- A new builder that is equal to this builder but with the given package export.
-
open
public DynamicType.Builder.ModuleDefinition.OpensDefinition<U> open(java.lang.String aPackage, int modifiers)
Specifies a package opening with explicit modifiers.- Parameters:
aPackage- The name of the package to open.modifiers- The modifiers to apply to the package opening.- Returns:
- A new builder that is equal to this builder but with the given package opening.
-
uses
public DynamicType.Builder.ModuleDefinition<U> uses(java.util.Collection<java.lang.String> services)
Specifies services that are used by the module being defined.- Parameters:
services- The names of the types of the services to use.- Returns:
- A new builder that is equal to this builder but with the given service uses.
-
provides
public DynamicType.Builder.ModuleDefinition<U> provides(java.lang.String service, java.util.Collection<java.lang.String> implementations)
Specifies service implementations that are provided by the module being defined.- Parameters:
service- The name of the type of the service for which implementations are provided.implementations- The names of the types of the implementations that are provided.- Returns:
- A new builder that is equal to this builder but with the given service provision.
-
materialize
protected DynamicType.Builder<U> materialize()
Description copied from class:DynamicType.Builder.AbstractBase.DelegatorCreates a new builder that realizes the current state of the builder.- Specified by:
materializein classDynamicType.Builder.AbstractBase.Delegator<U>- Returns:
- A new builder that realizes the current state of the builder.
-
-