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

public class FieldInfo extends ClassFileStruct implements IBinaryField, Comparable
  • Field Details

    • accessFlags

      protected int accessFlags
    • attributeBytes

      protected int attributeBytes
    • constant

      protected Constant constant
    • descriptor

      protected char[] descriptor
    • name

      protected char[] name
    • signature

      protected char[] signature
    • signatureUtf8Offset

      protected int signatureUtf8Offset
    • tagBits

      protected long tagBits
    • wrappedConstantValue

      protected Object wrappedConstantValue
    • version

      protected long version
  • Constructor Details

    • FieldInfo

      protected FieldInfo(byte[] classFileBytes, int[] offsets, int offset, long version)
      Parameters:
      classFileBytes - byte[]
      offsets - int[]
      offset - int
      version - class file version
  • Method Details

    • createField

      public static FieldInfo createField(byte[] classFileBytes, int[] offsets, int offset, long version)
    • compareTo

      public int compareTo(Object o)
      Specified by:
      compareTo in interface Comparable
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getConstant

      public Constant getConstant()
      Return the constant of the field. Return org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant.NotAConstant if there is none.
      Specified by:
      getConstant in interface IBinaryField
      Returns:
      org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant
    • getGenericSignature

      public char[] getGenericSignature()
      Description copied from interface: IBinaryField
      Answer the receiver's FieldSignature, which describes the field's type as specified in "4.7.9.1 Signatures" of the Java SE 8 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.
    • getTypeAnnotations

      public IBinaryTypeAnnotation[] getTypeAnnotations()
      Description copied from interface: IBinaryField
      Answer the runtime visible and invisible type annotations for this field or null if none.
      Specified by:
      getTypeAnnotations in interface IBinaryField
    • getWrappedConstantValue

      public 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
    • initialize

      protected void initialize()
      This method is used to fully initialize the contents of the receiver. All methodinfos, fields infos will be therefore fully initialized and we can get rid of the bytes.
    • 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 String toString()
      Overrides:
      toString in class Object
    • toStringContent

      protected void toStringContent(StringBuffer buffer)