Package net.bytebuddy.dynamic
Interface DynamicType.Builder.ModuleDefinition<S>
-
- Type Parameters:
S- A loaded type that the built type is guaranteed to be a subclass of.
- All Superinterfaces:
DynamicType.Builder<S>
- All Known Subinterfaces:
DynamicType.Builder.ModuleDefinition.ExportsDefinition<U>,DynamicType.Builder.ModuleDefinition.OpensDefinition<S>,DynamicType.Builder.ModuleDefinition.RequiresDefinition<U>
- All Known Implementing Classes:
DynamicType.Builder.AbstractBase.Adapter.ModuleDefinitionAdapter,DynamicType.Builder.AbstractBase.Adapter.ModuleDefinitionAdapter.ExportsDefinitionAdapter,DynamicType.Builder.AbstractBase.Adapter.ModuleDefinitionAdapter.OpensDefinitionAdapter,DynamicType.Builder.AbstractBase.Adapter.ModuleDefinitionAdapter.RequiresDefinitionAdapter,DynamicType.Builder.ModuleDefinition.AbstractBase,DynamicType.Builder.ModuleDefinition.AbstractBase.Delegator,DynamicType.Builder.ModuleDefinition.ExportsDefinition.Delegator,DynamicType.Builder.ModuleDefinition.OpensDefinition.Delegator,DynamicType.Builder.ModuleDefinition.RequiresDefinition.Delegator
- Enclosing interface:
- DynamicType.Builder<T>
public static interface DynamicType.Builder.ModuleDefinition<S> extends DynamicType.Builder<S>
A specification of a Java module.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classDynamicType.Builder.ModuleDefinition.AbstractBase<U>An abstract base implementation of aDynamicType.Builder.ModuleDefinition.static interfaceDynamicType.Builder.ModuleDefinition.ExportsDefinition<U>A specification of a module export.static interfaceDynamicType.Builder.ModuleDefinition.OpensDefinition<S>A specification of a module opening.static interfaceDynamicType.Builder.ModuleDefinition.RequiresDefinition<U>A specification of a module requirement.-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.DynamicType.Builder
DynamicType.Builder.FieldDefinition<S>, DynamicType.Builder.InnerTypeDefinition<S>, DynamicType.Builder.MethodDefinition<S>, DynamicType.Builder.ModuleDefinition<S>, DynamicType.Builder.RecordComponentDefinition<S>, DynamicType.Builder.TypeVariableDefinition<S>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DynamicType.Builder.ModuleDefinition<S>export(java.lang.String aPackage, int modifiers)Specifies a package export with explicit modifiers.DynamicType.Builder.ModuleDefinition<S>export(java.lang.String aPackage, java.util.Collection<? extends ModifierContributor.ForModule.OfExport> modifierContributors)Specifies a package export with additional modifiers.DynamicType.Builder.ModuleDefinition<S>export(java.lang.String aPackage, ModifierContributor.ForModule.OfExport... modifierContributor)Specifies a package export with additional modifiers.DynamicType.Builder.ModuleDefinition<S>exports(java.lang.String... aPackage)Specifies packages that are exported by the module being defined.DynamicType.Builder.ModuleDefinition<S>exports(java.util.Collection<java.lang.String> packages)Specifies packages that are exported by the module being defined.DynamicType.Builder.ModuleDefinition<S>mainClass(java.lang.Class<?> type)Specifies the main class of the module being defined.DynamicType.Builder.ModuleDefinition<S>mainClass(java.lang.String name)Specifies the main class of the module being defined.DynamicType.Builder.ModuleDefinition<S>mainClass(TypeDescription typeDescription)Specifies the main class of the module being defined.DynamicType.Builder.ModuleDefinition<S>open(java.lang.String aPackage, int modifiers)Specifies a package opening with explicit modifiers.DynamicType.Builder.ModuleDefinition<S>open(java.lang.String aPackage, java.util.Collection<? extends ModifierContributor.ForModule.OfOpen> modifierContributors)Specifies a package opening with additional modifiers.DynamicType.Builder.ModuleDefinition<S>open(java.lang.String aPackage, ModifierContributor.ForModule.OfOpen... modifierContributor)Specifies a package opening with additional modifiers.DynamicType.Builder.ModuleDefinition<S>opens(java.lang.String... aPackage)Specifies packages that are opened by the module being defined.DynamicType.Builder.ModuleDefinition<S>opens(java.util.Collection<java.lang.String> packages)Specifies packages that are opened by the module being defined.DynamicType.Builder.ModuleDefinition<S>packages(java.lang.String... aPackage)Specifies the packages that are contained within the module being defined.DynamicType.Builder.ModuleDefinition<S>packages(java.util.Collection<java.lang.String> packages)Specifies the packages that are contained within the module being defined.DynamicType.Builder.ModuleDefinition<S>provides(java.lang.Class<?> service, java.lang.Class<?>... implementation)Specifies service implementations that are provided by the module being defined.DynamicType.Builder.ModuleDefinition<S>provides(java.lang.Class<?> service, java.util.Collection<java.lang.Class<?>> implementations)Specifies service implementations that are provided by the module being defined.DynamicType.Builder.ModuleDefinition<S>provides(java.lang.String service, java.lang.String... implementation)Specifies service implementations that are provided by the module being defined.DynamicType.Builder.ModuleDefinition<S>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<S>provides(TypeDescription service, java.util.Collection<TypeDescription> implementations)Specifies service implementations that are provided by the module being defined.DynamicType.Builder.ModuleDefinition<S>provides(TypeDescription service, TypeDescription... implementation)Specifies service implementations that are provided by the module being defined.DynamicType.Builder.ModuleDefinition.RequiresDefinition<S>require(java.lang.String module, int modifiers)Specifies a module requirement with explicit modifiers.DynamicType.Builder.ModuleDefinition.RequiresDefinition<S>require(java.lang.String module, java.util.Collection<? extends ModifierContributor.ForModule.OfRequire> modifierContributors)Specifies a module requirement with additional modifiers.DynamicType.Builder.ModuleDefinition.RequiresDefinition<S>require(java.lang.String module, ModifierContributor.ForModule.OfRequire... modifierContributor)Specifies a module requirement with additional modifiers.DynamicType.Builder.ModuleDefinition<S>requires(java.lang.String... module)Specifies the modules that are required by the module being defined.DynamicType.Builder.ModuleDefinition<S>requires(java.util.Collection<java.lang.String> modules)Specifies the modules that are required by the module being defined.DynamicType.Builder.ModuleDefinition<S>uses(java.lang.Class<?>... service)Specifies services that are used by the module being defined.DynamicType.Builder.ModuleDefinition<S>uses(java.lang.String... service)Specifies services that are used by the module being defined.DynamicType.Builder.ModuleDefinition<S>uses(java.util.Collection<java.lang.String> services)Specifies services that are used by the module being defined.DynamicType.Builder.ModuleDefinition<S>uses(TypeDescription... service)Specifies services that are used by the module being defined.DynamicType.Builder.ModuleDefinition<S>version(java.lang.String version)Specifies the version of the module being defined.-
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
-
-
-
-
Method Detail
-
version
DynamicType.Builder.ModuleDefinition<S> 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
DynamicType.Builder.ModuleDefinition<S> mainClass(@MaybeNull java.lang.Class<?> type)
Specifies the main class of the module being defined.- Parameters:
type- 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.
-
mainClass
DynamicType.Builder.ModuleDefinition<S> mainClass(@MaybeNull TypeDescription typeDescription)
Specifies the main class of the module being defined.- Parameters:
typeDescription- 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.
-
mainClass
DynamicType.Builder.ModuleDefinition<S> 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
DynamicType.Builder.ModuleDefinition<S> packages(java.lang.String... aPackage)
Specifies the packages that are contained within the module being defined.- Parameters:
aPackage- 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.
-
packages
DynamicType.Builder.ModuleDefinition<S> 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.
-
requires
DynamicType.Builder.ModuleDefinition<S> requires(java.lang.String... module)
Specifies the modules that are required by the module being defined.- Parameters:
module- The names of the modules that are required.- Returns:
- A new builder that is equal to this builder but with the given module requirements.
-
requires
DynamicType.Builder.ModuleDefinition<S> requires(java.util.Collection<java.lang.String> modules)
Specifies the modules that are required by the module being defined.- Parameters:
modules- The names of the modules that are required.- Returns:
- A new builder that is equal to this builder but with the given module requirements.
-
require
DynamicType.Builder.ModuleDefinition.RequiresDefinition<S> require(java.lang.String module, ModifierContributor.ForModule.OfRequire... modifierContributor)
Specifies a module requirement with additional modifiers.- Parameters:
module- The name of the module that is required.modifierContributor- The modifiers to apply to the module requirement.- Returns:
- A builder for defining the module requirement.
-
require
DynamicType.Builder.ModuleDefinition.RequiresDefinition<S> require(java.lang.String module, java.util.Collection<? extends ModifierContributor.ForModule.OfRequire> modifierContributors)
Specifies a module requirement with additional modifiers.- Parameters:
module- The name of the module that is required.modifierContributors- The modifiers to apply to the module requirement.- Returns:
- A builder for defining the module requirement.
-
require
DynamicType.Builder.ModuleDefinition.RequiresDefinition<S> 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.
-
exports
DynamicType.Builder.ModuleDefinition<S> exports(java.lang.String... aPackage)
Specifies packages that are exported by the module being defined.- Parameters:
aPackage- The names of the packages to export.- Returns:
- A new builder that is equal to this builder but with the given package exports.
-
exports
DynamicType.Builder.ModuleDefinition<S> exports(java.util.Collection<java.lang.String> packages)
Specifies packages that are exported by the module being defined.- Parameters:
packages- The names of the packages to export.- Returns:
- A new builder that is equal to this builder but with the given package exports.
-
export
DynamicType.Builder.ModuleDefinition<S> export(java.lang.String aPackage, ModifierContributor.ForModule.OfExport... modifierContributor)
Specifies a package export with additional modifiers.- Parameters:
aPackage- The name of the package to export.modifierContributor- The modifiers to apply to the package export.- Returns:
- A new builder that is equal to this builder but with the given package export.
-
export
DynamicType.Builder.ModuleDefinition<S> export(java.lang.String aPackage, java.util.Collection<? extends ModifierContributor.ForModule.OfExport> modifierContributors)
Specifies a package export with additional modifiers.- Parameters:
aPackage- The name of the package to export.modifierContributors- The modifiers to apply to the package export.- Returns:
- A new builder that is equal to this builder but with the given package export.
-
export
DynamicType.Builder.ModuleDefinition<S> 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.
-
opens
DynamicType.Builder.ModuleDefinition<S> opens(java.lang.String... aPackage)
Specifies packages that are opened by the module being defined.- Parameters:
aPackage- The names of the packages to open.- Returns:
- A new builder that is equal to this builder but with the given package openings.
-
opens
DynamicType.Builder.ModuleDefinition<S> opens(java.util.Collection<java.lang.String> packages)
Specifies packages that are opened by the module being defined.- Parameters:
packages- The names of the packages to open.- Returns:
- A new builder that is equal to this builder but with the given package openings.
-
open
DynamicType.Builder.ModuleDefinition<S> open(java.lang.String aPackage, ModifierContributor.ForModule.OfOpen... modifierContributor)
Specifies a package opening with additional modifiers.- Parameters:
aPackage- The name of the package to open.modifierContributor- The modifiers to apply to the package opening.- Returns:
- A new builder that is equal to this builder but with the given package opening.
-
open
DynamicType.Builder.ModuleDefinition<S> open(java.lang.String aPackage, java.util.Collection<? extends ModifierContributor.ForModule.OfOpen> modifierContributors)
Specifies a package opening with additional modifiers.- Parameters:
aPackage- The name of the package to open.modifierContributors- The modifiers to apply to the package opening.- Returns:
- A new builder that is equal to this builder but with the given package opening.
-
open
DynamicType.Builder.ModuleDefinition<S> 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
DynamicType.Builder.ModuleDefinition<S> uses(java.lang.Class<?>... service)
Specifies services that are used by the module being defined.- Parameters:
service- The types of the services to use.- Returns:
- A new builder that is equal to this builder but with the given service uses.
-
uses
DynamicType.Builder.ModuleDefinition<S> uses(TypeDescription... service)
Specifies services that are used by the module being defined.- Parameters:
service- The descriptions of the types of the services to use.- Returns:
- A new builder that is equal to this builder but with the given service uses.
-
uses
DynamicType.Builder.ModuleDefinition<S> uses(java.lang.String... service)
Specifies services that are used by the module being defined.- Parameters:
service- 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.
-
uses
DynamicType.Builder.ModuleDefinition<S> 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
DynamicType.Builder.ModuleDefinition<S> provides(java.lang.Class<?> service, java.lang.Class<?>... implementation)
Specifies service implementations that are provided by the module being defined.- Parameters:
service- The type of the service for which implementations are provided.implementation- The types of the implementations that are provided.- Returns:
- A new builder that is equal to this builder but with the given service provision.
-
provides
DynamicType.Builder.ModuleDefinition<S> provides(java.lang.Class<?> service, java.util.Collection<java.lang.Class<?>> implementations)
Specifies service implementations that are provided by the module being defined.- Parameters:
service- The type of the service for which implementations are provided.implementations- The types of the implementations that are provided.- Returns:
- A new builder that is equal to this builder but with the given service provision.
-
provides
DynamicType.Builder.ModuleDefinition<S> provides(TypeDescription service, TypeDescription... implementation)
Specifies service implementations that are provided by the module being defined.- Parameters:
service- The description of the type of the service for which implementations are provided.implementation- The descriptions 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.
-
provides
DynamicType.Builder.ModuleDefinition<S> provides(TypeDescription service, java.util.Collection<TypeDescription> implementations)
Specifies service implementations that are provided by the module being defined.- Parameters:
service- The description of the type of the service for which implementations are provided.implementations- The descriptions 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.
-
provides
DynamicType.Builder.ModuleDefinition<S> provides(java.lang.String service, java.lang.String... implementation)
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.implementation- 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.
-
provides
DynamicType.Builder.ModuleDefinition<S> 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.
-
-