public static class MethodDescription.ForLoadedMethod extends MethodDescription.InDefinedShape.AbstractBase
MethodDescription.InDefinedShape.AbstractBase
MethodDescription.ForLoadedConstructor, MethodDescription.ForLoadedMethod, MethodDescription.InDefinedShape, MethodDescription.Latent, MethodDescription.Token, MethodDescription.TypeSubstituting, MethodDescription.TypeToken
TypeVariableSource.Visitor<T>
ByteCodeElement.Accessible, ByteCodeElement.TypeDependant<T extends ByteCodeElement.TypeDependant<?,S>,S extends ByteCodeElement.Token<S>>
NamedElement.WithGenericName, NamedElement.WithRuntimeName
CONSTRUCTOR_INTERNAL_NAME, NO_DEFAULT_VALUE, TYPE_INITIALIZER_INTERNAL_NAME, TYPE_INITIALIZER_MODIFIER, UNDEFINED
NON_GENERIC_SIGNATURE
EMPTY_NAME, NO_NAME
EMPTY_MASK
Constructor and Description |
---|
ForLoadedMethod(Method method)
Creates a new immutable method description for a loaded method.
|
Modifier and Type | Method and Description |
---|---|
AnnotationList |
getDeclaredAnnotations()
Returns a list of annotations that are declared by this instance.
|
TypeDescription |
getDeclaringType()
Returns the declaring type of this instance.
|
Object |
getDefaultValue()
Returns the default value of this method or
null if no such value exists. |
String |
getDescriptor()
Returns the descriptor of this byte code element.
|
GenericTypeList |
getExceptionTypes()
Returns the exception types of the described method.
|
String |
getInternalName()
Returns the internal internalName of this byte code element.
|
Method |
getLoadedMethod()
Returns the loaded method that is represented by this method description.
|
int |
getModifiers()
Returns the modifier that is described by this object.
|
String |
getName()
Returns the internalName of this byte code element.
|
ParameterList<ParameterDescription.InDefinedShape> |
getParameters()
Returns a list of this method's parameters.
|
GenericTypeDescription |
getReturnType()
Returns the return type of the described method.
|
GenericTypeList |
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(Constructor<?> constructor)
Verifies if a method description represents a given loaded constructor.
|
boolean |
represents(Method method)
Verifies if a method description represents a given loaded method.
|
asDefined, isAccessibleTo
accept, asToken, asToken, asTypeToken, equals, findVariable, getAdjustedModifiers, getDefaultValue, getEnclosingSource, getGenericSignature, getSourceCodeName, getStackSize, hashCode, isBootstrap, isBootstrap, isDefaultMethod, isDefaultValue, isDefaultValue, isInvokableOn, isMethod, isSpecializableFor, isVirtual, isVisibleTo, toGenericString, toString
isAbstract, isAnnotation, isDeprecated, isEnum, isFinal, isInterface, isMandated, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSuper, isSynchronized, isTransient, isVarArgs, isVolatile
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
asTypeToken, getAdjustedModifiers, getDefaultValue, getStackSize, isBootstrap, isBootstrap, isDefaultMethod, isDefaultValue, isDefaultValue, isInvokableOn, isMethod, isSpecializableFor, isVirtual
accept, findVariable, getEnclosingSource
getGenericSignature, isVisibleTo
getSourceCodeName
isAbstract, isAnnotation, isDeprecated, isEnum, isFinal, isInterface, isMandated, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSuper, isSynchronized, isTransient, isVarArgs, isVolatile
toGenericString
asToken, asToken
public ForLoadedMethod(Method method)
method
- The loaded method to be represented by this method description.public TypeDescription getDeclaringType()
DeclaredByType
null
if no such type exists.public GenericTypeDescription getReturnType()
MethodDescription
public ParameterList<ParameterDescription.InDefinedShape> getParameters()
MethodDescription
public GenericTypeList getExceptionTypes()
MethodDescription
public boolean isConstructor()
MethodDescription
isConstructor
in interface MethodDescription
isConstructor
in class MethodDescription.AbstractBase
true
if this method description represents a constructor.public boolean isTypeInitializer()
MethodDescription
isTypeInitializer
in interface MethodDescription
isTypeInitializer
in class MethodDescription.AbstractBase
true
if this method description represents a type initializer.public boolean isBridge()
ModifierReviewable
isBridge
in interface ModifierReviewable
isBridge
in class ModifierReviewable.AbstractBase
true
if the modifier described by this object represents the bridge flagpublic boolean represents(Method method)
MethodDescription
represents
in interface MethodDescription
represents
in class MethodDescription.AbstractBase
method
- The method to be checked.true
if this method description represents the given loaded method.public boolean represents(Constructor<?> constructor)
MethodDescription
represents
in interface MethodDescription
represents
in class MethodDescription.AbstractBase
constructor
- The constructor to be checked.true
if this method description represents the given loaded constructor.public String getName()
NamedElement.WithRuntimeName
getName
in interface NamedElement.WithRuntimeName
getName
in class MethodDescription.AbstractBase
public int getModifiers()
ModifierReviewable
public boolean isSynthetic()
ModifierReviewable
isSynthetic
in interface ModifierReviewable
isSynthetic
in class ModifierReviewable.AbstractBase
true
if the modifier described by this object is synthetic.public String getInternalName()
NamedElement.WithRuntimeName
public String getDescriptor()
ByteCodeElement
getDescriptor
in interface ByteCodeElement
getDescriptor
in class MethodDescription.AbstractBase
public Method getLoadedMethod()
public AnnotationList getDeclaredAnnotations()
AnnotatedCodeElement
public Object getDefaultValue()
MethodDescription
null
if no such value exists. The returned values might be
of a different type than usual:
Class
values are represented as
TypeDescription
s.Annotation
values are represented as
AnnotationDescription
sEnum
values are represented as
EnumerationDescription
s.null
.public GenericTypeList getTypeVariables()
TypeVariableSource
Copyright © 2014–2015. All rights reserved.