Class CodeAttribute
- 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.CodeAttribute
-
public class CodeAttribute extends BCIRenumberedAttribute
-
-
Field Summary
Fields Modifier and Type Field Description java.util.List
attributes
java.util.List
byteCodeOffsets
java.util.List
byteCodes
int
codeLength
java.util.List
exceptionTable
int
maxLocals
int
maxStack
-
Fields inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.BCIRenumberedAttribute
renumbered
-
Fields inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.ClassFileEntry
NONE
-
-
Constructor Summary
Constructors Constructor Description CodeAttribute(int maxStack, int maxLocals, byte[] codePacked, Segment segment, OperandManager operandManager, java.util.List exceptionTable)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAttribute(Attribute attribute)
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.static void
setAttributeName(CPUTF8 attributeName)
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
-
-
-
-
Field Detail
-
attributes
public java.util.List attributes
-
byteCodeOffsets
public java.util.List byteCodeOffsets
-
byteCodes
public java.util.List byteCodes
-
codeLength
public int codeLength
-
exceptionTable
public java.util.List exceptionTable
-
maxLocals
public int maxLocals
-
maxStack
public int maxStack
-
-
Constructor Detail
-
CodeAttribute
public CodeAttribute(int maxStack, int maxLocals, byte[] codePacked, Segment segment, OperandManager operandManager, java.util.List exceptionTable)
-
-
Method Detail
-
getLength
protected int getLength()
- Specified by:
getLength
in classBCIRenumberedAttribute
-
getNestedClassFileEntries
protected ClassFileEntry[] getNestedClassFileEntries()
- Overrides:
getNestedClassFileEntries
in classAttribute
-
resolve
protected void resolve(ClassConstantPool pool)
Description copied from class:ClassFileEntry
Allows the constant pool entries to resolve their nested entries.
-
toString
public java.lang.String toString()
- Specified by:
toString
in classBCIRenumberedAttribute
-
writeBody
protected void writeBody(java.io.DataOutputStream dos) throws java.io.IOException
- Specified by:
writeBody
in classBCIRenumberedAttribute
- Throws:
java.io.IOException
-
addAttribute
public void addAttribute(Attribute attribute)
-
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
-
setAttributeName
public static void setAttributeName(CPUTF8 attributeName)
-
-