Class FieldInfo
java.lang.Object
edu.umd.cs.findbugs.classfile.FieldOrMethodDescriptor
edu.umd.cs.findbugs.classfile.FieldDescriptor
edu.umd.cs.findbugs.classfile.analysis.FieldInfo
- All Implemented Interfaces:
AccessibleEntity
,ClassMember
,ComparableField
,XField
,AnnotatedObject
,FieldOrMethodName
,Serializable
,Comparable<ComparableField>
- Author:
- pugh
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAnnotation
(AnnotationValue annotationValue) Destructively add an annotation.int
compareTo
(ComparableField rhs) static FieldInfo
createUnresolvedFieldInfo
(String className, String name, String signature, boolean isStatic) Create a FieldInfo object to represent an unresolved field.int
Get the entity's access flags.getAnnotation
(ClassDescriptor desc) 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).int
Get the (dotted) name of the package in which the entity is defined.Get the signature representing the field/method's type, including generic typeboolean
Is the entity deprecated?boolean
isEnum()
boolean
isFinal()
Is the entity final?boolean
isNative()
boolean
Is the entity private?boolean
Is the entity protected?boolean
isPublic()
Is the entity public?boolean
Is the type of the field a reference type?boolean
Did we find a declaration of this entity?boolean
boolean
Is the entity synthetic?boolean
Is this a volatile field?Methods inherited from class edu.umd.cs.findbugs.classfile.FieldDescriptor
equals, toString
Methods inherited from class edu.umd.cs.findbugs.classfile.FieldOrMethodDescriptor
compareTo, compareTo, getClassDescriptor, getName, getNameSigHashCode, getNameSigHashCode, getSignature, getSlashedClassName, hashCode, haveEqualFields, isStatic
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface edu.umd.cs.findbugs.ba.AccessibleEntity
getClassDescriptor, isStatic
Methods inherited from interface edu.umd.cs.findbugs.classfile.analysis.AnnotatedObject
getClassDescriptor
Methods inherited from interface edu.umd.cs.findbugs.ba.ClassMember
getName, getSignature
Methods inherited from interface edu.umd.cs.findbugs.classfile.FieldOrMethodName
getClassDescriptor, isStatic
-
Field Details
-
EMPTY_ARRAY
-
-
Method Details
-
getNumParams
public int getNumParams() -
isNative
public boolean isNative() -
isSynchronized
public boolean isSynchronized() -
isDeprecated
public boolean isDeprecated()Description copied from interface:AccessibleEntity
Is the entity deprecated?- Specified by:
isDeprecated
in interfaceAccessibleEntity
-
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 interfaceClassMember
-
getPackageName
Description copied from interface:ClassMember
Get the (dotted) name of the package in which the entity is defined.- Specified by:
getPackageName
in interfaceClassMember
-
getSourceSignature
Description copied from interface:ClassMember
Get the signature representing the field/method's type, including generic type- Specified by:
getSourceSignature
in interfaceClassMember
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ComparableField>
- Overrides:
compareTo
in classFieldDescriptor
-
getAccessFlags
public int getAccessFlags()Description copied from interface:AccessibleEntity
Get the entity's access flags.- Specified by:
getAccessFlags
in interfaceAccessibleEntity
-
isFinal
public boolean isFinal()Description copied from interface:AccessibleEntity
Is the entity final?- Specified by:
isFinal
in interfaceAccessibleEntity
-
isPrivate
public boolean isPrivate()Description copied from interface:AccessibleEntity
Is the entity private?- Specified by:
isPrivate
in interfaceAccessibleEntity
-
isEnum
public boolean isEnum() -
isProtected
public boolean isProtected()Description copied from interface:AccessibleEntity
Is the entity protected?- Specified by:
isProtected
in interfaceAccessibleEntity
-
isPublic
public boolean isPublic()Description copied from interface:AccessibleEntity
Is the entity public?- Specified by:
isPublic
in interfaceAccessibleEntity
-
isResolved
public boolean isResolved()Description copied from interface:ClassMember
Did we find a declaration of this entity?- Specified by:
isResolved
in interfaceClassMember
-
isReferenceType
public boolean isReferenceType()Description copied from interface:XField
Is the type of the field a reference type?- Specified by:
isReferenceType
in interfaceXField
-
isVolatile
public boolean isVolatile()Description copied from interface:XField
Is this a volatile field?- Specified by:
isVolatile
in interfaceXField
-
isSynthetic
public boolean isSynthetic()Description copied from interface:AccessibleEntity
Is the entity synthetic?- Specified by:
isSynthetic
in interfaceAccessibleEntity
- Specified by:
isSynthetic
in interfaceAnnotatedObject
-
getAnnotationDescriptors
- Specified by:
getAnnotationDescriptors
in interfaceAnnotatedObject
-
getAnnotation
- Specified by:
getAnnotation
in interfaceAnnotatedObject
-
getAnnotations
- Specified by:
getAnnotations
in interfaceAnnotatedObject
-
addAnnotation
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 field has.)- Parameters:
annotationValue
- an AnnotationValue representing a field annotation
-
getFieldDescriptor
- Specified by:
getFieldDescriptor
in interfaceXField
- Returns:
- FieldDescriptor referring to this field
-
createUnresolvedFieldInfo
public static FieldInfo createUnresolvedFieldInfo(String className, String name, String signature, boolean isStatic) Create a FieldInfo object to represent an unresolved field. Don't call this directly - use XFactory instead.- Parameters:
className
- name of class containing the fieldname
- name of fieldsignature
- field signatureisStatic
- true if field is static, false otherwise- Returns:
- FieldInfo object representing the unresolved field
-
getElementType
- Specified by:
getElementType
in interfaceAnnotatedObject
-
getContainingScope
- Specified by:
getContainingScope
in interfaceAnnotatedObject
-