public abstract static class MethodDescription.AbstractBase extends TypeVariableSource.AbstractBase implements MethodDescription
MethodDescription.AbstractBase, MethodDescription.ForLoadedConstructor, MethodDescription.ForLoadedMethod, MethodDescription.InDefinedShape, MethodDescription.InGenericShape, MethodDescription.Latent, MethodDescription.SignatureToken, MethodDescription.Token, MethodDescription.TypeSubstituting, MethodDescription.TypeTokenTypeVariableSource.Visitor<T>ByteCodeElement.TypeDependant<T extends ByteCodeElement.TypeDependant<?,S>,S extends ByteCodeElement.Token<S>>NamedElement.WithGenericName, NamedElement.WithOptionalName, NamedElement.WithRuntimeNameCONSTRUCTOR_INTERNAL_NAME, NO_DEFAULT_VALUE, TYPE_INITIALIZER_INTERNAL_NAME, TYPE_INITIALIZER_MODIFIER, UNDEFINEDNON_GENERIC_SIGNATUREEMPTY_NAME, NO_NAMEEMPTY_MASK| Constructor and Description |
|---|
AbstractBase() |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
accept(TypeVariableSource.Visitor<T> visitor)
Applies a visitor on this type variable source.
|
MethodDescription.SignatureToken |
asSignatureToken()
Returns a signature token representing this method.
|
MethodDescription.Token |
asToken(ElementMatcher<? super TypeDescription> matcher)
Returns a token representative of this type dependant.
|
MethodDescription.TypeToken |
asTypeToken()
Returns a type token that represents this method's raw return and parameter types.
|
boolean |
equals(Object other) |
int |
getActualModifiers()
Returns this method's actual modifiers as it is present in a class file, i.e. includes a flag if this method
is marked
Deprecated. |
int |
getActualModifiers(boolean nonAbstract)
Returns this method's actual modifiers as it is present in a class file, i.e. includes a flag if this method
is marked
Deprecated and adjusts the modifiers for being abstract or not. |
String |
getActualName()
Returns the name of this element as it is found in the source code.
|
<T> T |
getDefaultValue(Class<T> type)
Returns the default value but casts it to the given type.
|
String |
getDescriptor()
Returns the descriptor of this byte code element.
|
TypeVariableSource |
getEnclosingSource()
Returns the enclosing source of type variables that are valid in the scope of this type variable source.
|
String |
getGenericSignature()
Returns the generic signature of this byte code element.
|
String |
getName()
Returns the internalName of this byte code element.
|
int |
getStackSize()
Returns the size of the local variable array that is required for this method, i.e. the size of all parameters
if they were loaded on the stack including a reference to
this if this method represented a non-static
method. |
int |
hashCode() |
boolean |
isBootstrap()
Checks if the method is a bootstrap method.
|
boolean |
isBootstrap(List<?> arguments)
Checks if the method is a bootstrap method that accepts the given arguments.
|
boolean |
isConstructor()
Checks if this method description represents a constructor.
|
boolean |
isDefaultMethod()
Checks if this method represents a default (defender) method.
|
boolean |
isDefaultValue()
Checks if this method is capable of defining a default annotation value.
|
boolean |
isDefaultValue(Object value)
Checks if the given value can describe a default annotation value for this method.
|
boolean |
isGenericDeclaration()
Checks if this type variable source has a generic declaration.
|
boolean |
isInvokableOn(TypeDescription typeDescription)
Asserts if this method is invokable on an instance of the given type, i.e. the method is an instance method or
a constructor and the method is visible to the type and can be invoked on the given instance.
|
boolean |
isMethod()
Checks if this method description represents a method, i.e. not a constructor or a type initializer.
|
boolean |
isSpecializableFor(TypeDescription targetType)
Checks if this method can be called using the
INVOKESPECIAL for a given type. |
boolean |
isTypeInitializer()
Checks if this method is a type initializer.
|
boolean |
isVirtual()
Verifies if this method describes a virtual method, i.e. a method that is inherited by a sub type of this type.
|
boolean |
isVisibleTo(TypeDescription typeDescription)
Checks if this element is visible from a given type.
|
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.
|
String |
toGenericString()
Returns a generic string of this byte code element.
|
String |
toString() |
findVariableisAbstract, isAnnotation, isBridge, isDeprecated, isEnum, isFinal, isInterface, isMandated, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSuper, isSynchronized, isSynthetic, isTransient, isVarArgs, isVolatileclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetDefaultValue, getExceptionTypes, getParameters, getReceiverType, getReturnTypefindVariable, getTypeVariablesgetInternalNamegetModifiers, isAbstract, isAnnotation, isBridge, isDeprecated, isEnum, isFinal, isInterface, isMandated, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSuper, isSynchronized, isSynthetic, isTransient, isVarArgs, isVolatilegetDeclaringTypegetDeclaredAnnotationsasDefinedpublic int getStackSize()
MethodDescriptionthis if this method represented a non-static
method.getStackSize in interface MethodDescriptionpublic boolean isMethod()
MethodDescriptionisMethod in interface MethodDescriptiontrue if this method description represents a method.public boolean isConstructor()
MethodDescriptionisConstructor in interface MethodDescriptiontrue if this method description represents a constructor.public boolean isTypeInitializer()
MethodDescriptionisTypeInitializer in interface MethodDescriptiontrue if this method description represents a type initializer.public boolean represents(Method method)
MethodDescriptionrepresents in interface MethodDescriptionmethod - The method to be checked.true if this method description represents the given loaded method.public boolean represents(Constructor<?> constructor)
MethodDescriptionrepresents in interface MethodDescriptionconstructor - The constructor to be checked.true if this method description represents the given loaded constructor.public String getName()
NamedElement.WithRuntimeNamegetName in interface NamedElement.WithRuntimeNamepublic String getActualName()
NamedElementgetActualName in interface NamedElementpublic String getDescriptor()
ByteCodeElementgetDescriptor in interface ByteCodeElementpublic String getGenericSignature()
ByteCodeElementnull is returned as a signature.getGenericSignature in interface ByteCodeElementnull if this element is not generic.public int getActualModifiers()
MethodDescriptionDeprecated.getActualModifiers in interface MethodDescriptionpublic int getActualModifiers(boolean nonAbstract)
MethodDescriptionDeprecated and adjusts the modifiers for being abstract or not.getActualModifiers in interface MethodDescriptionnonAbstract - true if the method should be treated as non-abstract.public boolean isVisibleTo(TypeDescription typeDescription)
ByteCodeElementChecks if this element is visible from a given type.
Note: A method or field might define a signature that includes types that are not visible to a type. Such methods can be legally invoked from this type and can even be implemented as bridge methods by this type. It is however not legal to declare a method with invisible types in its signature that are not bridges what might require additional validation.
Important: Virtual byte code elements, i.e. virtual methods, are only considered visible if the type they are invoked upon is visible to a given type. The visibility of such virtual members can therefore not be determined by only investigating the invoked method but requires an additional check of the target type.
isVisibleTo in interface ByteCodeElementtypeDescription - The type which is checked for its access of this element.true if this element is visible for typeDescription.public boolean isVirtual()
MethodDescriptionisVirtual in interface MethodDescriptiontrue if this method is virtual.public boolean isDefaultMethod()
MethodDescriptionisDefaultMethod in interface MethodDescriptiontrue if this method is a default method.public boolean isSpecializableFor(TypeDescription targetType)
MethodDescriptionINVOKESPECIAL for a given type.isSpecializableFor in interface MethodDescriptiontargetType - The type otrue if this method can be called using the INVOKESPECIAL instruction
using the given type.public <T> T getDefaultValue(Class<T> type)
MethodDescriptionClassCastException is thrown.getDefaultValue in interface MethodDescriptionT - The type to cast the default value to.type - The type to cast the default value to.public boolean isInvokableOn(TypeDescription typeDescription)
MethodDescriptionisInvokableOn in interface MethodDescriptiontypeDescription - The type to check.true if this method is invokable on an instance of the given type.public boolean isBootstrap()
MethodDescriptionisBootstrap in interface MethodDescriptiontrue if the method is a bootstrap method.public boolean isBootstrap(List<?> arguments)
MethodDescriptionisBootstrap in interface MethodDescriptionarguments - The arguments that the bootstrap method is expected to accept where primitive values
are to be represented as their wrapper types, loaded types by TypeDescription,
method handles by JavaConstant.MethodHandle instances and
method types by JavaConstant.MethodType instances.true if the method is a bootstrap method that accepts the given arguments.public boolean isDefaultValue()
MethodDescriptionisDefaultValue in interface MethodDescriptiontrue if it is possible to define a default annotation value for this method.public boolean isDefaultValue(Object value)
MethodDescriptionisDefaultValue in interface MethodDescriptionvalue - The value that describes the default annotation value for this method.true if the given value can describe a default annotation value for this method.public TypeVariableSource getEnclosingSource()
TypeVariableSourcegetEnclosingSource in interface TypeVariableSourcenull if no such source exists.public <T> T accept(TypeVariableSource.Visitor<T> visitor)
TypeVariableSourceaccept in interface TypeVariableSourceT - The visitor's return type.visitor - The visitor to apply.public boolean isGenericDeclaration()
TypeVariableSourceisGenericDeclaration in interface TypeVariableSourcetrue if this type code element has a generic declaration.public MethodDescription.Token asToken(ElementMatcher<? super TypeDescription> matcher)
ByteCodeElement.TypeDependantTargetType descriptions.asToken in interface ByteCodeElement.TypeDependant<MethodDescription.InDefinedShape,MethodDescription.Token>matcher - A matcher to identify types to be replaced by TargetType descriptions.public MethodDescription.SignatureToken asSignatureToken()
MethodDescriptionasSignatureToken in interface MethodDescriptionpublic MethodDescription.TypeToken asTypeToken()
MethodDescriptionasTypeToken in interface MethodDescriptionpublic String toGenericString()
NamedElement.WithGenericNametoGenericString in interface NamedElement.WithGenericNameCopyright © 2014–2016. All rights reserved.