Package net.bytebuddy.description.method
Class MethodDescription.TypeSubstituting
- java.lang.Object
-
- net.bytebuddy.description.ModifierReviewable.AbstractBase
-
- net.bytebuddy.description.TypeVariableSource.AbstractBase
-
- net.bytebuddy.description.method.MethodDescription.AbstractBase
-
- net.bytebuddy.description.method.MethodDescription.TypeSubstituting
-
- All Implemented Interfaces:
AnnotationSource,ByteCodeElement,ByteCodeElement.TypeDependant<MethodDescription.InDefinedShape,MethodDescription.Token>,DeclaredByType,MethodDescription,MethodDescription.InGenericShape,ModifierReviewable,ModifierReviewable.ForFieldDescription,ModifierReviewable.ForMethodDescription,ModifierReviewable.ForParameterDescription,ModifierReviewable.ForTypeDefinition,ModifierReviewable.OfAbstraction,ModifierReviewable.OfByteCodeElement,ModifierReviewable.OfEnumeration,NamedElement,NamedElement.WithDescriptor,NamedElement.WithGenericName,NamedElement.WithRuntimeName,TypeVariableSource
- Enclosing interface:
- MethodDescription
public static class MethodDescription.TypeSubstituting extends MethodDescription.AbstractBase implements MethodDescription.InGenericShape
A method description that represents a given method but with substituted method types.
-
-
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.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 TypeDescription.GenericdeclaringTypeThe type that declares this type-substituted method.private MethodDescriptionmethodDescriptionThe represented method description.private TypeDescription.Generic.Visitor<? extends TypeDescription.Generic>visitorA visitor that is applied to the method type.-
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 TypeSubstituting(TypeDescription.Generic declaringType, MethodDescription methodDescription, TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor)Creates a method description with substituted method types.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MethodDescription.InDefinedShapeasDefined()Returns this type dependant in its defined shape, i.e.AnnotationListgetDeclaredAnnotations()Returns a list of annotations that are declared by this instance.TypeDescription.GenericgetDeclaringType()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 internalName of this byte code element.intgetModifiers()Returns the modifier that is described by this object.ParameterList<ParameterDescription.InGenericShape>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.booleanisConstructor()Checks if this method description represents a constructor.booleanisMethod()Checks if this method description represents a method, i.e.booleanisTypeInitializer()Checks if this method is a type initializer.-
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, isDefaultMethod, isDefaultValue, isDefaultValue, isGenerified, isInferrable, isInvokableOn, isInvokeBootstrap, isInvokeBootstrap, isSpecializableFor, 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, isDefaultMethod, isDefaultValue, isDefaultValue, isInvokableOn, isInvokeBootstrap, isInvokeBootstrap, isSpecializableFor, 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, findVariable, getEnclosingSource, isGenerified, isInferrable
-
-
-
-
Field Detail
-
declaringType
private final TypeDescription.Generic declaringType
The type that declares this type-substituted method.
-
methodDescription
private final MethodDescription methodDescription
The represented method description.
-
visitor
private final TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor
A visitor that is applied to the method type.
-
-
Constructor Detail
-
TypeSubstituting
public TypeSubstituting(TypeDescription.Generic declaringType, MethodDescription methodDescription, TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor)
Creates a method description with substituted method types.- Parameters:
declaringType- The type that is declaring the substituted method.methodDescription- The represented method description.visitor- A visitor that is applied to the method type.
-
-
Method Detail
-
getReturnType
public TypeDescription.Generic getReturnType()
Returns the return type of the described method.- Specified by:
getReturnTypein interfaceMethodDescription- Returns:
- The return type of the described method.
-
getTypeVariables
public TypeList.Generic getTypeVariables()
Returns the type variables that are declared by this element.- Specified by:
getTypeVariablesin interfaceTypeVariableSource- Returns:
- The type variables that are declared by this element.
-
getParameters
public ParameterList<ParameterDescription.InGenericShape> getParameters()
Returns a list of this method's parameters.- Specified by:
getParametersin interfaceMethodDescription- Specified by:
getParametersin interfaceMethodDescription.InGenericShape- Returns:
- A list of this method's parameters.
-
getExceptionTypes
public TypeList.Generic getExceptionTypes()
Returns the exception types of the described method.- Specified by:
getExceptionTypesin interfaceMethodDescription- Returns:
- The exception types of the described method.
-
getDefaultValue
public AnnotationValue<?,?> getDefaultValue()
Returns the method's default annotation value ornullif no default value is defined for this method.- Specified by:
getDefaultValuein interfaceMethodDescription- Returns:
- The method's default annotation value or
nullif no default value is defined for this method.
-
getReceiverType
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- Returns:
- This method's (annotated) receiver type.
-
getDeclaredAnnotations
public AnnotationList getDeclaredAnnotations()
Returns a list of annotations that are declared by this instance.- Specified by:
getDeclaredAnnotationsin interfaceAnnotationSource- Returns:
- A list of declared annotations.
-
getDeclaringType
public TypeDescription.Generic getDeclaringType()
Returns the declaring type of this instance.- Specified by:
getDeclaringTypein interfaceDeclaredByType- Specified by:
getDeclaringTypein interfaceMethodDescription.InGenericShape- Returns:
- The declaring type or
nullif no such type exists.
-
getModifiers
public int getModifiers()
Returns the modifier that is described by this object.- Specified by:
getModifiersin interfaceModifierReviewable- Returns:
- The modifier that is described by this object.
-
getInternalName
public java.lang.String getInternalName()
Returns the internal internalName of this byte code element.- Specified by:
getInternalNamein interfaceNamedElement.WithRuntimeName- Returns:
- The internal internalName of this byte code element as used within the Java class file format.
-
asDefined
public MethodDescription.InDefinedShape asDefined()
Returns this type dependant in its defined shape, i.e. the form it is declared in and without its type variable's resolved.- Specified by:
asDefinedin interfaceByteCodeElement.TypeDependant<MethodDescription.InDefinedShape,MethodDescription.Token>- Returns:
- This type dependant in its defined shape.
-
isConstructor
public boolean isConstructor()
Checks if this method description represents a constructor.- Specified by:
isConstructorin interfaceMethodDescription- Overrides:
isConstructorin classMethodDescription.AbstractBase- Returns:
trueif this method description represents a constructor.
-
isMethod
public boolean isMethod()
Checks if this method description represents a method, i.e. not a constructor or a type initializer.- Specified by:
isMethodin interfaceMethodDescription- Overrides:
isMethodin classMethodDescription.AbstractBase- Returns:
trueif this method description represents a Java method.
-
isTypeInitializer
public boolean isTypeInitializer()
Checks if this method is a type initializer.- Specified by:
isTypeInitializerin interfaceMethodDescription- Overrides:
isTypeInitializerin classMethodDescription.AbstractBase- Returns:
trueif this method description represents a type initializer.
-
-