Class NewAttribute
- java.lang.Object
-
- kala.compress.harmony.unpack200.bytecode.ClassFileEntry
-
- kala.compress.harmony.unpack200.bytecode.Attribute
-
- kala.compress.harmony.unpack200.bytecode.BCIRenumberedAttribute
-
- kala.compress.harmony.unpack200.bytecode.NewAttribute
-
public class NewAttribute extends BCIRenumberedAttribute
A compressor-defined class file attribute.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classNewAttribute.AbstractBcValueprivate static classNewAttribute.BCIndexprivate static classNewAttribute.BCLengthprivate static classNewAttribute.BCOffset
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.Object>bodyprivate intlayoutIndexprivate java.util.List<java.lang.Integer>lengthsprivate ClassConstantPoolpool-
Fields inherited from class kala.compress.harmony.unpack200.bytecode.BCIRenumberedAttribute
renumbered
-
Fields inherited from class kala.compress.harmony.unpack200.bytecode.Attribute
attributeName
-
Fields inherited from class kala.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 voidaddBCIndex(int length, int value)voidaddBCLength(int length, int value)voidaddBCOffset(int length, int value)voidaddInteger(int length, long value)voidaddToBody(int length, java.lang.Object value)intgetLayoutIndex()protected intgetLength()protected ClassFileEntry[]getNestedClassFileEntries()protected int[]getStartPCs()voidrenumber(java.util.List<java.lang.Integer> byteCodeOffsets)In Pack200, line number tables are BCI renumbered.protected voidresolve(ClassConstantPool pool)Allows the constant pool entries to resolve their nested entries.java.lang.StringtoString()protected voidwriteBody(java.io.DataOutputStream dos)-
Methods inherited from class kala.compress.harmony.unpack200.bytecode.BCIRenumberedAttribute
hasBCIRenumbering
-
Methods inherited from class kala.compress.harmony.unpack200.bytecode.Attribute
doWrite, equals, getAttributeName, getLengthIncludingHeader, hashCode, isSourceFileAttribute
-
Methods inherited from class kala.compress.harmony.unpack200.bytecode.ClassFileEntry
objectHashCode, write
-
-
-
-
Field Detail
-
lengths
private final java.util.List<java.lang.Integer> lengths
-
body
private final java.util.List<java.lang.Object> body
-
pool
private ClassConstantPool pool
-
layoutIndex
private final int layoutIndex
-
-
Constructor Detail
-
NewAttribute
public NewAttribute(CPUTF8 attributeName, int layoutIndex)
-
-
Method Detail
-
addBCIndex
public void addBCIndex(int length, int value)
-
addBCLength
public void addBCLength(int length, int value)
-
addBCOffset
public void addBCOffset(int length, int value)
-
addInteger
public void addInteger(int length, long value)
-
addToBody
public void addToBody(int length, java.lang.Object value)
-
getLayoutIndex
public int getLayoutIndex()
-
getLength
protected int getLength()
- Specified by:
getLengthin classBCIRenumberedAttribute
-
getNestedClassFileEntries
protected ClassFileEntry[] getNestedClassFileEntries()
- Overrides:
getNestedClassFileEntriesin classAttribute
-
getStartPCs
protected int[] getStartPCs()
- Specified by:
getStartPCsin classBCIRenumberedAttribute
-
renumber
public void renumber(java.util.List<java.lang.Integer> byteCodeOffsets)
Description copied from class:BCIRenumberedAttributeIn 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:
renumberin classBCIRenumberedAttribute- Parameters:
byteCodeOffsets- List of Integer offsets of the byte code array
-
resolve
protected void resolve(ClassConstantPool pool)
Description copied from class:ClassFileEntryAllows the constant pool entries to resolve their nested entries.
-
toString
public java.lang.String toString()
- Specified by:
toStringin classBCIRenumberedAttribute
-
writeBody
protected void writeBody(java.io.DataOutputStream dos) throws java.io.IOException- Specified by:
writeBodyin classBCIRenumberedAttribute- Throws:
java.io.IOException
-
-