Package net.bytebuddy.description.method
Class MethodDescription.ForLoadedMethod
- 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.ForLoadedMethod
-
- 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.WithGenericName
,NamedElement.WithRuntimeName
,TypeVariableSource
- Enclosing interface:
- MethodDescription
public static class MethodDescription.ForLoadedMethod extends MethodDescription.InDefinedShape.AbstractBase
An implementation of a method description for a loaded method.
-
-
Nested Class Summary
-
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.WithGenericName, NamedElement.WithOptionalName, NamedElement.WithRuntimeName
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.TypeVariableSource
TypeVariableSource.AbstractBase, TypeVariableSource.Visitor<T>
-
-
Field Summary
-
Fields inherited from interface net.bytebuddy.description.ByteCodeElement
NON_GENERIC_SIGNATURE
-
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.TypeVariableSource
UNDEFINED
-
-
Constructor Summary
Constructors Constructor Description ForLoadedMethod(java.lang.reflect.Method method)
Creates a new immutable method description for a loaded method.
-
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.java.lang.String
getDescriptor()
Returns the descriptor of this byte code element.TypeList.Generic
getExceptionTypes()
Returns the exception types of the described method.java.lang.String
getInternalName()
Returns the internal internalName of this byte code element.java.lang.reflect.Method
getLoadedMethod()
Returns the loaded method that is represented by this method description.int
getModifiers()
Returns the modifier that is described by this object.java.lang.String
getName()
Returns the internalName of this byte code element.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.boolean
isBridge()
Specifies if the modifier described by this object represents the bridge flag.boolean
isConstructor()
Checks if this method description represents a constructor.boolean
isSynthetic()
Specifies if the modifier described by this object is synthetic.boolean
isTypeInitializer()
Checks if this method is a type initializer.boolean
represents(java.lang.reflect.Constructor<?> constructor)
Verifies if a method description represents a given loaded constructor.boolean
represents(java.lang.reflect.Method method)
Verifies if a method description represents a given loaded method.-
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, getEnclosingSource, getGenericSignature, getStackSize, hashCode, isAccessibleTo, isBootstrap, isBootstrap, isBridgeCompatible, isDefaultMethod, isDefaultValue, isDefaultValue, isGenerified, isInvokableOn, isMethod, isSpecializableFor, isVirtual, isVisibleTo, 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, isDeprecated, isEnum, isFinal, isInterface, isMandated, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSynchronized, 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
getGenericSignature, 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, isBootstrap, isBootstrap, isBridgeCompatible, isDefaultMethod, isDefaultValue, isDefaultValue, isInvokableOn, isMethod, isSpecializableFor, isVirtual
-
Methods inherited from interface net.bytebuddy.description.ModifierReviewable
getSyntheticState, isFinal
-
Methods inherited from interface net.bytebuddy.description.ModifierReviewable.ForMethodDescription
getMethodManifestation, getMethodStrictness, getSynchronizationState, 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.WithGenericName
toGenericString
-
Methods inherited from interface net.bytebuddy.description.TypeVariableSource
accept, findVariable, getEnclosingSource, isGenerified
-
-
-
-
Method Detail
-
getDeclaringType
public TypeDescription getDeclaringType()
Description copied from interface:DeclaredByType
Returns the declaring type of this instance.- Returns:
- The declaring type or
null
if no such type exists.
-
getReturnType
public TypeDescription.Generic getReturnType()
Description copied from interface:MethodDescription
Returns the return type of the described method.- Returns:
- The return type of the described method.
-
getParameters
public ParameterList<ParameterDescription.InDefinedShape> getParameters()
Description copied from interface:MethodDescription
Returns a list of this method's parameters.- Returns:
- A list of this method's parameters.
-
getExceptionTypes
public TypeList.Generic getExceptionTypes()
Description copied from interface:MethodDescription
Returns the exception types of the described method.- Returns:
- The exception types of the described method.
-
isConstructor
public boolean isConstructor()
Description copied from interface:MethodDescription
Checks if this method description represents a constructor.- Specified by:
isConstructor
in interfaceMethodDescription
- Overrides:
isConstructor
in classMethodDescription.AbstractBase
- Returns:
true
if this method description represents a constructor.
-
isTypeInitializer
public boolean isTypeInitializer()
Description copied from interface:MethodDescription
Checks if this method is a type initializer.- Specified by:
isTypeInitializer
in interfaceMethodDescription
- Overrides:
isTypeInitializer
in classMethodDescription.AbstractBase
- Returns:
true
if this method description represents a type initializer.
-
isBridge
public boolean isBridge()
Description copied from interface:ModifierReviewable.ForMethodDescription
Specifies if the modifier described by this object represents the bridge flag.- Specified by:
isBridge
in interfaceModifierReviewable.ForMethodDescription
- Overrides:
isBridge
in classModifierReviewable.AbstractBase
- Returns:
true
if the modifier described by this object represents the bridge flag
-
represents
public boolean represents(java.lang.reflect.Method method)
Description copied from interface:MethodDescription
Verifies if a method description represents a given loaded method.- Specified by:
represents
in interfaceMethodDescription
- Overrides:
represents
in classMethodDescription.AbstractBase
- Parameters:
method
- The method to be checked.- Returns:
true
if this method description represents the given loaded method.
-
represents
public boolean represents(java.lang.reflect.Constructor<?> constructor)
Description copied from interface:MethodDescription
Verifies if a method description represents a given loaded constructor.- Specified by:
represents
in interfaceMethodDescription
- Overrides:
represents
in classMethodDescription.AbstractBase
- Parameters:
constructor
- The constructor to be checked.- Returns:
true
if this method description represents the given loaded constructor.
-
getName
public java.lang.String getName()
Description copied from interface:NamedElement.WithRuntimeName
Returns the internalName of this byte code element.- Specified by:
getName
in interfaceNamedElement.WithRuntimeName
- Overrides:
getName
in classMethodDescription.AbstractBase
- Returns:
- The internalName of this byte code element as visible from within a running Java application.
-
getModifiers
public int getModifiers()
Description copied from interface:ModifierReviewable
Returns the modifier that is described by this object.- Returns:
- The modifier that is described by this object.
-
isSynthetic
public boolean isSynthetic()
Description copied from interface:ModifierReviewable
Specifies if the modifier described by this object is synthetic.- Specified by:
isSynthetic
in interfaceModifierReviewable
- Overrides:
isSynthetic
in classModifierReviewable.AbstractBase
- Returns:
true
if the modifier described by this object is synthetic.
-
getInternalName
public java.lang.String getInternalName()
Description copied from interface:NamedElement.WithRuntimeName
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.
-
getDescriptor
public java.lang.String getDescriptor()
Description copied from interface:ByteCodeElement
Returns the descriptor of this byte code element.- Specified by:
getDescriptor
in interfaceByteCodeElement
- Overrides:
getDescriptor
in classMethodDescription.AbstractBase
- Returns:
- The descriptor of this byte code element.
-
getLoadedMethod
public java.lang.reflect.Method getLoadedMethod()
Returns the loaded method that is represented by this method description.- Returns:
- The loaded method that is represented by this method description.
-
getDeclaredAnnotations
public AnnotationList getDeclaredAnnotations()
Description copied from interface:AnnotationSource
Returns a list of annotations that are declared by this instance.- Returns:
- A list of declared annotations.
-
getDefaultValue
public AnnotationValue<?,?> getDefaultValue()
Description copied from interface:MethodDescription
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.
-
getTypeVariables
public TypeList.Generic getTypeVariables()
Description copied from interface:TypeVariableSource
Returns the type variables that are declared by this element.- Returns:
- The type variables that are declared by this element.
-
getReceiverType
public TypeDescription.Generic getReceiverType()
Description copied from interface:MethodDescription
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.
-
-