Package net.bytebuddy.dynamic
Class Transformer.ForMethod.TransformedMethod
java.lang.Object
net.bytebuddy.description.ModifierReviewable.AbstractBase
net.bytebuddy.description.TypeVariableSource.AbstractBase
net.bytebuddy.description.method.MethodDescription.AbstractBase
net.bytebuddy.dynamic.Transformer.ForMethod.TransformedMethod
- All Implemented Interfaces:
AnnotationSource,ByteCodeElement,ByteCodeElement.Member,ByteCodeElement.TypeDependant<MethodDescription.InDefinedShape,,MethodDescription.Token> DeclaredByType,DeclaredByType.WithMandatoryDeclaration,MethodDescription,ModifierReviewable,ModifierReviewable.ForFieldDescription,ModifierReviewable.ForMethodDescription,ModifierReviewable.ForParameterDescription,ModifierReviewable.ForTypeDefinition,ModifierReviewable.OfAbstraction,ModifierReviewable.OfByteCodeElement,ModifierReviewable.OfEnumeration,NamedElement,NamedElement.WithDescriptor,NamedElement.WithGenericName,NamedElement.WithRuntimeName,TypeVariableSource
- Enclosing class:
Transformer.ForMethod
protected static class Transformer.ForMethod.TransformedMethod
extends MethodDescription.AbstractBase
The transformed method.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classA visitor that attaches type variables based on the transformed method's type variables and the instrumented type.protected classA transformed method's parameter.protected classA parameter list representing the transformed method's parameters.Nested classes/interfaces inherited from interface net.bytebuddy.description.annotation.AnnotationSource
AnnotationSource.Empty, AnnotationSource.ExplicitNested classes/interfaces inherited from interface net.bytebuddy.description.ByteCodeElement
ByteCodeElement.Member, ByteCodeElement.TypeDependant<T extends ByteCodeElement.TypeDependant<?,S>, S extends ByteCodeElement.Token<S>> Nested classes/interfaces inherited from interface net.bytebuddy.description.DeclaredByType
DeclaredByType.WithMandatoryDeclarationNested 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.TypeTokenNested classes/interfaces inherited from interface net.bytebuddy.description.ModifierReviewable
ModifierReviewable.AbstractBase, ModifierReviewable.ForFieldDescription, ModifierReviewable.ForMethodDescription, ModifierReviewable.ForParameterDescription, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumerationNested classes/interfaces inherited from interface net.bytebuddy.description.NamedElement
NamedElement.WithDescriptor, NamedElement.WithGenericName, NamedElement.WithOptionalName, NamedElement.WithRuntimeNameNested classes/interfaces inherited from interface net.bytebuddy.description.TypeVariableSource
TypeVariableSource.AbstractBase, TypeVariableSource.Visitor<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TypeDefinitionThe method's declaring type.private final TypeDescriptionThe instrumented type for which this method is transformed.private final MethodDescription.InDefinedShapeThe defined shape of the transformed method.private final MethodDescription.TokenThe method representing the transformed method.Fields inherited from interface net.bytebuddy.description.method.MethodDescription
CONSTRUCTOR_INTERNAL_NAME, TYPE_INITIALIZER_INTERNAL_NAME, TYPE_INITIALIZER_MODIFIER, UNDEFINEDFields inherited from interface net.bytebuddy.description.ModifierReviewable
EMPTY_MASKFields inherited from interface net.bytebuddy.description.NamedElement
EMPTY_NAME, NO_NAMEFields inherited from interface net.bytebuddy.description.NamedElement.WithDescriptor
NON_GENERIC_SIGNATUREFields inherited from interface net.bytebuddy.description.TypeVariableSource
UNDEFINED -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTransformedMethod(TypeDescription instrumentedType, TypeDefinition declaringType, MethodDescription.Token token, MethodDescription.InDefinedShape methodDescription) Creates a new transformed method. -
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.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, isConstructor, isDefaultMethod, isDefaultValue, isDefaultValue, isGenerified, isInferrable, isInvokableOn, isInvokeBootstrap, isInvokeBootstrap, isMethod, isSpecializableFor, isTypeInitializer, isVirtual, isVisibleTo, represents, represents, toGenericString, toSafeString, toStringMethods inherited from class net.bytebuddy.description.TypeVariableSource.AbstractBase
findExpectedVariable, findVariableMethods 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, isVolatileMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.bytebuddy.description.ModifierReviewable
getSyntheticState, isFinal, isSyntheticMethods inherited from interface net.bytebuddy.description.ModifierReviewable.ForMethodDescription
getMethodManifestation, getMethodStrictness, getSynchronizationState, isBridge, isNative, isStrict, isSynchronized, isVarArgsMethods inherited from interface net.bytebuddy.description.ModifierReviewable.OfAbstraction
isAbstractMethods inherited from interface net.bytebuddy.description.ModifierReviewable.OfByteCodeElement
getOwnership, getVisibility, isDeprecated, isPackagePrivate, isPrivate, isProtected, isPublic, isStaticMethods inherited from interface net.bytebuddy.description.TypeVariableSource
findExpectedVariable, findVariable
-
Field Details
-
instrumentedType
The instrumented type for which this method is transformed. -
declaringType
The method's declaring type. -
token
The method representing the transformed method. -
methodDescription
The defined shape of the transformed method.
-
-
Constructor Details
-
TransformedMethod
protected TransformedMethod(TypeDescription instrumentedType, TypeDefinition declaringType, MethodDescription.Token token, MethodDescription.InDefinedShape methodDescription) Creates a new transformed method.- Parameters:
instrumentedType- The instrumented type for which this method is transformed.declaringType- The method's declaring type.token- The method representing the transformed method.methodDescription- The defined shape of the transformed method.
-
-
Method Details
-
getTypeVariables
Returns the type variables that are declared by this element.- Returns:
- The type variables that are declared by this element.
-
getReturnType
Returns the return type of the described method.- Returns:
- The return type of the described method.
-
getParameters
Returns a list of this method's parameters.- Returns:
- A list of this method's parameters.
-
getExceptionTypes
Returns the exception types of the described method.- Returns:
- The exception types of the described method.
-
getDeclaredAnnotations
Returns a list of annotations that are declared by this instance.- Returns:
- A list of declared annotations.
-
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.- Returns:
- The internal name of this byte code element as used within the Java class file format.
-
getDeclaringType
Returns the declaring type of this instance.- Returns:
- The declaring type or
nullif no such type exists.
-
getModifiers
public int getModifiers()Returns the modifier that is described by this object.- Returns:
- The modifier that is described by this object.
-
getDefaultValue
Returns the method's default annotation value ornullif no default value is defined for this method.- Returns:
- The method's default annotation value or
nullif no default value is defined for this method.
-
asDefined
Returns this type dependant in its defined shape, i.e. the form it is declared in and without its type variable's resolved.- Returns:
- This type dependant in its defined shape.
-
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.- Returns:
- This method's (annotated) receiver type.
-