Class BCIRenumberedAttribute
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
- Direct Known Subclasses:
CodeAttribute,LineNumberTableAttribute,LocalVariableTableAttribute,LocalVariableTypeTableAttribute,NewAttribute
Abstract superclass for attributes that have some part encoded with Byte Code Injection (BCI) renumbering.
-
Field Summary
FieldsFields inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.Attribute
attributeNameFields inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.ClassFileEntry
NONE -
Constructor Summary
ConstructorsConstructorDescriptionBCIRenumberedAttribute(CPUTF8 attributeName) Constructs a new instance for an attribute name. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract intGets the length.protected abstract int[]Gets the array of indices for the start of line numbers.booleanAnswer true if the receiver needs to have BCI renumbering applied to it; otherwise answer false.voidIn Pack200, line number tables are BCI renumbered.abstract StringtoString()protected abstract voidWrites this body to the given output stream.Methods inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.Attribute
doWrite, equals, getAttributeName, getLengthIncludingHeader, getNestedClassFileEntries, hashCode, isSourceFileAttribute, resolveMethods inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.ClassFileEntry
objectHashCode, write
-
Field Details
-
renumbered
Whether renumbering has occurred.
-
-
Constructor Details
-
BCIRenumberedAttribute
Constructs a new instance for an attribute name.- Parameters:
attributeName- an attribute name.
-
-
Method Details
-
getLength
Description copied from class:AttributeGets the length. -
getStartPCs
Gets the array of indices for the start of line numbers.- Returns:
- the array of indices for the start of line numbers.
-
hasBCIRenumbering
Description copied from class:AttributeAnswer true if the receiver needs to have BCI renumbering applied to it; otherwise answer false.- Overrides:
hasBCIRenumberingin classAttribute- Returns:
- boolean BCI renumbering required
-
renumber
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.- Parameters:
byteCodeOffsets- List of Integer offsets of the byte code array.- Throws:
Pack200Exception- Thrown from a subclass.
-
toString
- Specified by:
toStringin classClassFileEntry
-
writeBody
Description copied from class:AttributeWrites this body to the given output stream.- Specified by:
writeBodyin classAttribute- Parameters:
dos- the output stream.- Throws:
IOException- if an I/O error occurs.
-