Package jminusminus

Class CLAttributeInfo

java.lang.Object
jminusminus.CLAttributeInfo
Direct Known Subclasses:
CLAnnotationDefaultAttribute, CLCodeAttribute, CLConstantValueAttribute, CLDeprecatedAttribute, CLEnclosingMethodAttribute, CLExceptionsAttribute, CLInnerClassesAttribute, CLLineNumberTableAttribute, CLLocalVariableTableAttribute, CLLocalVariableTypeTableAttribute, CLRuntimeInvisibleAnnotationsAttribute, CLRuntimeInvisibleParameterAnnotationsAttribute, CLRuntimeVisibleAnnotationsAttribute, CLRuntimeVisibleParameterAnnotationsAttribute, CLSignatureAttribute, CLSourceDebugExtensionAttribute, CLSourceFileAttribute, CLSyntheticAttribute

abstract class CLAttributeInfo extends Object
The abstract base class for the representation of attribute_info} structure. Classes representing individual attributes inherit this class. This file has representations for all attributes specified in JVM Spec Second Edition, including the ones that were added for JDK 1.5.

Attributes are used in the CLFile, CLFieldInfo, CLMethodInfo, and CLCodeAttribute structures of the class file. While there are many kinds of attributes, only some are mandatory; these include:

  • InnerClasses_attribute (class attribute)
  • Synthetic_attribute (class, field, and method attribute)
  • Code_attribute (method attribute)
  • Exceptions_attribute (method attribute)

CLEmitter implicitly adds the required attributes to the appropriate structure. The optional attributes have to be added explicitly using the CLEmitter methods addClassAttribute(), addFieldAttribute(), addMethodAttribute(), and addCodeAttribute().

  • Field Details

    • attributeNameIndex

      public int attributeNameIndex
      attribute_info.attribute_name_index item.
    • attributeLength

      public long attributeLength
      attribute_info.attribute_length item.
  • Constructor Details

    • CLAttributeInfo

      protected CLAttributeInfo(int attributeNameIndex, long attributeLength)
      Construct a CLAttributeInfo object.
      Parameters:
      attributeNameIndex - attribute_info.attribute_name_index item.
      attributeLength - attribute_info.attribute_length item.
  • Method Details

    • write

      public void write(CLOutputStream out) throws IOException
      Write the contents of this attribute to the specified output stream.
      Parameters:
      out - output stream.
      Throws:
      IOException - if an error occurs while writing.