FindBugs™ 1.3.9

edu.umd.cs.findbugs.classfile.analysis
Class FieldInfo

java.lang.Object
  extended by edu.umd.cs.findbugs.classfile.FieldOrMethodDescriptor
      extended by edu.umd.cs.findbugs.classfile.FieldDescriptor
          extended by edu.umd.cs.findbugs.classfile.analysis.FieldInfo
All Implemented Interfaces:
AccessibleEntity, ClassMember, XField, AnnotatedObject, FieldOrMethodName, java.io.Serializable, java.lang.Comparable

public class FieldInfo
extends FieldDescriptor
implements XField, AnnotatedObject

Author:
pugh
See Also:
Serialized Form

Nested Class Summary
static class FieldInfo.Builder
           
 
Field Summary
static FieldInfo[] EMPTY_ARRAY
           
 
Method Summary
 void addAnnotation(AnnotationValue annotationValue)
          Destructively add an annotation.
 int compareTo(java.lang.Object rhs)
           
static FieldInfo createUnresolvedFieldInfo(java.lang.String className, java.lang.String name, java.lang.String signature, boolean isStatic)
          Create a FieldInfo object to represent an unresolved field.
 int getAccessFlags()
          Get the entity's access flags.
 AnnotationValue getAnnotation(ClassDescriptor desc)
           
 java.util.Collection<ClassDescriptor> getAnnotationDescriptors()
           
 java.util.Collection<AnnotationValue> getAnnotations()
           
 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()
           
 FieldDescriptor getFieldDescriptor()
           
 int getNumParams()
           
 java.lang.String getPackageName()
          Get the (dotted) name of the package in which the entity is defined.
 java.lang.String getSourceSignature()
          Get the signature representing the field/method's type, including generic type
 boolean isDeprecated()
          Is the entity deprecated?
 boolean isFinal()
          Is the entity final?
 boolean isNative()
           
 boolean isPrivate()
          Is the entity private?
 boolean isProtected()
          Is the entity protected?
 boolean isPublic()
          Is the entity public?
 boolean isReferenceType()
          Is the type of the field a reference type?
 boolean isResolved()
          Did we find a declaration of this entity?
 boolean isSynchronized()
           
 boolean isSynthetic()
          Is the entity synthetic?
 boolean isVolatile()
          Is this a volatile field?
 
Methods inherited from class edu.umd.cs.findbugs.classfile.FieldOrMethodDescriptor
compareTo, equals, getClassDescriptor, getName, getNameSigHashCode, getNameSigHashCode, getSignature, getSlashedClassName, hashCode, isStatic, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.umd.cs.findbugs.ba.ClassMember
getName, getSignature
 
Methods inherited from interface edu.umd.cs.findbugs.ba.AccessibleEntity
getClassDescriptor, isStatic
 
Methods inherited from interface edu.umd.cs.findbugs.classfile.FieldOrMethodName
getClassDescriptor, isStatic
 
Methods inherited from interface edu.umd.cs.findbugs.classfile.analysis.AnnotatedObject
getClassDescriptor
 

Field Detail

EMPTY_ARRAY

public static final FieldInfo[] EMPTY_ARRAY
Method Detail

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 interface AccessibleEntity

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

getPackageName

@DottedClassName
public java.lang.String getPackageName()
Description copied from interface: ClassMember
Get the (dotted) name of the package in which the entity is defined.

Specified by:
getPackageName 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

compareTo

public int compareTo(java.lang.Object rhs)
Specified by:
compareTo in interface java.lang.Comparable
Overrides:
compareTo in class FieldOrMethodDescriptor

getAccessFlags

public int getAccessFlags()
Description copied from interface: AccessibleEntity
Get the entity's access flags.

Specified by:
getAccessFlags in interface AccessibleEntity

isFinal

public boolean isFinal()
Description copied from interface: AccessibleEntity
Is the entity final?

Specified by:
isFinal in interface AccessibleEntity

isPrivate

public boolean isPrivate()
Description copied from interface: AccessibleEntity
Is the entity private?

Specified by:
isPrivate in interface AccessibleEntity

isProtected

public boolean isProtected()
Description copied from interface: AccessibleEntity
Is the entity protected?

Specified by:
isProtected in interface AccessibleEntity

isPublic

public boolean isPublic()
Description copied from interface: AccessibleEntity
Is the entity public?

Specified by:
isPublic in interface AccessibleEntity

isResolved

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

Specified by:
isResolved in interface ClassMember

isReferenceType

public boolean isReferenceType()
Description copied from interface: XField
Is the type of the field a reference type?

Specified by:
isReferenceType in interface XField

isVolatile

public boolean isVolatile()
Description copied from interface: XField
Is this a volatile field?

Specified by:
isVolatile in interface XField

isSynthetic

public boolean isSynthetic()
Description copied from interface: AccessibleEntity
Is the entity synthetic?

Specified by:
isSynthetic in interface AccessibleEntity
Specified by:
isSynthetic in interface AnnotatedObject

getAnnotationDescriptors

public java.util.Collection<ClassDescriptor> getAnnotationDescriptors()
Specified by:
getAnnotationDescriptors in interface AnnotatedObject

getAnnotation

public AnnotationValue getAnnotation(ClassDescriptor desc)
Specified by:
getAnnotation in interface AnnotatedObject

getAnnotations

public java.util.Collection<AnnotationValue> getAnnotations()
Specified by:
getAnnotations in interface AnnotatedObject

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 field has.)

Parameters:
annotationValue - an AnnotationValue representing a field annotation

getFieldDescriptor

public FieldDescriptor getFieldDescriptor()
Specified by:
getFieldDescriptor in interface XField
Returns:
FieldDescriptor referring to this field

createUnresolvedFieldInfo

public static FieldInfo createUnresolvedFieldInfo(java.lang.String className,
                                                  java.lang.String name,
                                                  java.lang.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 field
name - name of field
signature - field signature
isStatic - true if field is static, false otherwise
Returns:
FieldInfo object representing the unresolved field

getElementType

public java.lang.annotation.ElementType getElementType()
Specified by:
getElementType in interface AnnotatedObject

getContainingScope

@CheckForNull
public AnnotatedObject getContainingScope()
Specified by:
getContainingScope in interface AnnotatedObject

FindBugs™ 1.3.9

FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.