Class TypePool.Default.LazyTypeDescription.LazyMethodDescription
java.lang.Object
net.bytebuddy.description.ModifierReviewable.AbstractBase
net.bytebuddy.description.TypeVariableSource.AbstractBase
net.bytebuddy.description.method.MethodDescription.AbstractBase
net.bytebuddy.description.method.MethodDescription.InDefinedShape.AbstractBase
net.bytebuddy.pool.TypePool.Default.LazyTypeDescription.LazyMethodDescription
- All Implemented Interfaces:
AnnotationSource, ByteCodeElement, ByteCodeElement.Member, ByteCodeElement.TypeDependant<MethodDescription.InDefinedShape, MethodDescription.Token>, DeclaredByType, DeclaredByType.WithMandatoryDeclaration, MethodDescription, MethodDescription.InDefinedShape, ModifierReviewable, ModifierReviewable.ForFieldDescription, ModifierReviewable.ForMethodDescription, ModifierReviewable.ForModuleDescription, ModifierReviewable.ForModuleRequirement, ModifierReviewable.ForParameterDescription, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumeration, ModifierReviewable.OfMandatable, NamedElement, NamedElement.WithDescriptor, NamedElement.WithGenericName, NamedElement.WithRuntimeName, TypeVariableSource
- Enclosing class:
TypePool.Default.LazyTypeDescription
private class TypePool.Default.LazyTypeDescription.LazyMethodDescription
extends MethodDescription.InDefinedShape.AbstractBase
A lazy representation of a method that resolves references to types only on demand.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classA lazy description of a non-generic receiver type.private classA lazy description of a parameters of the enclosing method.private classA lazy description of a parameterized receiver type.private classA lazy list of parameter descriptions for the enclosing method description.Nested classes/interfaces inherited from class MethodDescription.InDefinedShape.AbstractBase
MethodDescription.InDefinedShape.AbstractBase.Executable, MethodDescription.InDefinedShape.AbstractBase.ForLoadedExecutable<T>Nested classes/interfaces inherited from interface AnnotationSource
AnnotationSource.Empty, AnnotationSource.ExplicitNested classes/interfaces inherited from interface ByteCodeElement
ByteCodeElement.Member, ByteCodeElement.TypeDependant<T,S> Nested classes/interfaces inherited from interface DeclaredByType
DeclaredByType.WithMandatoryDeclarationNested classes/interfaces inherited from interface MethodDescription
MethodDescription.AbstractBase, MethodDescription.ForLoadedConstructor, MethodDescription.ForLoadedMethod, MethodDescription.InDefinedShape, MethodDescription.InGenericShape, MethodDescription.Latent, MethodDescription.SignatureToken, MethodDescription.Token, MethodDescription.TypeSubstituting, MethodDescription.TypeTokenNested classes/interfaces inherited from interface MethodDescription.InDefinedShape
MethodDescription.InDefinedShape.AbstractBaseNested 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 NamedElement
NamedElement.WithDescriptor, NamedElement.WithGenericName, NamedElement.WithOptionalName, NamedElement.WithRuntimeNameNested classes/interfaces inherited from interface TypeVariableSource
TypeVariableSource.AbstractBase, TypeVariableSource.Visitor<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<TypePool.Default.LazyTypeDescription.AnnotationToken> The annotation tokens representing the method's annotations.private final AnnotationValue<?, ?> The default value of this method ornullif no such value exists.A mapping of the exception types' type annotation tokens by their indices.A list of type descriptions of this method's exception types.private final StringThe method's generic signature as found in the class file ornullif the method is not generic.private final StringThe internal name of this method.private final intThe modifiers of this method.private final Map<Integer, List<TypePool.Default.LazyTypeDescription.AnnotationToken>> The annotation tokens representing the parameter's annotation.private final Integer[]An array of parameter modifiers which may benullif no modifiers is known.private final String[]An array of parameter names which may benullif no explicit name is known for a parameter.A mapping of the parameter types' type annotation tokens by their indices.A list of type descriptions of this method's parameters.private final Map<String, List<TypePool.Default.LazyTypeDescription.AnnotationToken>> A mapping of the receiver type's type annotation tokens.private final Map<String, List<TypePool.Default.LazyTypeDescription.AnnotationToken>> A mapping of the return type's type variable tokens.private final StringThe descriptor of the return type.The generic type token of this method.A mapping of the type variables' type annotation tokens by their indices.private final Map<Integer, Map<Integer, Map<String, List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>> A mapping of the type variables' type bounds' type annotation tokens by their indices and each variable's index.Fields inherited from interface MethodDescription
CONSTRUCTOR_INTERNAL_NAME, TYPE_INITIALIZER_INTERNAL_NAME, TYPE_INITIALIZER_MODIFIER, UNDEFINEDFields inherited from interface ModifierReviewable
EMPTY_MASKFields inherited from interface NamedElement
EMPTY_NAME, NO_NAMEFields inherited from interface NamedElement.WithDescriptor
NON_GENERIC_SIGNATUREFields inherited from interface TypeVariableSource
UNDEFINED -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateLazyMethodDescription(String internalName, int modifiers, String descriptor, String genericSignature, TypePool.Default.LazyTypeDescription.GenericTypeToken.Resolution.ForMethod signatureResolution, String[] exceptionTypeInternalName, Map<Integer, Map<String, List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> typeVariableAnnotationTokens, Map<Integer, Map<Integer, Map<String, List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>> typeVariableBoundAnnotationTokens, Map<String, List<TypePool.Default.LazyTypeDescription.AnnotationToken>> returnTypeAnnotationTokens, Map<Integer, Map<String, List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> parameterTypeAnnotationTokens, Map<Integer, Map<String, List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> exceptionTypeAnnotationTokens, Map<String, List<TypePool.Default.LazyTypeDescription.AnnotationToken>> receiverTypeAnnotationTokens, List<TypePool.Default.LazyTypeDescription.AnnotationToken> annotationTokens, Map<Integer, List<TypePool.Default.LazyTypeDescription.AnnotationToken>> parameterAnnotationTokens, List<TypePool.Default.LazyTypeDescription.MethodToken.ParameterToken> parameterTokens, AnnotationValue<?, ?> defaultValue) Creates a new lazy method description. -
Method Summary
Modifier and TypeMethodDescriptionReturns a list of annotations that are declared by this instance.Returns the declaring type of this instance.AnnotationValue<?, ?> Returns the method's default annotation value ornullif no default value is defined for this method.Returns the exception types of the described method.Returns the generic signature of this byte code element.Returns the internal name of this byte code element.intReturns the modifier that is described by this object.Returns a list of this method's parameters.Returns this methods receiver type.Returns the return type of the described method.Returns the type variables that are declared by this element.Methods inherited from class MethodDescription.InDefinedShape.AbstractBase
asDefinedMethods inherited from class MethodDescription.AbstractBase
accept, asSignatureToken, asToken, asTypeToken, equals, getActualModifiers, getActualModifiers, getActualModifiers, getActualName, getDefaultValue, getDescriptor, getEnclosingSource, getName, getStackSize, hashCode, isAccessibleTo, isBridgeCompatible, isConstantBootstrap, isConstantBootstrap, isConstructor, isDefaultMethod, isDefaultValue, isDefaultValue, isGenerified, isInferrable, isInvokableOn, isInvokeBootstrap, isInvokeBootstrap, isMethod, isSpecializableFor, isTypeInitializer, isVirtual, isVisibleTo, represents, represents, toGenericString, toSafeString, toStringMethods inherited from class TypeVariableSource.AbstractBase
findExpectedVariable, findVariableMethods 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, isOpen, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStaticPhase, isStrict, isSynchronized, isSynthetic, isTransient, isTransitive, isVarArgs, isVolatileMethods inherited from interface ByteCodeElement
isAccessibleTo, isVisibleToMethods inherited from interface ByteCodeElement.TypeDependant
asTokenMethods inherited from interface MethodDescription
asSignatureToken, asTypeToken, getActualModifiers, getActualModifiers, getActualModifiers, getDefaultValue, getStackSize, isBridgeCompatible, isConstantBootstrap, isConstantBootstrap, isConstructor, isDefaultMethod, isDefaultValue, isDefaultValue, isInvokableOn, isInvokeBootstrap, isInvokeBootstrap, isMethod, isSpecializableFor, isTypeInitializer, isVirtual, represents, representsMethods inherited from interface ModifierReviewable
getSyntheticState, isFinal, isSyntheticMethods inherited from interface ModifierReviewable.ForMethodDescription
getMethodManifestation, getMethodStrictness, getSynchronizationState, isBridge, isNative, isStrict, isSynchronized, isVarArgsMethods inherited from interface ModifierReviewable.OfAbstraction
isAbstractMethods inherited from interface ModifierReviewable.OfByteCodeElement
getOwnership, getVisibility, isDeprecated, isPackagePrivate, isPrivate, isProtected, isPublic, isStaticMethods inherited from interface NamedElement
getActualNameMethods inherited from interface NamedElement.WithDescriptor
getDescriptorMethods inherited from interface NamedElement.WithGenericName
toGenericStringMethods inherited from interface NamedElement.WithRuntimeName
getNameMethods inherited from interface TypeVariableSource
accept, findExpectedVariable, findVariable, getEnclosingSource, isGenerified, isInferrable
-
Field Details
-
internalName
The internal name of this method. -
modifiers
private final int modifiersThe modifiers of this method. -
returnTypeDescriptor
The descriptor of the return type. -
genericSignature
The method's generic signature as found in the class file ornullif the method is not generic. -
signatureResolution
private final TypePool.Default.LazyTypeDescription.GenericTypeToken.Resolution.ForMethod signatureResolutionThe generic type token of this method. -
parameterTypeDescriptors
-
exceptionTypeDescriptors
-
typeVariableAnnotationTokens
-
typeVariableBoundAnnotationTokens
-
returnTypeAnnotationTokens
private final Map<String, List<TypePool.Default.LazyTypeDescription.AnnotationToken>> returnTypeAnnotationTokensA mapping of the return type's type variable tokens. -
parameterTypeAnnotationTokens
-
exceptionTypeAnnotationTokens
-
receiverTypeAnnotationTokens
private final Map<String, List<TypePool.Default.LazyTypeDescription.AnnotationToken>> receiverTypeAnnotationTokensA mapping of the receiver type's type annotation tokens. -
annotationTokens
The annotation tokens representing the method's annotations. -
parameterAnnotationTokens
private final Map<Integer, List<TypePool.Default.LazyTypeDescription.AnnotationToken>> parameterAnnotationTokensThe annotation tokens representing the parameter's annotation. Every index can containnullif a parameter does not define any annotations. -
parameterNames
An array of parameter names which may benullif no explicit name is known for a parameter. -
parameterModifiers
An array of parameter modifiers which may benullif no modifiers is known. -
defaultValue
The default value of this method ornullif no such value exists.
-
-
Constructor Details
-
LazyMethodDescription
private LazyMethodDescription(String internalName, int modifiers, String descriptor, @MaybeNull String genericSignature, TypePool.Default.LazyTypeDescription.GenericTypeToken.Resolution.ForMethod signatureResolution, @MaybeNull String[] exceptionTypeInternalName, Map<Integer, Map<String, List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> typeVariableAnnotationTokens, Map<Integer, Map<Integer, Map<String, List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>> typeVariableBoundAnnotationTokens, Map<String, List<TypePool.Default.LazyTypeDescription.AnnotationToken>> returnTypeAnnotationTokens, Map<Integer, Map<String, List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> parameterTypeAnnotationTokens, Map<Integer, Map<String, List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> exceptionTypeAnnotationTokens, Map<String, List<TypePool.Default.LazyTypeDescription.AnnotationToken>> receiverTypeAnnotationTokens, List<TypePool.Default.LazyTypeDescription.AnnotationToken> annotationTokens, Map<Integer, List<TypePool.Default.LazyTypeDescription.AnnotationToken>> parameterAnnotationTokens, List<TypePool.Default.LazyTypeDescription.MethodToken.ParameterToken> parameterTokens, @MaybeNull AnnotationValue<?, ?> defaultValue) Creates a new lazy method description.- Parameters:
internalName- The internal name of this method.modifiers- The modifiers of the represented method.descriptor- The method descriptor of this method.genericSignature- The method's generic signature as found in the class file ornullif the method is not generic.signatureResolution- The generic type token of this method.exceptionTypeInternalName- The internal names of the exceptions that are declared by this method ornullif no exceptions are declared by this method.typeVariableAnnotationTokens- A mapping of the type variables' type annotation tokens by their indices.typeVariableBoundAnnotationTokens- A mapping of the type variables' type bounds' type annotation tokens by their index and each variable's index.returnTypeAnnotationTokens- A mapping of the return type's type variable tokens.parameterTypeAnnotationTokens- A mapping of the parameter types' type annotation tokens by their indices.exceptionTypeAnnotationTokens- A mapping of the exception types' type annotation tokens by their indices.receiverTypeAnnotationTokens- A mapping of the receiver type's type annotation tokens.annotationTokens- The annotation tokens representing the method's annotations.parameterAnnotationTokens- The annotation tokens representing the parameter's annotation. Every index can containnullif a parameter does not define any annotations.parameterTokens- A list of parameter tokens which might be empty or even out of sync with the actual parameters if the debugging information found in a class was corrupt.defaultValue- The default value of this method ornullif there is no
-
-
Method Details
-
getReturnType
Returns the return type of the described method.- Returns:
- The return type of the described method.
-
getExceptionTypes
Returns the exception types of the described method.- Returns:
- The exception types of the described method.
-
getParameters
Returns a list of this method's parameters.- Returns:
- A list of this method's parameters.
-
getDeclaredAnnotations
Returns a list of annotations that are declared by this instance.- Returns:
- A list of declared annotations.
-
getInternalName
Returns the internal name of this byte code element. If no well-defined internal name is known for this element, the actual name is returned.- Returns:
- The internal name of this byte code element as used within the Java class file format.
-
getDeclaringType
Returns the declaring type of this instance.- Returns:
- The declaring type or
nullif no such type exists.
-
getModifiers
public int getModifiers()Returns the modifier that is described by this object.- Returns:
- The modifier that is described by this object.
-
getTypeVariables
Returns the type variables that are declared by this element.- Returns:
- The type variables that are declared by this element.
-
getDefaultValue
Returns the method's default annotation value ornullif no default value is defined for this method.- Returns:
- The method's default annotation value or
nullif no default value is defined for this method.
-
getReceiverType
Returns this methods receiver type. A receiver type is undefined forstaticmethods wherenullis returned. Other than a receiver type that is provided by the Java reflection API, Byte Buddy is capable of extracting annotations on type parameters of receiver types when directly accessing a class file. Therefore, a receiver type might be parameterized.- Specified by:
getReceiverTypein interfaceMethodDescription- Overrides:
getReceiverTypein classMethodDescription.InDefinedShape.AbstractBase- Returns:
- This method's (annotated) receiver type.
-
getGenericSignature
Returns the generic signature of this byte code element. If this element does not reference generic types or references malformed generic types,nullis returned as a signature.- Specified by:
getGenericSignaturein interfaceNamedElement.WithDescriptor- Overrides:
getGenericSignaturein classMethodDescription.AbstractBase- Returns:
- The generic signature or
nullif this element is not generic.
-