Class MethodInfo

    • Field Detail

      • EMPTY_ARRAY

        public static final MethodInfo[] EMPTY_ARRAY
    • Method Detail

      • newArray

        public static MethodInfo[] newArray​(int sz)
      • getInvokeDynamicMethods

        public static java.util.IdentityHashMap<MethodInfo,​java.lang.Void> getInvokeDynamicMethods()
      • getThrownExceptions

        @CheckForNull
        public java.lang.String[] getThrownExceptions()
        Specified by:
        getThrownExceptions in interface XMethod
        Returns:
        the exceptions this method is declared to throw
      • isUnconditionalThrower

        public boolean isUnconditionalThrower()
        Specified by:
        isUnconditionalThrower in interface XMethod
        Returns:
        does this method unconditionally throw an exception?
      • isIdentity

        public boolean isIdentity()
        Description copied from interface: XMethod
        Is this an identity method
        Specified by:
        isIdentity in interface XMethod
      • isUnsupported

        public boolean isUnsupported()
        Specified by:
        isUnsupported in interface XMethod
        Returns:
        does this method unconditionally throw an UnsupportedOperationException?
      • isVariableSynthetic

        public boolean isVariableSynthetic​(int param)
        Description copied from interface: XMethod
        Is the variable synthetic?
        Specified by:
        isVariableSynthetic in interface XMethod
      • getMethodCallCount

        public int getMethodCallCount()
      • isNative

        public boolean isNative()
        Specified by:
        isNative in interface XMethod
      • isAbstract

        public boolean isAbstract()
        Specified by:
        isAbstract in interface XMethod
      • isBridge

        public boolean isBridge()
        Description copied from interface: XMethod
        Is this a bridge method?
        Specified by:
        isBridge in interface XMethod
      • isReturnTypeReferenceType

        public boolean isReturnTypeReferenceType()
        Specified by:
        isReturnTypeReferenceType in interface XMethod
        Returns:
        true if method's return type is a reference type, false otherwise
      • getClassName

        @DottedClassName
        public java.lang.String getClassName()
        Description copied from interface: ClassMember
        Get the full (dotted) name of the class (if the object represents a class) or the class the entity is defined in (if a field or method).
        Specified by:
        getClassName in interface ClassMember
      • getSourceSignature

        public java.lang.String getSourceSignature()
        Description copied from interface: ClassMember
        Get the signature representing the field/method's type, including generic type
        Specified by:
        getSourceSignature in interface ClassMember
      • isResolved

        public boolean isResolved()
        Description copied from interface: ClassMember
        Did we find a declaration of this entity?
        Specified by:
        isResolved in interface ClassMember
      • getParameterAnnotationDescriptors

        public java.util.Collection<ClassDescriptor> getParameterAnnotationDescriptors​(int param)
        Description copied from interface: XMethod
        Get ClassDescriptors (annotation classes) of annotations applied directly to this method's parameters.
        Specified by:
        getParameterAnnotationDescriptors in interface XMethod
        Parameters:
        param - parameter number (0 for first parameter)
        Returns:
        ClassDescriptors of annotations applied directly to this method's parameters
      • getParameterAnnotation

        @Nullable
        public AnnotationValue getParameterAnnotation​(int param,
                                                      ClassDescriptor desc)
        Description copied from interface: XMethod
        Get the AnnotationValue of annotation applied directly to given parameter.
        Specified by:
        getParameterAnnotation in interface XMethod
        Parameters:
        param - parameter number (0 for first parameter)
        desc - ClassDescriptor of the annotation class
        Returns:
        AnnotationValue annotating the parameter, or null if parameter is not annotated with this kind of annotation
      • getParameterAnnotations

        public java.util.Collection<AnnotationValue> getParameterAnnotations​(int param)
        Description copied from interface: XMethod
        Get collection of all AnnotationValues applied directly to given parameter.
        Specified by:
        getParameterAnnotations in interface XMethod
        Parameters:
        param - parameter number (0 for first parameter)
        Returns:
        Collection of all AnnotationValues applied directly to given parameter
      • getAnnotation

        public AnnotationValue getAnnotation​(ClassDescriptor desc)
        Description copied from interface: XMethod
        Get the AnnotationValue of annotation applied directly to the method.
        Specified by:
        getAnnotation in interface AnnotatedObject
        Specified by:
        getAnnotation in interface XMethod
        Parameters:
        desc - ClassDescriptor of the annotation class
        Returns:
        AnnotationValue annotating the method, or null if method is not annotated with this kind of annotation
      • getAnnotations

        public java.util.Collection<AnnotationValue> getAnnotations()
        Description copied from interface: XMethod
        Get collection of all AnnotationValues applied directly to the method.
        Specified by:
        getAnnotations in interface AnnotatedObject
        Specified by:
        getAnnotations in interface XMethod
        Returns:
        Collection of all AnnotationValues applied directly to the method
      • addAnnotation

        public void addAnnotation​(AnnotationValue annotationValue)
        Destructively add an annotation. We do this for "built-in" annotations that might not be directly evident in the code. It's not a great idea in general, but we can get away with it as long as it's done early enough (i.e., before anyone asks what annotations this method has.)
        Specified by:
        addAnnotation in interface XMethod
        Parameters:
        annotationValue - an AnnotationValue representing a method annotation
      • addParameterAnnotation

        public void addParameterAnnotation​(int param,
                                           AnnotationValue annotationValue)
        Destructively add a parameter annotation.
        Specified by:
        addParameterAnnotation in interface XMethod
        Parameters:
        param - parameter (0 == first parameter)
        annotationValue - an AnnotationValue representing a parameter annotation
      • isVarArgs

        public boolean isVarArgs()
        Specified by:
        isVarArgs in interface XMethod
        Returns:
        is this a var args method?
      • usesConcurrency

        public boolean usesConcurrency()
        Specified by:
        usesConcurrency in interface XMethod
        Returns:
        does the method directly make use of concurrency/threads/synchronization?
      • hasBackBranch

        public boolean hasBackBranch()
      • isStub

        public boolean isStub()
        Specified by:
        isStub in interface XMethod
        Returns:
        is the method a synthetic stub method?
      • bridgeTo

        public XMethod bridgeTo()
        Description copied from interface: XMethod
        If nonnull, then this method is a synthetic method that overrides a method in a superclass. This method simply forwards the call to the method it bridges to, which is a method with an identical name but possibly co-variant arguments and return values.
        Specified by:
        bridgeTo in interface XMethod