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<Attribute>attributesjava.util.List<java.lang.Integer>byteCodeOffsetsjava.util.List<ByteCode>byteCodesintcodeLengthjava.util.List<ExceptionTableEntry>exceptionTableintmaxLocalsintmaxStack-
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<ExceptionTableEntry> exceptionTable)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttribute(Attribute attribute)protected intgetLength()Gets the length.protected ClassFileEntry[]getNestedClassFileEntries()Returns an empty array.protected int[]getStartPCs()Gets the array of indices for the start of line numbers.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.static voidsetAttributeName(CPUTF8 attributeName)java.lang.StringtoString()protected voidwriteBody(java.io.DataOutputStream dos)Writes this body to the given output stream.-
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<Attribute> attributes
-
byteCodeOffsets
public java.util.List<java.lang.Integer> byteCodeOffsets
-
codeLength
public int codeLength
-
exceptionTable
public java.util.List<ExceptionTableEntry> 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<ExceptionTableEntry> exceptionTable) throws Pack200Exception
- Throws:
Pack200Exception
-
-
Method Detail
-
setAttributeName
public static void setAttributeName(CPUTF8 attributeName)
-
addAttribute
public void addAttribute(Attribute attribute)
-
getLength
protected int getLength()
Description copied from class:AttributeGets the length.- Specified by:
getLengthin classBCIRenumberedAttribute- Returns:
- the length.
-
getNestedClassFileEntries
protected ClassFileEntry[] getNestedClassFileEntries()
Description copied from class:ClassFileEntryReturns an empty array.- Overrides:
getNestedClassFileEntriesin classAttribute- Returns:
- an empty array.
-
getStartPCs
protected int[] getStartPCs()
Description copied from class:BCIRenumberedAttributeGets the array of indices for the start of line numbers.- Specified by:
getStartPCsin classBCIRenumberedAttribute- Returns:
- the array of indices for the start of line numbers.
-
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
Description copied from class:AttributeWrites this body to the given output stream.- Specified by:
writeBodyin classBCIRenumberedAttribute- Parameters:
dos- the output stream.- Throws:
java.io.IOException- if an I/O error occurs.
-
-