Constant
, com.sun.org.apache.bcel.internal.generic.ConstantPoolGen
Modifier and Type | Field and Description |
---|---|
private Constant[] |
Access | Constructor and Description |
---|---|
public | |
public |
Modifier and Type | Method and Description |
---|---|
public void | accept(final Visitor
Visitor object v)Implements com. |
public String | Returns: String representationConstant to be printed c)Resolves constant to a string representation. |
public String | Returns: String representationof constant in constant pool index, final byte expected type tag)Retrieves constant at 'index' from constant pool and resolve it to a string representation. |
public ConstantPool | |
public void | dump(final DataOutputStream
Output file stream file)Dump constant pool to file stream in binary format. |
private static String | |
public <T extends Constant> T | Returns: Constant valueIndex in constant pool index)Gets constant from constant pool. |
public <T extends Constant> T | Returns: Constant valueIndex in constant pool index, final byte Tag of expected constant, i.e., its type tag)Gets constant from constant pool and check whether it has the expected type. |
public <T extends Constant> T | Returns: Constant valueIndex in constant pool index, final byte Tag of expected constant, i.e., its type tag, final Class<T> castTo)Gets constant from constant pool and check whether it has the expected type. |
public < A T extends Constant> TConstant subclass | Returns: Constant valueIndex in constant pool index, final Class<T> The castTo)Constant subclass to cast to.Gets constant from constant pool. |
public ConstantInteger | Returns: ConstantInteger valueIndex in constant pool index)Gets constant from constant pool and check whether it has the expected type. |
public Constant[] | |
public String | Returns: Contents of string referenceIndex in constant pool index, final byte Tag of expected constant, either ConstantClass or ConstantString tag)Gets string from constant pool and bypass the indirection of 'ConstantClass' and 'ConstantString' objects. |
public ConstantUtf8 | Returns: ConstantUtf8 valueIndex in constant pool index)Gets constant from constant pool and check whether it has the expected type. |
public int | |
public Iterator | |
public void | |
public void | |
public String | Returns: String representation.Overrides java. |
constantPool | back to summary |
---|---|
private Constant[] constantPool |
ConstantPool | back to summary |
---|---|
public ConstantPool(final Constant[] constantPool)
|
ConstantPool | back to summary |
---|---|
public ConstantPool(final DataInput input) throws IOException Reads constants from given input stream.
|
accept | back to summary |
---|---|
public void accept(final Visitor v) Implements com. Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects. |
constantToString | back to summary |
---|---|
public String constantToString(Constant c) throws IllegalArgumentException Resolves constant to a string representation.
|
constantToString | back to summary |
---|---|
public String constantToString(final int index, final byte tag) Retrieves constant at 'index' from constant pool and resolve it to a string representation.
|
copy | back to summary |
---|---|
public ConstantPool copy()
|
dump | back to summary |
---|---|
public void dump(final DataOutputStream file) throws IOException Dump constant pool to file stream in binary format.
|
escape | back to summary |
---|---|
private static String escape(final String str) |
getConstant | back to summary |
---|---|
public <T extends Constant> T getConstant(final int index) throws ClassFormatException Gets constant from constant pool.
|
getConstant | back to summary |
---|---|
public <T extends Constant> T getConstant(final int index, final byte tag) throws ClassFormatException Gets constant from constant pool and check whether it has the expected type.
|
getConstant | back to summary |
---|---|
public <T extends Constant> T getConstant(final int index, final byte tag, final Class<T> castTo) throws ClassFormatException Gets constant from constant pool and check whether it has the expected type.
|
getConstant | back to summary |
---|---|
public <T extends Constant> T getConstant(final int index, final Class<T> castTo) throws ClassFormatException Gets constant from constant pool.
|
getConstantInteger | back to summary |
---|---|
public ConstantInteger getConstantInteger(final int index) Gets constant from constant pool and check whether it has the expected type.
|
getConstantPool | back to summary |
---|---|
public Constant[] getConstantPool() |
getConstantString | back to summary |
---|---|
public String getConstantString(final int index, final byte tag) throws IllegalArgumentException Gets string from constant pool and bypass the indirection of 'ConstantClass' and 'ConstantString' objects. I.e. these classes have an index field that points to another entry of the constant pool of type 'ConstantUtf8' which contains the real data.
|
getConstantUtf8 | back to summary |
---|---|
public ConstantUtf8 getConstantUtf8(final int index) throws ClassFormatException Gets constant from constant pool and check whether it has the expected type.
|
getLength | back to summary |
---|---|
public int getLength()
|
iterator | back to summary |
---|---|
public Iterator Implements java. Doc from java. Returns an iterator over elements of type |
setConstant | back to summary |
---|---|
public void setConstant(final int index, final Constant constant)
|
setConstantPool | back to summary |
---|---|
public void setConstantPool(final Constant[] constantPool) |
toString | back to summary |
---|---|
public String toString() Overrides java. Doc from java. Returns a string representation of the object. |