Class MethodDescription.ForLoadedConstructor

    • Constructor Detail

      • ForLoadedConstructor

        public ForLoadedConstructor​(java.lang.reflect.Constructor<?> constructor)
        Creates a new immutable method description for a loaded constructor.
        Parameters:
        constructor - The loaded constructor to be represented by this method description.
    • Method Detail

      • getDeclaringType

        public TypeDescription getDeclaringType()
        Description copied from interface: DeclaredByType
        Returns the declaring type of this instance.
        Returns:
        The declaring type or null if no such type exists.
      • getReturnType

        public TypeDescription.Generic getReturnType()
        Description copied from interface: MethodDescription
        Returns the return type of the described method.
        Returns:
        The return type of the described method.
      • getExceptionTypes

        public TypeList.Generic getExceptionTypes()
        Description copied from interface: MethodDescription
        Returns the exception types of the described method.
        Returns:
        The exception types of the described method.
      • represents

        public boolean represents​(java.lang.reflect.Method method)
        Description copied from interface: MethodDescription
        Verifies if a method description represents a given loaded method.
        Specified by:
        represents in interface MethodDescription
        Overrides:
        represents in class MethodDescription.AbstractBase
        Parameters:
        method - The method to be checked.
        Returns:
        true if this method description represents the given loaded method.
      • represents

        public boolean represents​(java.lang.reflect.Constructor<?> constructor)
        Description copied from interface: MethodDescription
        Verifies if a method description represents a given loaded constructor.
        Specified by:
        represents in interface MethodDescription
        Overrides:
        represents in class MethodDescription.AbstractBase
        Parameters:
        constructor - The constructor to be checked.
        Returns:
        true if this method description represents the given loaded constructor.
      • getModifiers

        public int getModifiers()
        Description copied from interface: ModifierReviewable
        Returns the modifier that is described by this object.
        Returns:
        The modifier that is described by this object.
      • getInternalName

        public java.lang.String getInternalName()
        Description copied from interface: NamedElement.WithRuntimeName
        Returns the internal internalName of this byte code element.
        Returns:
        The internal internalName of this byte code element as used within the Java class file format.
      • getDefaultValue

        public AnnotationValue<?,​?> getDefaultValue()
        Description copied from interface: MethodDescription
        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.
      • getDeclaredAnnotations

        public AnnotationList getDeclaredAnnotations()
        Description copied from interface: AnnotationSource
        Returns a list of annotations that are declared by this instance.
        Returns:
        A list of declared annotations.
      • getTypeVariables

        public TypeList.Generic getTypeVariables()
        Description copied from interface: TypeVariableSource
        Returns the type variables that are declared by this element.
        Returns:
        The type variables that are declared by this element.
      • getReceiverType

        public TypeDescription.Generic getReceiverType()
        Description copied from interface: MethodDescription
        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.
        Specified by:
        getReceiverType in interface MethodDescription
        Overrides:
        getReceiverType in class MethodDescription.InDefinedShape.AbstractBase
        Returns:
        This method's (annotated) receiver type.