org.eclipse.jdt.internal.compiler.classfmt
Class FieldInfo

java.lang.Object
  extended by org.eclipse.jdt.internal.compiler.classfmt.ClassFileStruct
      extended by org.eclipse.jdt.internal.compiler.classfmt.FieldInfo
All Implemented Interfaces:
java.lang.Comparable, IBinaryField, IGenericField
Direct Known Subclasses:
FieldInfoWithAnnotation

public class FieldInfo
extends ClassFileStruct
implements IBinaryField, java.lang.Comparable


Method Summary
 int compareTo(java.lang.Object o)
           
static FieldInfo createField(byte[] classFileBytes, int[] offsets, int offset)
           
 boolean equals(java.lang.Object o)
           
 IBinaryAnnotation[] getAnnotations()
          Answer the runtime visible and invisible annotations for this field or null if none.
 Constant getConstant()
          Return the constant of the field.
 char[] getGenericSignature()
          Answer the receiver's signature which describes the parameter & return types as specified in section 4.4.4 of the Java 2 VM spec.
 int getModifiers()
          Answer an int whose bits are set according the access constants defined by the VM spec.
 char[] getName()
          Answer the name of the field.
 long getTagBits()
          Answer the tagbits set according to the bits for annotations.
 char[] getTypeName()
          Answer the resolved name of the receiver's type in the class file format as specified in section 4.3.2 of the Java 2 VM spec.
 java.lang.Object getWrappedConstantValue()
          Return a wrapper that contains the constant of the field.
 boolean hasConstant()
          Return true if the field has a constant value attribute, false otherwise.
 int hashCode()
           
 boolean isSynthetic()
          Return true if the field is a synthetic field, false otherwise.
 int sizeInBytes()
          Answer the size of the receiver in bytes.
 void throwFormatException()
           
 java.lang.String toString()
           
 
Methods inherited from class org.eclipse.jdt.internal.compiler.classfmt.ClassFileStruct
doubleAt, floatAt, i4At, i8At, u1At, u2At, u4At, utf8At
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

createField

public static FieldInfo createField(byte[] classFileBytes,
                                    int[] offsets,
                                    int offset)

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getConstant

public Constant getConstant()
Return the constant of the field. Return org.eclipse.jdt.internal.compiler.impl.Constant.NotAConstant if there is none.

Specified by:
getConstant in interface IBinaryField
Returns:
org.eclipse.jdt.internal.compiler.impl.Constant

getGenericSignature

public char[] getGenericSignature()
Description copied from interface: IBinaryField
Answer the receiver's signature which describes the parameter & return types as specified in section 4.4.4 of the Java 2 VM spec.

Specified by:
getGenericSignature in interface IBinaryField

getModifiers

public int getModifiers()
Answer an int whose bits are set according the access constants defined by the VM spec. Set the AccDeprecated and AccSynthetic bits if necessary

Specified by:
getModifiers in interface IGenericField
Returns:
int

getName

public char[] getName()
Answer the name of the field.

Specified by:
getName in interface IBinaryField
Returns:
char[]

getTagBits

public long getTagBits()
Description copied from interface: IBinaryField
Answer the tagbits set according to the bits for annotations.

Specified by:
getTagBits in interface IBinaryField

getTypeName

public char[] getTypeName()
Answer the resolved name of the receiver's type in the class file format as specified in section 4.3.2 of the Java 2 VM spec. For example: - java.lang.String is Ljava/lang/String; - an int is I - a 2 dimensional array of strings is [[Ljava/lang/String; - an array of floats is [F

Specified by:
getTypeName in interface IBinaryField
Returns:
char[]

getAnnotations

public IBinaryAnnotation[] getAnnotations()
Description copied from interface: IBinaryField
Answer the runtime visible and invisible annotations for this field or null if none.

Specified by:
getAnnotations in interface IBinaryField
Returns:
the annotations or null if there is none.

getWrappedConstantValue

public java.lang.Object getWrappedConstantValue()
Return a wrapper that contains the constant of the field.

Returns:
java.lang.Object

hasConstant

public boolean hasConstant()
Return true if the field has a constant value attribute, false otherwise.

Returns:
boolean

isSynthetic

public boolean isSynthetic()
Return true if the field is a synthetic field, false otherwise.

Returns:
boolean

sizeInBytes

public int sizeInBytes()
Answer the size of the receiver in bytes.

Returns:
int

throwFormatException

public void throwFormatException()
                          throws ClassFormatException
Throws:
ClassFormatException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object