org.apache.commons.compress.harmony.unpack200.bytecode

## Class Attribute

- java.lang.Object
- - org.apache.commons.compress.harmony.unpack200.bytecode.ClassFileEntry
  - - org.apache.commons.compress.harmony.unpack200.bytecode.Attribute

- Direct Known Subclasses:
    AnnotationsAttribute, BCIRenumberedAttribute, ConstantValueAttribute, DeprecatedAttribute, EnclosingMethodAttribute, ExceptionsAttribute, InnerClassesAttribute, SignatureAttribute, SourceFileAttribute

      public abstract class Attribute
      extends ClassFileEntry

  Abstract superclass for class file attributes

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected CPUTF8` | `attributeName`

    - ### Fields inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.ClassFileEntry

      `NONE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Attribute(CPUTF8 attributeName)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `doWrite(DataOutputStream dos)`
    `boolean` | `equals(Object obj)`
    `protected CPUTF8` | `getAttributeName()`
    `protected abstract int` | `getLength()`
    `protected int` | `getLengthIncludingHeader()` Answer the length of the receiver including its header (the u2 for the attribute name and the u4 for the attribute length).
    `protected ClassFileEntry[]` | `getNestedClassFileEntries()`
    `boolean` | `hasBCIRenumbering()` Answer true if the receiver needs to have BCI renumbering applied to it; otherwise answer false.
    `int` | `hashCode()`
    `boolean` | `isSourceFileAttribute()` Answer true if the receiver is a source file attribute (which gets special handling when the class is built); otherwise answer false.
    `protected void` | `resolve(ClassConstantPool pool)` Allows the constant pool entries to resolve their nested entries.
    `protected abstract void` | `writeBody(DataOutputStream dos)`

    - ### Methods inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.ClassFileEntry

      `objectHashCode, toString, write`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### attributeName

          protected final CPUTF8 attributeName

  - ### Constructor Detail

    - #### Attribute

          public Attribute(CPUTF8 attributeName)

  - ### Method Detail

    - #### doWrite

          protected void doWrite(DataOutputStream dos)
                          throws IOException

      Specified by:
        `doWrite` in class `ClassFileEntry`
      Throws:
        `IOException`

    - #### equals

          public boolean equals(Object obj)

      Specified by:
        `equals` in class `ClassFileEntry`

    - #### getAttributeName

          protected CPUTF8 getAttributeName()

    - #### getLength

          protected abstract int getLength()

    - #### getLengthIncludingHeader

          protected int getLengthIncludingHeader()

      Answer the length of the receiver including its header (the u2 for the attribute name and the u4 for the attribute length). This is relevant when attributes are nested within other attributes - the outer attribute needs to take the inner attribute headers into account when calculating its length.
      Returns:
        int adjusted length

    - #### getNestedClassFileEntries

          protected ClassFileEntry[] getNestedClassFileEntries()

      Overrides:
        `getNestedClassFileEntries` in class `ClassFileEntry`

    - #### hasBCIRenumbering

          public boolean hasBCIRenumbering()

      Answer true if the receiver needs to have BCI renumbering applied to it; otherwise answer false.
      Returns:
        boolean BCI renumbering required

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in class `ClassFileEntry`

    - #### isSourceFileAttribute

          public boolean isSourceFileAttribute()

      Answer true if the receiver is a source file attribute (which gets special handling when the class is built); otherwise answer false.
      Returns:
        boolean source file attribute

    - #### resolve

          protected void resolve(ClassConstantPool pool)

      Description copied from class: `ClassFileEntry`
      Allows the constant pool entries to resolve their nested entries.
      Overrides:
        `resolve` in class `ClassFileEntry`
      Parameters:
        `pool` - TODO

    - #### writeBody

          protected abstract void writeBody(DataOutputStream dos)
                                     throws IOException

      Throws:
        `IOException`

Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.