Fields Summary |
---|
public static final int | CONSTANT_UTF8Tag value for UTF8 entries. |
public static final int | CONSTANT_INTEGERTag value for Integer entries. |
public static final int | CONSTANT_FLOATTag value for Float entries. |
public static final int | CONSTANT_LONGTag value for Long entries. |
public static final int | CONSTANT_DOUBLETag value for Double entries. |
public static final int | CONSTANT_CLASSTag value for Class entries. |
public static final int | CONSTANT_STRINGTag value for String entries. |
public static final int | CONSTANT_FIELDREFTag value for Field Reference entries. |
public static final int | CONSTANT_METHODREFTag value for Method Reference entries. |
public static final int | CONSTANT_INTERFACEMETHODREFTag value for Interface Method Reference entries. |
public static final int | CONSTANT_NAMEANDTYPETag value for Name and Type entries. |
private int | tagThis entry's tag which identifies the type of this constant pool
entry. |
private int | numEntriesThe number of slots in the constant pool, occupied by this entry. |
private boolean | resolvedA flag which indicates if this entry has been resolved or not. |
Methods Summary |
---|
public final int | getNumEntries()Get the number of Constant Pool Entry slots within the constant pool
occupied by this entry.
return numEntries;
|
public int | getTag()Get the Entry's type tag.
return tag;
|
public boolean | isResolved()Indicates whether this entry has been resolved. In general a constant
pool entry can reference another constant pool entry by its index
value. Resolution involves replacing this index value with the
constant pool entry at that index.
return resolved;
|
public abstract void | read(java.io.DataInputStream cpStream)read a constant pool entry from a class stream.
|
public static org.apache.tools.ant.taskdefs.optional.depend.constantpool.ConstantPoolEntry | readEntry(java.io.DataInputStream cpStream)Read a constant pool entry from a stream. This is a factory method
which reads a constant pool entry form a stream and returns the
appropriate subclass for the entry.
ConstantPoolEntry cpInfo = null;
int cpTag = cpStream.readUnsignedByte();
switch (cpTag) {
case CONSTANT_UTF8:
cpInfo = new Utf8CPInfo();
break;
case CONSTANT_INTEGER:
cpInfo = new IntegerCPInfo();
break;
case CONSTANT_FLOAT:
cpInfo = new FloatCPInfo();
break;
case CONSTANT_LONG:
cpInfo = new LongCPInfo();
break;
case CONSTANT_DOUBLE:
cpInfo = new DoubleCPInfo();
break;
case CONSTANT_CLASS:
cpInfo = new ClassCPInfo();
break;
case CONSTANT_STRING:
cpInfo = new StringCPInfo();
break;
case CONSTANT_FIELDREF:
cpInfo = new FieldRefCPInfo();
break;
case CONSTANT_METHODREF:
cpInfo = new MethodRefCPInfo();
break;
case CONSTANT_INTERFACEMETHODREF:
cpInfo = new InterfaceMethodRefCPInfo();
break;
case CONSTANT_NAMEANDTYPE:
cpInfo = new NameAndTypeCPInfo();
break;
default:
throw new ClassFormatError("Invalid Constant Pool entry Type "
+ cpTag);
}
cpInfo.read(cpStream);
return cpInfo;
|
public void | resolve(ConstantPool constantPool)Resolve this constant pool entry with respect to its dependents in
the constant pool.
resolved = true;
|