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.Member, ByteCodeElement.TypeDependant<MethodDescription.InDefinedShape, MethodDescription.Token>, DeclaredByType, DeclaredByType.WithMandatoryDeclaration, MethodDescription, MethodDescription.InGenericShape, 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.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 AnnotationSource
AnnotationSource.Empty, AnnotationSource.ExplicitNested classes/interfaces inherited from interface ByteCodeElement
ByteCodeElement.Member, ByteCodeElement.TypeDependant<T,S> Nested classes/interfaces inherited from interface DeclaredByType
DeclaredByType.WithMandatoryDeclarationNested classes/interfaces inherited from interface MethodDescription
MethodDescription.AbstractBase, MethodDescription.ForLoadedConstructor, MethodDescription.ForLoadedMethod, MethodDescription.InDefinedShape, MethodDescription.InGenericShape, MethodDescription.Latent, MethodDescription.SignatureToken, MethodDescription.Token, MethodDescription.TypeSubstituting, MethodDescription.TypeTokenNested classes/interfaces inherited from interface ModifierReviewable
ModifierReviewable.AbstractBase, ModifierReviewable.ForFieldDescription, ModifierReviewable.ForMethodDescription, ModifierReviewable.ForModuleDescription, ModifierReviewable.ForModuleRequirement, ModifierReviewable.ForParameterDescription, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumeration, ModifierReviewable.OfMandatableNested classes/interfaces inherited from interface NamedElement
NamedElement.WithDescriptor, NamedElement.WithGenericName, NamedElement.WithOptionalName, NamedElement.WithRuntimeNameNested classes/interfaces inherited from interface TypeVariableSource
TypeVariableSource.AbstractBase, TypeVariableSource.Visitor<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TypeDescription.GenericThe type that declares this type-substituted method.private final MethodDescriptionThe represented method description.private final TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> A visitor that is applied to the method type.Fields inherited from interface MethodDescription
CONSTRUCTOR_INTERNAL_NAME, TYPE_INITIALIZER_INTERNAL_NAME, TYPE_INITIALIZER_MODIFIER, UNDEFINEDFields inherited from interface ModifierReviewable
EMPTY_MASKFields inherited from interface NamedElement
EMPTY_NAME, NO_NAMEFields inherited from interface NamedElement.WithDescriptor
NON_GENERIC_SIGNATUREFields inherited from interface TypeVariableSource
UNDEFINED -
Constructor Summary
ConstructorsConstructorDescriptionTypeSubstituting(TypeDescription.Generic declaringType, MethodDescription methodDescription, TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor) Creates a method description with substituted method types. -
Method Summary
Modifier and TypeMethodDescriptionReturns this type dependant in its defined shape, i.e.Returns a list of annotations that are declared by this instance.Returns the declaring type of this instance.AnnotationValue<?, ?> Returns the method's default annotation value ornullif no default value is defined for this method.Returns the exception types of the described method.Returns the internal name of this byte code element.intReturns the modifier that is described by this object.Returns a list of this method's parameters.Returns this methods receiver type.Returns the return type of the described method.Returns the type variables that are declared by this element.booleanChecks if this method description represents a constructor.booleanisMethod()Checks if this method description represents a method, i.e.booleanChecks if this method is a type initializer.Methods inherited from class 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, toSafeString, toStringMethods inherited from class TypeVariableSource.AbstractBase
findExpectedVariable, findVariableMethods inherited from class 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, isVolatileMethods inherited from interface ByteCodeElement
isAccessibleTo, isVisibleToMethods inherited from interface ByteCodeElement.TypeDependant
asTokenMethods inherited from interface MethodDescription
asSignatureToken, asTypeToken, getActualModifiers, getActualModifiers, getActualModifiers, getDefaultValue, getStackSize, isBridgeCompatible, isConstantBootstrap, isConstantBootstrap, isDefaultMethod, isDefaultValue, isDefaultValue, isInvokableOn, isInvokeBootstrap, isInvokeBootstrap, isSpecializableFor, isVirtual, represents, representsMethods inherited from interface ModifierReviewable
getSyntheticState, isFinal, isSyntheticMethods inherited from interface ModifierReviewable.ForMethodDescription
getMethodManifestation, getMethodStrictness, getSynchronizationState, isBridge, isNative, isStrict, isSynchronized, isVarArgsMethods inherited from interface ModifierReviewable.OfAbstraction
isAbstractMethods inherited from interface ModifierReviewable.OfByteCodeElement
getOwnership, getVisibility, isDeprecated, isPackagePrivate, isPrivate, isProtected, isPublic, isStaticMethods inherited from interface NamedElement
getActualNameMethods inherited from interface NamedElement.WithDescriptor
getDescriptor, getGenericSignatureMethods inherited from interface NamedElement.WithGenericName
toGenericStringMethods inherited from interface NamedElement.WithRuntimeName
getNameMethods inherited from interface TypeVariableSource
accept, findExpectedVariable, findVariable, getEnclosingSource, isGenerified, isInferrable
-
Field Details
-
declaringType
The type that declares this type-substituted method. -
methodDescription
The represented method description. -
visitor
A visitor that is applied to the method type.
-
-
Constructor Details
-
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 Details
-
getReturnType
Returns the return type of the described method.- Specified by:
getReturnTypein interfaceMethodDescription- Returns:
- The return type of the described method.
-
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
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
Returns the exception types of the described method.- Specified by:
getExceptionTypesin interfaceMethodDescription- Returns:
- The exception types of the described method.
-
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
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
Returns a list of annotations that are declared by this instance.- Specified by:
getDeclaredAnnotationsin interfaceAnnotationSource- Returns:
- A list of declared annotations.
-
getDeclaringType
Returns the declaring type of this instance.- Specified by:
getDeclaringTypein interfaceDeclaredByType- Specified by:
getDeclaringTypein interfaceDeclaredByType.WithMandatoryDeclaration- Specified by:
getDeclaringTypein interfaceMethodDescription- 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
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.- Specified by:
getInternalNamein interfaceNamedElement.WithRuntimeName- Returns:
- The internal name of this byte code element as used within the Java class file format.
-
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.
-