Package net.bytebuddy.pool
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.TypeDependant<MethodDescription.InDefinedShape,MethodDescription.Token>
,DeclaredByType
,MethodDescription
,MethodDescription.InDefinedShape
,ModifierReviewable
,ModifierReviewable.ForFieldDescription
,ModifierReviewable.ForMethodDescription
,ModifierReviewable.ForParameterDescription
,ModifierReviewable.ForTypeDefinition
,ModifierReviewable.OfAbstraction
,ModifierReviewable.OfByteCodeElement
,ModifierReviewable.OfEnumeration
,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 Classes Modifier and Type Class Description protected class
TypePool.Default.LazyTypeDescription.LazyMethodDescription.LazyNonGenericReceiverType
A lazy description of a non-generic receiver type.private class
TypePool.Default.LazyTypeDescription.LazyMethodDescription.LazyParameterDescription
A lazy description of a parameters of the enclosing method.private class
TypePool.Default.LazyTypeDescription.LazyMethodDescription.LazyParameterizedReceiverType
A lazy description of a parameterized receiver type.private class
TypePool.Default.LazyTypeDescription.LazyMethodDescription.LazyParameterList
A lazy list of parameter descriptions for the enclosing method description.-
Nested classes/interfaces inherited from interface net.bytebuddy.description.annotation.AnnotationSource
AnnotationSource.Empty, AnnotationSource.Explicit
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.ByteCodeElement
ByteCodeElement.TypeDependant<T extends ByteCodeElement.TypeDependant<?,S>,S extends ByteCodeElement.Token<S>>
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.method.MethodDescription
MethodDescription.AbstractBase, MethodDescription.ForLoadedConstructor, MethodDescription.ForLoadedMethod, MethodDescription.InDefinedShape, MethodDescription.InGenericShape, MethodDescription.Latent, MethodDescription.SignatureToken, MethodDescription.Token, MethodDescription.TypeSubstituting, MethodDescription.TypeToken
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.method.MethodDescription.InDefinedShape
MethodDescription.InDefinedShape.AbstractBase
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.ModifierReviewable
ModifierReviewable.AbstractBase, ModifierReviewable.ForFieldDescription, ModifierReviewable.ForMethodDescription, ModifierReviewable.ForParameterDescription, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumeration
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.NamedElement
NamedElement.WithDescriptor, NamedElement.WithGenericName, NamedElement.WithOptionalName, NamedElement.WithRuntimeName
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.TypeVariableSource
TypeVariableSource.AbstractBase, TypeVariableSource.Visitor<T>
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>
annotationTokens
The annotation tokens representing the method's annotations.private AnnotationValue<?,?>
defaultValue
The default value of this method ornull
if no such value exists.private java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>
exceptionTypeAnnotationTokens
A mapping of the exception types' type annotation tokens by their indices.private java.util.List<java.lang.String>
exceptionTypeDescriptors
A list of type descriptions of this method's exception types.private java.lang.String
genericSignature
The method's generic signature as found in the class file ornull
if the method is not generic.private java.lang.String
internalName
The internal name of this method.private int
modifiers
The modifiers of this method.private java.util.Map<java.lang.Integer,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>
parameterAnnotationTokens
The annotation tokens representing the parameter's annotation.private java.lang.Integer[]
parameterModifiers
An array of parameter modifiers which may benull
if no modifiers is known.private java.lang.String[]
parameterNames
An array of parameter names which may benull
if no explicit name is known for a parameter.private java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>
parameterTypeAnnotationTokens
A mapping of the parameter types' type annotation tokens by their indices.private java.util.List<java.lang.String>
parameterTypeDescriptors
A list of type descriptions of this method's parameters.private java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>
receiverTypeAnnotationTokens
A mapping of the receiver type's type annotation tokens.private java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>
returnTypeAnnotationTokens
A mapping of the return type's type variable tokens.private java.lang.String
returnTypeDescriptor
The descriptor of the return type.private TypePool.Default.LazyTypeDescription.GenericTypeToken.Resolution.ForMethod
signatureResolution
The generic type token of this method.private java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>
typeVariableAnnotationTokens
A mapping of the type variables' type annotation tokens by their indices.private java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>>
typeVariableBoundAnnotationTokens
A mapping of the type variables' type bounds' type annotation tokens by their indices and each variable's index.-
Fields inherited from interface net.bytebuddy.description.method.MethodDescription
CONSTRUCTOR_INTERNAL_NAME, TYPE_INITIALIZER_INTERNAL_NAME, TYPE_INITIALIZER_MODIFIER, UNDEFINED
-
Fields inherited from interface net.bytebuddy.description.ModifierReviewable
EMPTY_MASK
-
Fields inherited from interface net.bytebuddy.description.NamedElement
EMPTY_NAME, NO_NAME
-
Fields inherited from interface net.bytebuddy.description.NamedElement.WithDescriptor
NON_GENERIC_SIGNATURE
-
Fields inherited from interface net.bytebuddy.description.TypeVariableSource
UNDEFINED
-
-
Constructor Summary
Constructors Modifier Constructor Description private
LazyMethodDescription(java.lang.String internalName, int modifiers, java.lang.String descriptor, java.lang.String genericSignature, TypePool.Default.LazyTypeDescription.GenericTypeToken.Resolution.ForMethod signatureResolution, java.lang.String[] exceptionTypeInternalName, java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> typeVariableAnnotationTokens, java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>> typeVariableBoundAnnotationTokens, java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>> returnTypeAnnotationTokens, java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> parameterTypeAnnotationTokens, java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> exceptionTypeAnnotationTokens, java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>> receiverTypeAnnotationTokens, java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken> annotationTokens, java.util.Map<java.lang.Integer,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>> parameterAnnotationTokens, java.util.List<TypePool.Default.LazyTypeDescription.MethodToken.ParameterToken> parameterTokens, AnnotationValue<?,?> defaultValue)
Creates a new lazy method description.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnnotationList
getDeclaredAnnotations()
Returns a list of annotations that are declared by this instance.TypeDescription
getDeclaringType()
Returns the declaring type of this instance.AnnotationValue<?,?>
getDefaultValue()
Returns the method's default annotation value ornull
if no default value is defined for this method.TypeList.Generic
getExceptionTypes()
Returns the exception types of the described method.java.lang.String
getGenericSignature()
Returns the generic signature of this byte code element.java.lang.String
getInternalName()
Returns the internal internalName of this byte code element.int
getModifiers()
Returns the modifier that is described by this object.ParameterList<ParameterDescription.InDefinedShape>
getParameters()
Returns a list of this method's parameters.TypeDescription.Generic
getReceiverType()
Returns this methods receiver type.TypeDescription.Generic
getReturnType()
Returns the return type of the described method.TypeList.Generic
getTypeVariables()
Returns the type variables that are declared by this element.-
Methods inherited from class net.bytebuddy.description.method.MethodDescription.InDefinedShape.AbstractBase
asDefined
-
Methods inherited from class net.bytebuddy.description.method.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, toString
-
Methods inherited from class net.bytebuddy.description.TypeVariableSource.AbstractBase
findVariable
-
Methods inherited from class net.bytebuddy.description.ModifierReviewable.AbstractBase
getEnumerationState, getFieldManifestation, getFieldPersistence, getMethodManifestation, getMethodStrictness, getOwnership, getParameterManifestation, getProvisioningState, getSynchronizationState, getSyntheticState, getTypeManifestation, getVisibility, isAbstract, isAnnotation, isBridge, isDeprecated, isEnum, isFinal, isInterface, isMandated, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSynchronized, isSynthetic, isTransient, isVarArgs, isVolatile
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.bytebuddy.description.ByteCodeElement
isAccessibleTo, isVisibleTo
-
Methods inherited from interface net.bytebuddy.description.ByteCodeElement.TypeDependant
asToken
-
Methods inherited from interface net.bytebuddy.description.method.MethodDescription
asSignatureToken, asTypeToken, getActualModifiers, getActualModifiers, getActualModifiers, getDefaultValue, getStackSize, isBridgeCompatible, isConstantBootstrap, isConstantBootstrap, isConstructor, isDefaultMethod, isDefaultValue, isDefaultValue, isInvokableOn, isInvokeBootstrap, isInvokeBootstrap, isMethod, isSpecializableFor, isTypeInitializer, isVirtual, represents, represents
-
Methods inherited from interface net.bytebuddy.description.ModifierReviewable
getSyntheticState, isFinal, isSynthetic
-
Methods inherited from interface net.bytebuddy.description.ModifierReviewable.ForMethodDescription
getMethodManifestation, getMethodStrictness, getSynchronizationState, isBridge, isNative, isStrict, isSynchronized, isVarArgs
-
Methods inherited from interface net.bytebuddy.description.ModifierReviewable.OfAbstraction
isAbstract
-
Methods inherited from interface net.bytebuddy.description.ModifierReviewable.OfByteCodeElement
getOwnership, getVisibility, isDeprecated, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic
-
Methods inherited from interface net.bytebuddy.description.NamedElement
getActualName
-
Methods inherited from interface net.bytebuddy.description.NamedElement.WithDescriptor
getDescriptor
-
Methods inherited from interface net.bytebuddy.description.NamedElement.WithGenericName
toGenericString
-
Methods inherited from interface net.bytebuddy.description.NamedElement.WithRuntimeName
getName
-
Methods inherited from interface net.bytebuddy.description.TypeVariableSource
accept, findVariable, getEnclosingSource, isGenerified, isInferrable
-
-
-
-
Field Detail
-
internalName
private final java.lang.String internalName
The internal name of this method.
-
modifiers
private final int modifiers
The modifiers of this method.
-
returnTypeDescriptor
private final java.lang.String returnTypeDescriptor
The descriptor of the return type.
-
genericSignature
private final java.lang.String genericSignature
The method's generic signature as found in the class file ornull
if the method is not generic.
-
signatureResolution
private final TypePool.Default.LazyTypeDescription.GenericTypeToken.Resolution.ForMethod signatureResolution
The generic type token of this method.
-
parameterTypeDescriptors
private final java.util.List<java.lang.String> parameterTypeDescriptors
A list of type descriptions of this method's parameters.
-
exceptionTypeDescriptors
private final java.util.List<java.lang.String> exceptionTypeDescriptors
A list of type descriptions of this method's exception types.
-
typeVariableAnnotationTokens
private final java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> typeVariableAnnotationTokens
A mapping of the type variables' type annotation tokens by their indices.
-
typeVariableBoundAnnotationTokens
private final java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>> typeVariableBoundAnnotationTokens
A mapping of the type variables' type bounds' type annotation tokens by their indices and each variable's index.
-
returnTypeAnnotationTokens
private final java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>> returnTypeAnnotationTokens
A mapping of the return type's type variable tokens.
-
parameterTypeAnnotationTokens
private final java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> parameterTypeAnnotationTokens
A mapping of the parameter types' type annotation tokens by their indices.
-
exceptionTypeAnnotationTokens
private final java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> exceptionTypeAnnotationTokens
A mapping of the exception types' type annotation tokens by their indices.
-
receiverTypeAnnotationTokens
private final java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>> receiverTypeAnnotationTokens
A mapping of the receiver type's type annotation tokens.
-
annotationTokens
private final java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken> annotationTokens
The annotation tokens representing the method's annotations.
-
parameterAnnotationTokens
private final java.util.Map<java.lang.Integer,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>> parameterAnnotationTokens
The annotation tokens representing the parameter's annotation. Every index can containnull
if a parameter does not define any annotations.
-
parameterNames
private final java.lang.String[] parameterNames
An array of parameter names which may benull
if no explicit name is known for a parameter.
-
parameterModifiers
private final java.lang.Integer[] parameterModifiers
An array of parameter modifiers which may benull
if no modifiers is known.
-
defaultValue
private final AnnotationValue<?,?> defaultValue
The default value of this method ornull
if no such value exists.
-
-
Constructor Detail
-
LazyMethodDescription
private LazyMethodDescription(java.lang.String internalName, int modifiers, java.lang.String descriptor, java.lang.String genericSignature, TypePool.Default.LazyTypeDescription.GenericTypeToken.Resolution.ForMethod signatureResolution, java.lang.String[] exceptionTypeInternalName, java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> typeVariableAnnotationTokens, java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>> typeVariableBoundAnnotationTokens, java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>> returnTypeAnnotationTokens, java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> parameterTypeAnnotationTokens, java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> exceptionTypeAnnotationTokens, java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>> receiverTypeAnnotationTokens, java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken> annotationTokens, java.util.Map<java.lang.Integer,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>> parameterAnnotationTokens, java.util.List<TypePool.Default.LazyTypeDescription.MethodToken.ParameterToken> parameterTokens, 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 ornull
if 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 ornull
if 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 containnull
if 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 ornull
if there is no
-
-
Method Detail
-
getReturnType
public TypeDescription.Generic getReturnType()
Returns the return type of the described method.- Returns:
- The return type of the described method.
-
getExceptionTypes
public TypeList.Generic getExceptionTypes()
Returns the exception types of the described method.- Returns:
- The exception types of the described method.
-
getParameters
public ParameterList<ParameterDescription.InDefinedShape> getParameters()
Returns a list of this method's parameters.- Returns:
- A list of this method's parameters.
-
getDeclaredAnnotations
public AnnotationList getDeclaredAnnotations()
Returns a list of annotations that are declared by this instance.- Returns:
- A list of declared annotations.
-
getInternalName
public java.lang.String getInternalName()
Returns the internal internalName of this byte code element.- Returns:
- The internal internalName of this byte code element as used within the Java class file format.
-
getDeclaringType
public TypeDescription getDeclaringType()
Returns the declaring type of this instance.- Returns:
- The declaring type or
null
if 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
public TypeList.Generic getTypeVariables()
Returns the type variables that are declared by this element.- Returns:
- The type variables that are declared by this element.
-
getDefaultValue
public AnnotationValue<?,?> getDefaultValue()
Returns the method's default annotation value ornull
if no default value is defined for this method.- Returns:
- The method's default annotation value or
null
if no default value is defined for this method.
-
getReceiverType
public TypeDescription.Generic getReceiverType()
Returns this methods receiver type. A receiver type is undefined forstatic
methods wherenull
is 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:
getReceiverType
in interfaceMethodDescription
- Overrides:
getReceiverType
in classMethodDescription.InDefinedShape.AbstractBase
- Returns:
- This method's (annotated) receiver type.
-
getGenericSignature
public java.lang.String getGenericSignature()
Returns the generic signature of this byte code element. If this element does not reference generic types or references malformed generic types,null
is returned as a signature.- Specified by:
getGenericSignature
in interfaceNamedElement.WithDescriptor
- Overrides:
getGenericSignature
in classMethodDescription.AbstractBase
- Returns:
- The generic signature or
null
if this element is not generic.
-
-