Class ClassFile.FieldInfo

  • All Implemented Interfaces:
    Annotatable
    Enclosing class:
    ClassFile

    public class ClassFile.FieldInfo
    extends java.lang.Object
    implements Annotatable
    Representation of a "method_info" structure, as defined by JVMS7 4.5.
    • Constructor Detail

      • FieldInfo

        public FieldInfo​(short accessFlags,
                         short nameIndex,
                         short descriptorIndex,
                         java.util.List<ClassFile.AttributeInfo> attributes)
    • Method Detail

      • getAccessFlags

        public short getAccessFlags()
        Returns:
        The modifier flags of the field; or'ed values are the constants declared in Mod
      • getName

        public java.lang.String getName​(ClassFile classFile)
        Returns:
        The field's name
      • getDescriptor

        public java.lang.String getDescriptor​(ClassFile classFile)
        Returns:
        The field descriptor describing this field
      • addAnnotationsAttributeEntry

        public void addAnnotationsAttributeEntry​(boolean runtimeVisible,
                                                 java.lang.String fieldDescriptor,
                                                 java.util.Map<java.lang.Short,​ClassFile.ElementValue> elementValuePairs)
        Description copied from interface: Annotatable
        Adds a "Runtime[In]visibleAnnotations" attribute to this object (if that annotation does not yet exist) and adds an entry to it.
        Specified by:
        addAnnotationsAttributeEntry in interface Annotatable
        elementValuePairs - Maps "elemant_name_index" (ClassFile.ConstantUtf8Info) to "element_value", see JVMS8 4.7.16
      • store

        public void store​(java.io.DataOutputStream dos)
                   throws java.io.IOException
        Writes this object to a DataOutputStream, in the format described inJVMS7 4.5.
        Throws:
        java.io.IOException