Class ModuleDescription.ForLoadedModule
java.lang.Object
net.bytebuddy.description.ModifierReviewable.AbstractBase
net.bytebuddy.description.module.ModuleDescription.AbstractBase
net.bytebuddy.description.module.ModuleDescription.ForLoadedModule
- All Implemented Interfaces:
AnnotationSource, ModifierReviewable, ModifierReviewable.ForFieldDescription, ModifierReviewable.ForMethodDescription, ModifierReviewable.ForModuleDescription, ModifierReviewable.ForModuleRequirement, ModifierReviewable.ForParameterDescription, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumeration, ModifierReviewable.OfMandatable, ModuleDescription, NamedElement
- Enclosing interface:
ModuleDescription
A
ModuleDescription implementation that represents a loaded Java module.
This implementation uses reflection and Java dispatchers to access module information
from the runtime module system.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceA proxy for interacting withjava.lang.Module.protected static interfaceA proxy for interacting withjava.lang.ModuleDescriptor.protected static interfaceA proxy for interacting withjava.util.Optional.Nested classes/interfaces inherited from interface AnnotationSource
AnnotationSource.Empty, AnnotationSource.ExplicitNested classes/interfaces inherited from interface ModifierReviewable
ModifierReviewable.AbstractBase, ModifierReviewable.ForFieldDescription, ModifierReviewable.ForMethodDescription, ModifierReviewable.ForModuleDescription, ModifierReviewable.ForModuleRequirement, ModifierReviewable.ForParameterDescription, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumeration, ModifierReviewable.OfMandatableNested classes/interfaces inherited from interface ModuleDescription
ModuleDescription.AbstractBase, ModuleDescription.Exports, ModuleDescription.ForLoadedModule, ModuleDescription.Latent, ModuleDescription.Opens, ModuleDescription.Provides, ModuleDescription.RequiresNested classes/interfaces inherited from interface NamedElement
NamedElement.WithDescriptor, NamedElement.WithGenericName, NamedElement.WithOptionalName, NamedElement.WithRuntimeName -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AnnotatedElementThe module represented by this description.protected static final ModuleDescription.ForLoadedModule.ModuleA dispatcher for accessingjava.lang.Modulemethods.protected static final ModuleDescription.ForLoadedModule.ModuleDescriptorA dispatcher for accessingjava.lang.ModuleDescriptormethods.protected static final ModuleDescription.ForLoadedModule.ModuleDescriptor.ExportsA dispatcher for accessingjava.lang.ModuleDescriptor.Exportsmethods.protected static final ModuleDescription.ForLoadedModule.ModuleDescriptor.OpensA dispatcher for accessingjava.lang.ModuleDescriptor.Opensmethods.protected static final ModuleDescription.ForLoadedModule.ModuleDescriptor.ProvidesA dispatcher for accessingjava.lang.ModuleDescriptor.Providesmethods.protected static final ModuleDescription.ForLoadedModule.ModuleDescriptor.RequiresA dispatcher for accessingjava.lang.ModuleDescriptor.Requiresmethods.protected static final ModuleDescription.ForLoadedModule.OptionalA dispatcher for accessingjava.util.Optionalmethods.Fields inherited from interface ModifierReviewable
EMPTY_MASKFields inherited from interface ModuleDescription
MODULE_CLASS_NAME, UNDEFINEDFields inherited from interface NamedElement
EMPTY_NAME, NO_NAME -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedForLoadedModule(AnnotatedElement module) Creates a new module description for the supplied module. -
Method Summary
Modifier and TypeMethodDescriptionprivate static <T> TdoPrivileged(PrivilegedAction<T> action) A proxy forjava.security.AccessController#doPrivilegedthat is activated if available.Returns the display name of this element as it is found in the source code.Returns a list of annotations that are declared by this instance.Returns all package exports of this module.Returns the main class of this module.intReturns the modifier that is described by this object.getOpens()Returns all package opens of this module.Returns all packages contained in this module.Returns all service implementations provided by this module.Returns all module dependencies of this module.getUses()Returns all service types that this module uses.Returns the version of this module.booleanisOpen()Returnstrueif the module is open.static ModuleDescriptionCreates a module description for the supplied module.Methods inherited from class ModuleDescription.AbstractBase
accept, equals, hashCode, toStringMethods inherited from class ModifierReviewable.AbstractBase
getEnumerationState, getFieldManifestation, getFieldPersistence, getMandate, getMethodManifestation, getMethodStrictness, getOpenness, getOwnership, getParameterManifestation, getProvisioningState, getRequiredPhase, getSynchronizationState, getSyntheticState, getTransitivity, getTypeManifestation, getVisibility, isAbstract, isAnnotation, isBridge, isDeprecated, isEnum, isFinal, isInterface, isMandated, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStaticPhase, isStrict, isSynchronized, isSynthetic, isTransient, isTransitive, isVarArgs, isVolatileMethods inherited from interface ModifierReviewable
getSyntheticState, isFinal, isSyntheticMethods inherited from interface ModifierReviewable.ForModuleDescription
getOpenness
-
Field Details
-
MODULE
A dispatcher for accessingjava.lang.Modulemethods. -
MODULE_DESCRIPTOR
A dispatcher for accessingjava.lang.ModuleDescriptormethods. -
MODULE_DESCRIPTOR_EXPORTS
protected static final ModuleDescription.ForLoadedModule.ModuleDescriptor.Exports MODULE_DESCRIPTOR_EXPORTSA dispatcher for accessingjava.lang.ModuleDescriptor.Exportsmethods. -
MODULE_DESCRIPTOR_OPENS
protected static final ModuleDescription.ForLoadedModule.ModuleDescriptor.Opens MODULE_DESCRIPTOR_OPENSA dispatcher for accessingjava.lang.ModuleDescriptor.Opensmethods. -
MODULE_DESCRIPTOR_REQUIRES
protected static final ModuleDescription.ForLoadedModule.ModuleDescriptor.Requires MODULE_DESCRIPTOR_REQUIRESA dispatcher for accessingjava.lang.ModuleDescriptor.Requiresmethods. -
MODULE_DESCRIPTOR_PROVIDES
protected static final ModuleDescription.ForLoadedModule.ModuleDescriptor.Provides MODULE_DESCRIPTOR_PROVIDESA dispatcher for accessingjava.lang.ModuleDescriptor.Providesmethods. -
OPTIONAL
A dispatcher for accessingjava.util.Optionalmethods. -
module
The module represented by this description.
-
-
Constructor Details
-
ForLoadedModule
Creates a new module description for the supplied module.- Parameters:
module- The module to represent.
-
-
Method Details
-
of
Creates a module description for the supplied module.- Parameters:
module- The module to represent.- Returns:
- A module description for the supplied module.
- Throws:
IllegalArgumentException- If the supplied instance is not a module or if the module is unnamed.
-
doPrivileged
A proxy forjava.security.AccessController#doPrivilegedthat is activated if available.- Type Parameters:
T- The type of the action's resolved value.- Parameters:
action- The action to execute from a privileged context.- Returns:
- The action's resolved value.
-
getVersion
Returns the version of this module.- Returns:
- The module's version or
nullif no version is specified.
-
getMainClass
Returns the main class of this module.- Returns:
- The module's main class or
nullif no main class is specified.
-
isOpen
public boolean isOpen()Returnstrueif the module is open.- Specified by:
isOpenin interfaceModifierReviewable.ForModuleDescription- Overrides:
isOpenin classModifierReviewable.AbstractBase- Returns:
trueif the module is open.
-
getPackages
-
getUses
-
getExports
Returns all package exports of this module.- Returns:
- A mapping of package names to their export declarations.
-
getOpens
Returns all package opens of this module.- Returns:
- A mapping of package names to their opens declarations.
-
getRequires
Returns all module dependencies of this module.- Returns:
- A mapping of module names to their require declarations.
-
getProvides
Returns all service implementations provided by this module.- Returns:
- A mapping of service names to their provider declarations.
-
getModifiers
public int getModifiers()Returns the modifier that is described by this object.- Returns:
- The modifier that is described by this object.
-
getActualName
Returns the display name of this element as it is found in the source code. If no such name exists, an empty string is returned.- Returns:
- The name of this element as given in a Java program's source code.
-
getDeclaredAnnotations
Returns a list of annotations that are declared by this instance.- Returns:
- A list of declared annotations.
-