Interface XMethod

  • All Superinterfaces:
    AccessibleEntity, AnnotatedObject, ClassMember, java.lang.Comparable, FieldOrMethodName, java.io.Serializable
    All Known Implementing Classes:
    AbstractMethod, MethodInfo

    public interface XMethod
    extends ClassMember, AnnotatedObject
    An XMethod represents symbolic information about a particular method.

    If the resolved() method returns true, then any information queried from this object can be assumed to be accurate. If the resolved() method returns false, then FindBugs can't find the method and any information other than name/signature/etc. cannot be trusted.

    Author:
    David Hovemeyer, Bill Pugh
    • Method Detail

      • isNative

        boolean isNative()
      • isAbstract

        boolean isAbstract()
      • isSynchronized

        boolean isSynchronized()
      • getNumParams

        int getNumParams()
      • getMethodDescriptor

        MethodDescriptor getMethodDescriptor()
        Returns:
        the MethodDescriptor identifying this object
      • getThrownExceptions

        java.lang.String[] getThrownExceptions()
        Returns:
        the exceptions this method is declared to throw
      • isUnconditionalThrower

        boolean isUnconditionalThrower()
        Returns:
        does this method unconditionally throw an exception?
      • usesConcurrency

        boolean usesConcurrency()
        Returns:
        does the method directly make use of concurrency/threads/synchronization?
      • isStub

        boolean isStub()
        Returns:
        is the method a synthetic stub method?
      • isBridged

        boolean isBridged()
        Returns:
        whether the method is a bridge method
      • getBridgeSignature

        java.lang.String getBridgeSignature()
        Returns:
        the signature for the bridge method
      • isUnsupported

        boolean isUnsupported()
        Returns:
        does this method unconditionally throw an UnsupportedOperationException?
      • isVarArgs

        boolean isVarArgs()
        Returns:
        is this a var args method?
      • isReturnTypeReferenceType

        boolean isReturnTypeReferenceType()
        Returns:
        true if method's return type is a reference type, false otherwise
      • getParameterAnnotationDescriptors

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

        @CheckForNull
        AnnotationValue getParameterAnnotation​(int param,
                                               ClassDescriptor desc)
        Get the AnnotationValue of annotation applied directly to given parameter.
        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

        java.util.Collection<AnnotationValue> getParameterAnnotations​(int param)
        Get collection of all AnnotationValues applied directly to given parameter.
        Parameters:
        param - parameter number (0 for first parameter)
        Returns:
        Collection of all AnnotationValues applied directly to given parameter
      • getAnnotationDescriptors

        java.util.Collection<ClassDescriptor> getAnnotationDescriptors()
        Get ClassDescriptors (annotation classes) of annotations applied directly to this method.
        Specified by:
        getAnnotationDescriptors in interface AnnotatedObject
        Returns:
        ClassDescriptors of annotations applied directly to this method
      • getAnnotation

        AnnotationValue getAnnotation​(ClassDescriptor desc)
        Get the AnnotationValue of annotation applied directly to the method.
        Specified by:
        getAnnotation in interface AnnotatedObject
        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

        java.util.Collection<AnnotationValue> getAnnotations()
        Get collection of all AnnotationValues applied directly to the method.
        Specified by:
        getAnnotations in interface AnnotatedObject
        Returns:
        Collection of all AnnotationValues applied directly to the method