Class ReferenceForm
- java.lang.Object
-
- org.apache.commons.compress.harmony.unpack200.bytecode.forms.ByteCodeForm
-
- org.apache.commons.compress.harmony.unpack200.bytecode.forms.ReferenceForm
-
- Direct Known Subclasses:
ClassRefForm,ClassSpecificReferenceForm,DoubleForm,FieldRefForm,IMethodRefForm,LongForm,MethodRefForm,SingleByteReferenceForm
public abstract class ReferenceForm extends ByteCodeForm
Abstract class of all ByteCodeForms which add a nested entry from the globalConstantPool.
-
-
Field Summary
-
Fields inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.forms.ByteCodeForm
byteCodeArray, byteCodesByName, WIDENED
-
-
Constructor Summary
Constructors Constructor Description ReferenceForm(int opcode, java.lang.String name, int[] rewrite)Constructs a new instance with the specified opcode, name, operandType and rewrite.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract intgetOffset(OperandManager operandManager)protected abstract intgetPoolID()voidsetByteCodeOperands(ByteCode byteCode, OperandManager operandManager, int codeLength)Sets the rewrite of the byteCode.protected voidsetNestedEntries(ByteCode byteCode, OperandManager operandManager, int offset)Sets the nested entries.-
Methods inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.forms.ByteCodeForm
calculateOperandPosition, firstOperandIndex, fixUpByteCodeTargets, get, getName, getOpcode, getRewrite, getRewriteCopy, hasMultipleByteCodes, hasNoOperand, nestedMustStartClassPool, operandLength, toString
-
-
-
-
Constructor Detail
-
ReferenceForm
public ReferenceForm(int opcode, java.lang.String name, int[] rewrite)
Constructs a new instance with the specified opcode, name, operandType and rewrite.- Parameters:
opcode- index corresponding to the opcode's value.name- String printable name of the opcode.rewrite- Operand positions (which will later be rewritten in ByteCodes) are indicated by -1.
-
-
Method Detail
-
getOffset
protected abstract int getOffset(OperandManager operandManager)
-
getPoolID
protected abstract int getPoolID()
-
setByteCodeOperands
public void setByteCodeOperands(ByteCode byteCode, OperandManager operandManager, int codeLength) throws Pack200Exception
Description copied from class:ByteCodeFormSets the rewrite of the byteCode.- Specified by:
setByteCodeOperandsin classByteCodeForm- Parameters:
byteCode- ByteCode to be updated (!)operandManager- OperandTable from which to draw infocodeLength- Length of bytes (excluding this bytecode) from the beginning of the method. Used in calculating padding for some variable-length bytecodes (such as lookupswitch, tableswitch).- Throws:
Pack200Exception- if a type is not supported or an index not in the range [0,Integer.MAX_VALUE].
-
setNestedEntries
protected void setNestedEntries(ByteCode byteCode, OperandManager operandManager, int offset) throws Pack200Exception
Sets the nested entries.- Parameters:
byteCode- byte codes.operandManager- Operand manager.offset- offset.- Throws:
Pack200Exception- if support for a type is not supported or the offset not in the range [0,Integer.MAX_VALUE].
-
-