public class MethodInfo extends MethodDescriptor implements XMethod
Modifier and Type | Class and Description |
---|---|
static class |
MethodInfo.Builder |
static class |
MethodInfo.MethodInfoDatabase |
Modifier and Type | Field and Description |
---|---|
static MethodInfo[] |
EMPTY_ARRAY |
Modifier and Type | Method and Description |
---|---|
void |
addAnnotation(AnnotationValue annotationValue)
Destructively add an annotation.
|
void |
addParameterAnnotation(int param,
AnnotationValue annotationValue)
Destructively add a parameter annotation.
|
XMethod |
bridgeFrom() |
XMethod |
bridgeTo()
If nonnull, then this method is a synthetic method that overrides a
method in a superclass.
|
int |
compareTo(ComparableMethod rhs) |
int |
getAccessFlags()
Get the entity's access flags.
|
FieldDescriptor |
getAccessMethodForField() |
MethodDescriptor |
getAccessMethodForMethod() |
AnnotationValue |
getAnnotation(ClassDescriptor desc)
Get the AnnotationValue of annotation applied directly to the method.
|
java.util.Collection<ClassDescriptor> |
getAnnotationDescriptors()
Get ClassDescriptors (annotation classes) of annotations applied directly
to this method.
|
java.util.Collection<AnnotationValue> |
getAnnotations()
Get collection of all AnnotationValues applied directly to the method.
|
java.lang.String |
getClassName()
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).
|
AnnotatedObject |
getContainingScope() |
java.lang.annotation.ElementType |
getElementType() |
static java.util.IdentityHashMap<MethodInfo,java.lang.Void> |
getInvokeDynamicMethods() |
int |
getMethodCallCount() |
MethodDescriptor |
getMethodDescriptor() |
int |
getNumParams() |
java.lang.String |
getPackageName()
Get the (dotted) name of the package in which the entity is defined.
|
AnnotationValue |
getParameterAnnotation(int param,
ClassDescriptor desc)
Get the AnnotationValue of annotation applied directly to given
parameter.
|
java.util.Collection<ClassDescriptor> |
getParameterAnnotationDescriptors(int param)
Get ClassDescriptors (annotation classes) of annotations applied directly
to this method's parameters.
|
java.util.Collection<AnnotationValue> |
getParameterAnnotations(int param)
Get collection of all AnnotationValues applied directly to given
parameter.
|
java.lang.String |
getSourceSignature()
Get the signature representing the field/method's type, including generic
type
|
java.lang.String[] |
getThrownExceptions() |
boolean |
hasBackBranch() |
boolean |
hasParameterAnnotations() |
boolean |
isAbstract() |
boolean |
isBridge()
Is this a bridge method?
|
boolean |
isDeprecated()
Is the entity deprecated?
|
boolean |
isFinal()
Is the entity final?
|
boolean |
isIdentity()
Is this an identity method
|
boolean |
isNative() |
boolean |
isPrivate()
Is the entity private?
|
boolean |
isProtected()
Is the entity protected?
|
boolean |
isPublic()
Is the entity public?
|
boolean |
isResolved()
Did we find a declaration of this entity?
|
boolean |
isReturnTypeReferenceType() |
boolean |
isStub() |
boolean |
isSynchronized() |
boolean |
isSynthetic()
Is the entity synthetic?
|
boolean |
isUnconditionalThrower() |
boolean |
isUnsupported() |
boolean |
isVarArgs() |
boolean |
isVariableSynthetic(int param)
Is the variable synthetic?
|
static MethodInfo[] |
newArray(int sz) |
XMethod |
resolveAccessMethodForMethod() |
boolean |
usesConcurrency() |
boolean |
usesInvokeDynamic() |
equals
compareTo, compareTo, getClassDescriptor, getName, getNameSigHashCode, getNameSigHashCode, getSignature, getSlashedClassName, hashCode, haveEqualFields, isStatic, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getName, getSignature
getClassDescriptor, isStatic
getClassDescriptor, isStatic
getClassDescriptor
public static final MethodInfo[] EMPTY_ARRAY
public static MethodInfo[] newArray(int sz)
public static java.util.IdentityHashMap<MethodInfo,java.lang.Void> getInvokeDynamicMethods()
@CheckForNull public java.lang.String[] getThrownExceptions()
getThrownExceptions
in interface XMethod
public boolean isUnconditionalThrower()
isUnconditionalThrower
in interface XMethod
public boolean isIdentity()
XMethod
isIdentity
in interface XMethod
public boolean usesInvokeDynamic()
usesInvokeDynamic
in interface XMethod
public boolean isUnsupported()
isUnsupported
in interface XMethod
public int getNumParams()
getNumParams
in interface XMethod
public boolean isVariableSynthetic(int param)
XMethod
isVariableSynthetic
in interface XMethod
public int getMethodCallCount()
public boolean isAbstract()
isAbstract
in interface XMethod
public boolean isSynchronized()
isSynchronized
in interface XMethod
public boolean isBridge()
XMethod
public boolean isReturnTypeReferenceType()
isReturnTypeReferenceType
in interface XMethod
@DottedClassName public java.lang.String getClassName()
ClassMember
getClassName
in interface ClassMember
@DottedClassName public java.lang.String getPackageName()
ClassMember
getPackageName
in interface ClassMember
public java.lang.String getSourceSignature()
ClassMember
getSourceSignature
in interface ClassMember
public int compareTo(ComparableMethod rhs)
compareTo
in interface java.lang.Comparable<ComparableMethod>
compareTo
in class MethodDescriptor
public int getAccessFlags()
AccessibleEntity
getAccessFlags
in interface AccessibleEntity
public boolean isFinal()
AccessibleEntity
isFinal
in interface AccessibleEntity
public boolean isPrivate()
AccessibleEntity
isPrivate
in interface AccessibleEntity
public boolean isDeprecated()
AccessibleEntity
isDeprecated
in interface AccessibleEntity
public boolean isProtected()
AccessibleEntity
isProtected
in interface AccessibleEntity
public boolean isPublic()
AccessibleEntity
isPublic
in interface AccessibleEntity
public boolean isSynthetic()
AccessibleEntity
isSynthetic
in interface AccessibleEntity
isSynthetic
in interface AnnotatedObject
public boolean isResolved()
ClassMember
isResolved
in interface ClassMember
public java.util.Collection<ClassDescriptor> getParameterAnnotationDescriptors(int param)
XMethod
getParameterAnnotationDescriptors
in interface XMethod
param
- parameter number (0 for first parameter)public boolean hasParameterAnnotations()
hasParameterAnnotations
in interface XMethod
@Nullable public AnnotationValue getParameterAnnotation(int param, ClassDescriptor desc)
XMethod
getParameterAnnotation
in interface XMethod
param
- parameter number (0 for first parameter)desc
- ClassDescriptor of the annotation classpublic java.util.Collection<AnnotationValue> getParameterAnnotations(int param)
XMethod
getParameterAnnotations
in interface XMethod
param
- parameter number (0 for first parameter)public java.util.Collection<ClassDescriptor> getAnnotationDescriptors()
XMethod
getAnnotationDescriptors
in interface XMethod
getAnnotationDescriptors
in interface AnnotatedObject
public AnnotationValue getAnnotation(ClassDescriptor desc)
XMethod
getAnnotation
in interface XMethod
getAnnotation
in interface AnnotatedObject
desc
- ClassDescriptor of the annotation classpublic java.util.Collection<AnnotationValue> getAnnotations()
XMethod
getAnnotations
in interface XMethod
getAnnotations
in interface AnnotatedObject
public void addAnnotation(AnnotationValue annotationValue)
addAnnotation
in interface XMethod
annotationValue
- an AnnotationValue representing a method annotationpublic void addParameterAnnotation(int param, AnnotationValue annotationValue)
addParameterAnnotation
in interface XMethod
param
- parameter (0 == first parameter)annotationValue
- an AnnotationValue representing a parameter annotationpublic MethodDescriptor getMethodDescriptor()
getMethodDescriptor
in interface XMethod
public java.lang.annotation.ElementType getElementType()
getElementType
in interface AnnotatedObject
@CheckForNull public AnnotatedObject getContainingScope()
getContainingScope
in interface AnnotatedObject
public boolean isVarArgs()
public boolean usesConcurrency()
usesConcurrency
in interface XMethod
public boolean hasBackBranch()
public boolean isStub()
@CheckForNull public MethodDescriptor getAccessMethodForMethod()
getAccessMethodForMethod
in interface XMethod
@CheckForNull public FieldDescriptor getAccessMethodForField()
getAccessMethodForField
in interface XMethod
public XMethod bridgeFrom()
bridgeFrom
in interface XMethod
public XMethod bridgeTo()
XMethod
public XMethod resolveAccessMethodForMethod()
resolveAccessMethodForMethod
in interface XMethod
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.