Package net.bytebuddy.description.method
Class MethodDescription.Latent
- 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.description.method.MethodDescription.Latent
-
- 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 interface:
- MethodDescription
public static class MethodDescription.Latent extends MethodDescription.InDefinedShape.AbstractBase
A latent method description describes a method that is not attached to a declaringTypeDescription.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMethodDescription.Latent.TypeInitializerA method description that represents the type initializer.-
Nested classes/interfaces inherited from class net.bytebuddy.description.method.MethodDescription.InDefinedShape.AbstractBase
MethodDescription.InDefinedShape.AbstractBase.Executable, MethodDescription.InDefinedShape.AbstractBase.ForLoadedExecutable<T extends java.lang.reflect.AnnotatedElement>
-
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.Member, ByteCodeElement.TypeDependant<T extends ByteCodeElement.TypeDependant<?,S>,S extends ByteCodeElement.Token<S>>
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.DeclaredByType
DeclaredByType.WithMandatoryDeclaration
-
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.ForModuleDescription, ModifierReviewable.ForModuleRequirement, ModifierReviewable.ForParameterDescription, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumeration, ModifierReviewable.OfMandatable
-
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<? extends AnnotationDescription>declaredAnnotationsThe annotations of this method.private TypeDescriptiondeclaringTypeThe type that is declaring this method.private AnnotationValue<?,?>defaultValueThe default value of this method ornullif no default annotation value is defined.private java.util.List<? extends TypeDescription.Generic>exceptionTypesThis method's exception types.private java.lang.StringinternalNameThe internal name of this method.private intmodifiersThe modifiers of this method.private java.util.List<? extends ParameterDescription.Token>parameterTokensThe parameter tokens describing this method.private TypeDescription.GenericreceiverTypeThe receiver type of this method ornullif the receiver type is defined implicitly.private TypeDescription.GenericreturnTypeThe return type of this method.private java.util.List<? extends TypeVariableToken>typeVariablesA tokenized list representing the method's type variables.-
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 Constructor Description Latent(TypeDescription declaringType, java.lang.String internalName, int modifiers, java.util.List<? extends TypeVariableToken> typeVariables, TypeDescription.Generic returnType, java.util.List<? extends ParameterDescription.Token> parameterTokens, java.util.List<? extends TypeDescription.Generic> exceptionTypes, java.util.List<? extends AnnotationDescription> declaredAnnotations, AnnotationValue<?,?> defaultValue, TypeDescription.Generic receiverType)Creates a new latent method description.Latent(TypeDescription declaringType, MethodDescription.Token token)Creates a new latent method description.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnnotationListgetDeclaredAnnotations()Returns a list of annotations that are declared by this instance.TypeDescriptiongetDeclaringType()Returns the declaring type of this instance.AnnotationValue<?,?>getDefaultValue()Returns the method's default annotation value ornullif no default value is defined for this method.TypeList.GenericgetExceptionTypes()Returns the exception types of the described method.java.lang.StringgetInternalName()Returns the internal name of this byte code element.intgetModifiers()Returns the modifier that is described by this object.ParameterList<ParameterDescription.InDefinedShape>getParameters()Returns a list of this method's parameters.TypeDescription.GenericgetReceiverType()Returns this methods receiver type.TypeDescription.GenericgetReturnType()Returns the return type of the described method.TypeList.GenericgetTypeVariables()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, getGenericSignature, 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, toString
-
Methods inherited from class net.bytebuddy.description.TypeVariableSource.AbstractBase
findExpectedVariable, findVariable
-
Methods inherited from class net.bytebuddy.description.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, 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, getGenericSignature
-
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, findExpectedVariable, findVariable, getEnclosingSource, isGenerified, isInferrable
-
-
-
-
Field Detail
-
declaringType
private final TypeDescription declaringType
The type that is declaring this method.
-
internalName
private final java.lang.String internalName
The internal name of this method.
-
modifiers
private final int modifiers
The modifiers of this method.
-
typeVariables
private final java.util.List<? extends TypeVariableToken> typeVariables
A tokenized list representing the method's type variables.
-
returnType
private final TypeDescription.Generic returnType
The return type of this method.
-
parameterTokens
private final java.util.List<? extends ParameterDescription.Token> parameterTokens
The parameter tokens describing this method.
-
exceptionTypes
private final java.util.List<? extends TypeDescription.Generic> exceptionTypes
This method's exception types.
-
declaredAnnotations
private final java.util.List<? extends AnnotationDescription> declaredAnnotations
The annotations of this method.
-
defaultValue
@MaybeNull private final AnnotationValue<?,?> defaultValue
The default value of this method ornullif no default annotation value is defined.
-
receiverType
@MaybeNull private final TypeDescription.Generic receiverType
The receiver type of this method ornullif the receiver type is defined implicitly.
-
-
Constructor Detail
-
Latent
public Latent(TypeDescription declaringType, MethodDescription.Token token)
Creates a new latent method description. All provided types are attached to this instance before they are returned.- Parameters:
declaringType- The declaring type of the method.token- A token representing the method's shape.
-
Latent
public Latent(TypeDescription declaringType, java.lang.String internalName, int modifiers, java.util.List<? extends TypeVariableToken> typeVariables, TypeDescription.Generic returnType, java.util.List<? extends ParameterDescription.Token> parameterTokens, java.util.List<? extends TypeDescription.Generic> exceptionTypes, java.util.List<? extends AnnotationDescription> declaredAnnotations, @MaybeNull AnnotationValue<?,?> defaultValue, @MaybeNull TypeDescription.Generic receiverType)
Creates a new latent method description. All provided types are attached to this instance before they are returned.- Parameters:
declaringType- The type that is declaring this method.internalName- The internal name of this method.modifiers- The modifiers of this method.typeVariables- The type variables of the described method.returnType- The return type of this method.parameterTokens- The parameter tokens describing this method.exceptionTypes- This method's exception types.declaredAnnotations- The annotations of this method.defaultValue- The default value of this method ornullif no default annotation value is defined.receiverType- The receiver type of this method ornullif the receiver type is defined implicitly.
-
-
Method Detail
-
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.
-
getReturnType
public TypeDescription.Generic getReturnType()
Returns the return type of the described method.- Returns:
- The return type 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.
-
getExceptionTypes
public TypeList.Generic getExceptionTypes()
Returns the exception types of the described method.- Returns:
- The exception types of the described method.
-
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 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
@Nonnull public TypeDescription 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.
-
getDefaultValue
@MaybeNull public AnnotationValue<?,?> 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
@MaybeNull public TypeDescription.Generic 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.
-
-