Class NewAttribute
- java.lang.Object
-
- org.apache.commons.compress.harmony.unpack200.bytecode.ClassFileEntry
-
- org.apache.commons.compress.harmony.unpack200.bytecode.Attribute
-
- org.apache.commons.compress.harmony.unpack200.bytecode.BCIRenumberedAttribute
-
- org.apache.commons.compress.harmony.unpack200.bytecode.NewAttribute
-
public class NewAttribute extends BCIRenumberedAttribute
A compressor-defined class file attribute.
-
-
Field Summary
-
Fields inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.BCIRenumberedAttribute
renumbered
-
Fields inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.Attribute
attributeName
-
Fields inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.ClassFileEntry
NONE
-
-
Constructor Summary
Constructors Constructor Description NewAttribute(CPUTF8 attributeName, int layoutIndex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBCIndex(int length, int value)
void
addBCLength(int length, int value)
void
addBCOffset(int length, int value)
void
addInteger(int length, long value)
void
addToBody(int length, java.lang.Object value)
int
getLayoutIndex()
protected int
getLength()
protected ClassFileEntry[]
getNestedClassFileEntries()
protected int[]
getStartPCs()
void
renumber(java.util.List byteCodeOffsets)
In Pack200, line number tables are BCI renumbered.protected void
resolve(ClassConstantPool pool)
Allows the constant pool entries to resolve their nested entries.java.lang.String
toString()
protected void
writeBody(java.io.DataOutputStream dos)
-
Methods inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.BCIRenumberedAttribute
hasBCIRenumbering
-
Methods inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.Attribute
doWrite, equals, getAttributeName, getLengthIncludingHeader, hashCode, isSourceFileAttribute
-
Methods inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.ClassFileEntry
objectHashCode, write
-
-
-
-
Constructor Detail
-
NewAttribute
public NewAttribute(CPUTF8 attributeName, int layoutIndex)
-
-
Method Detail
-
getLayoutIndex
public int getLayoutIndex()
-
getLength
protected int getLength()
- Specified by:
getLength
in classBCIRenumberedAttribute
-
writeBody
protected void writeBody(java.io.DataOutputStream dos) throws java.io.IOException
- Specified by:
writeBody
in classBCIRenumberedAttribute
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Specified by:
toString
in classBCIRenumberedAttribute
-
addInteger
public void addInteger(int length, long value)
-
addBCOffset
public void addBCOffset(int length, int value)
-
addBCIndex
public void addBCIndex(int length, int value)
-
addBCLength
public void addBCLength(int length, int value)
-
addToBody
public void addToBody(int length, java.lang.Object value)
-
resolve
protected void resolve(ClassConstantPool pool)
Description copied from class:ClassFileEntry
Allows the constant pool entries to resolve their nested entries.
-
getNestedClassFileEntries
protected ClassFileEntry[] getNestedClassFileEntries()
- Overrides:
getNestedClassFileEntries
in classAttribute
-
getStartPCs
protected int[] getStartPCs()
- Specified by:
getStartPCs
in classBCIRenumberedAttribute
-
renumber
public void renumber(java.util.List byteCodeOffsets)
Description copied from class:BCIRenumberedAttribute
In Pack200, line number tables are BCI renumbered. This method takes the byteCodeOffsets (which is a List of Integers specifying the offset in the byte code array of each instruction) and updates the start_pcs so that it points to the instruction index itself, not the BCI renumbering of the instruction.- Overrides:
renumber
in classBCIRenumberedAttribute
- Parameters:
byteCodeOffsets
- List of Integer offsets of the bytecode array
-
-