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 TypeMethodDescriptionvoidaddAnnotation(AnnotationValue annotationValue) Destructively add an annotation.intcompareTo(ComparableField rhs) static FieldInfocreateUnresolvedFieldInfo(String className, String name, String signature, boolean isStatic) Create a FieldInfo object to represent an unresolved field.intGet 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).intGet the (dotted) name of the package in which the entity is defined.Get the signature representing the field/method's type, including generic typebooleanIs the entity deprecated?booleanisEnum()booleanisFinal()Is the entity final?booleanisNative()booleanIs the entity private?booleanIs the entity protected?booleanisPublic()Is the entity public?booleanIs the type of the field a reference type?booleanDid we find a declaration of this entity?booleanbooleanIs the entity synthetic?booleanIs this a volatile field?Methods inherited from class edu.umd.cs.findbugs.classfile.FieldDescriptor
equals, toStringMethods inherited from class edu.umd.cs.findbugs.classfile.FieldOrMethodDescriptor
compareTo, compareTo, getClassDescriptor, getName, getNameSigHashCode, getNameSigHashCode, getSignature, getSlashedClassName, hashCode, haveEqualFields, isStaticMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface edu.umd.cs.findbugs.ba.AccessibleEntity
getClassDescriptor, isStaticMethods inherited from interface edu.umd.cs.findbugs.classfile.analysis.AnnotatedObject
getClassDescriptorMethods inherited from interface edu.umd.cs.findbugs.ba.ClassMember
getName, getSignatureMethods 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:AccessibleEntityIs the entity deprecated?- Specified by:
isDeprecatedin interfaceAccessibleEntity
-
getClassName
Description copied from interface:ClassMemberGet 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:
getClassNamein interfaceClassMember
-
getPackageName
Description copied from interface:ClassMemberGet the (dotted) name of the package in which the entity is defined.- Specified by:
getPackageNamein interfaceClassMember
-
getSourceSignature
Description copied from interface:ClassMemberGet the signature representing the field/method's type, including generic type- Specified by:
getSourceSignaturein interfaceClassMember
-
compareTo
- Specified by:
compareToin interfaceComparable<ComparableField>- Overrides:
compareToin classFieldDescriptor
-
getAccessFlags
public int getAccessFlags()Description copied from interface:AccessibleEntityGet the entity's access flags.- Specified by:
getAccessFlagsin interfaceAccessibleEntity
-
isFinal
public boolean isFinal()Description copied from interface:AccessibleEntityIs the entity final?- Specified by:
isFinalin interfaceAccessibleEntity
-
isPrivate
public boolean isPrivate()Description copied from interface:AccessibleEntityIs the entity private?- Specified by:
isPrivatein interfaceAccessibleEntity
-
isEnum
public boolean isEnum() -
isProtected
public boolean isProtected()Description copied from interface:AccessibleEntityIs the entity protected?- Specified by:
isProtectedin interfaceAccessibleEntity
-
isPublic
public boolean isPublic()Description copied from interface:AccessibleEntityIs the entity public?- Specified by:
isPublicin interfaceAccessibleEntity
-
isResolved
public boolean isResolved()Description copied from interface:ClassMemberDid we find a declaration of this entity?- Specified by:
isResolvedin interfaceClassMember
-
isReferenceType
public boolean isReferenceType()Description copied from interface:XFieldIs the type of the field a reference type?- Specified by:
isReferenceTypein interfaceXField
-
isVolatile
public boolean isVolatile()Description copied from interface:XFieldIs this a volatile field?- Specified by:
isVolatilein interfaceXField
-
isSynthetic
public boolean isSynthetic()Description copied from interface:AccessibleEntityIs the entity synthetic?- Specified by:
isSyntheticin interfaceAccessibleEntity- Specified by:
isSyntheticin interfaceAnnotatedObject
-
getAnnotationDescriptors
- Specified by:
getAnnotationDescriptorsin interfaceAnnotatedObject
-
getAnnotation
- Specified by:
getAnnotationin interfaceAnnotatedObject
-
getAnnotations
- Specified by:
getAnnotationsin 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:
getFieldDescriptorin 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:
getElementTypein interfaceAnnotatedObject
-
getContainingScope
- Specified by:
getContainingScopein interfaceAnnotatedObject
-