Class Transformer.ForMethod.TransformedMethod

All Implemented Interfaces:
AnnotationSource, ByteCodeElement, 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.
  • Field Details

    • instrumentedType

      private final TypeDescription instrumentedType
      The instrumented type for which this method is transformed.
    • declaringType

      private final TypeDefinition declaringType
      The method's declaring type.
    • token

      private final MethodDescription.Token token
      The method representing the transformed method.
    • methodDescription

      private final MethodDescription.InDefinedShape 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

      public TypeList.Generic getTypeVariables()
      Returns the type variables that are declared by this element.
      Returns:
      The type variables that are declared by this element.
    • getReturnType

      public TypeDescription.Generic getReturnType()
      Returns the return type of the described method.
      Returns:
      The return type of the described method.
    • getParameters

      public ParameterList<?> getParameters()
      Returns a list of this method's parameters.
      Returns:
      A list of this method's parameters.
    • getExceptionTypes

      public TypeList.Generic getExceptionTypes()
      Returns the exception types of the described method.
      Returns:
      The exception types of the described method.
    • getDeclaredAnnotations

      public AnnotationList getDeclaredAnnotations()
      Returns a list of annotations that are declared by this instance.
      Returns:
      A list of declared annotations.
    • getInternalName

      public String 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

      @Nonnull public TypeDefinition getDeclaringType()
      Returns the declaring type of this instance.
      Returns:
      The declaring type or null if 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

      @MaybeNull public AnnotationValue<?,?> getDefaultValue()
      Returns the method's default annotation value or null if no default value is defined for this method.
      Returns:
      The method's default annotation value or null if 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

      public TypeDescription.Generic getReceiverType()
      Returns this methods receiver type. A receiver type is undefined for static methods where null is 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.