Top Description Fields Constructors Methods
org.apache.tools.ant.taskdefs.optional.depend.constantpool

public abstract Class ConstantPoolEntry

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.tools.ant.taskdefs.optional.depend.constantpool.FieldRefCPInfo, org.apache.tools.ant.taskdefs.optional.depend.constantpool.InterfaceMethodRefCPInfo, org.apache.tools.ant.taskdefs.optional.depend.constantpool.MethodHandleCPInfo, org.apache.tools.ant.taskdefs.optional.depend.constantpool.MethodRefCPInfo, org.apache.tools.ant.taskdefs.optional.depend.constantpool.NameAndTypeCPInfo, org.apache.tools.ant.taskdefs.optional.depend.constantpool.Utf8CPInfo, org.apache.tools.ant.taskdefs.optional.depend.constantpool.ClassCPInfo, org.apache.tools.ant.taskdefs.optional.depend.constantpool.ConstantCPInfo
Imports
java.io.DataInputStream, .IOException

An entry in the constant pool. This class contains a representation of the constant pool entries. It is an abstract base class for all the different forms of constant pool entry.
See Also
ConstantPool

Field Summary

Modifier and TypeField and Description
public static final int
CONSTANT_CLASS

Tag value for Class entries.

public static final int
CONSTANT_DOUBLE

Tag value for Double entries.

public static final int
CONSTANT_FIELDREF

Tag value for Field Reference entries.

public static final int
CONSTANT_FLOAT

Tag value for Float entries.

public static final int
CONSTANT_INTEGER

Tag value for Integer entries.

public static final int
CONSTANT_INTERFACEMETHODREF

Tag value for Interface Method Reference entries.

public static final int
CONSTANT_INVOKEDYNAMIC

Tag value for InvokeDynamic entries

public static final int
CONSTANT_LONG

Tag value for Long entries.

public static final int
CONSTANT_METHODHANDLE

Tag value for Method Handle entries

public static final int
CONSTANT_METHODREF

Tag value for Method Reference entries.

public static final int
CONSTANT_METHODTYPE

Tag value for Method Type entries

public static final int
CONSTANT_MODULEINFO

Tag value for CONSTANT_Module_info entry

public static final int
CONSTANT_NAMEANDTYPE

Tag value for Name and Type entries.

public static final int
CONSTANT_PACKAGEINFO

Tag value for CONSTANT_Package_info entry (within a module)

public static final int
CONSTANT_STRING

Tag value for String entries.

public static final int
CONSTANT_UTF8

Tag value for UTF8 entries.

private int
numEntries

The number of slots in the constant pool, occupied by this entry.

private boolean
resolved

A flag which indicates if this entry has been resolved or not.

private int
tag

This entry's tag which identifies the type of this constant pool entry.

Constructor Summary

AccessConstructor and Description
public
ConstantPoolEntry(int
the tag value which identifies which type of constant pool entry this is.
tagValue
,
int
the number of constant pool entry slots this entry occupies.
entries
)

Initialise the constant pool entry.

Method Summary

Modifier and TypeMethod and Description
public final int

Returns:

the number of slots used.
getNumEntries
()

Get the number of Constant Pool Entry slots within the constant pool occupied by this entry.

public int

Returns:

The Tag value of this entry
getTag
()

Get the Entry's type tag.

public boolean

Returns:

true if this entry has been resolved.
isResolved
()

Indicates whether this entry has been resolved.

public abstract void
read(DataInputStream
the DataInputStream which contains the constant pool entry to be read.
cpStream
)

read a constant pool entry from a class stream.

public static ConstantPoolEntry

Returns:

the appropriate ConstantPoolEntry subclass representing the constant pool entry from the stream.
readEntry
(DataInputStream
the stream from which the constant pool entry is to be read.
cpStream
)

Read a constant pool entry from a stream.

public void
resolve(ConstantPool
the constant pool of which this entry is a member and against which this entry is to be resolved.
constantPool
)

Resolve this constant pool entry with respect to its dependents in the constant pool.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CONSTANT_CLASSback to summary
public static final int CONSTANT_CLASS

Tag value for Class entries.

CONSTANT_DOUBLEback to summary
public static final int CONSTANT_DOUBLE

Tag value for Double entries.

CONSTANT_FIELDREFback to summary
public static final int CONSTANT_FIELDREF

Tag value for Field Reference entries.

CONSTANT_FLOATback to summary
public static final int CONSTANT_FLOAT

Tag value for Float entries.

CONSTANT_INTEGERback to summary
public static final int CONSTANT_INTEGER

Tag value for Integer entries.

CONSTANT_INTERFACEMETHODREFback to summary
public static final int CONSTANT_INTERFACEMETHODREF

Tag value for Interface Method Reference entries.

CONSTANT_INVOKEDYNAMICback to summary
public static final int CONSTANT_INVOKEDYNAMIC

Tag value for InvokeDynamic entries

CONSTANT_LONGback to summary
public static final int CONSTANT_LONG

Tag value for Long entries.

CONSTANT_METHODHANDLEback to summary
public static final int CONSTANT_METHODHANDLE

Tag value for Method Handle entries

CONSTANT_METHODREFback to summary
public static final int CONSTANT_METHODREF

Tag value for Method Reference entries.

CONSTANT_METHODTYPEback to summary
public static final int CONSTANT_METHODTYPE

Tag value for Method Type entries

CONSTANT_MODULEINFOback to summary
public static final int CONSTANT_MODULEINFO

Tag value for CONSTANT_Module_info entry

CONSTANT_NAMEANDTYPEback to summary
public static final int CONSTANT_NAMEANDTYPE

Tag value for Name and Type entries.

CONSTANT_PACKAGEINFOback to summary
public static final int CONSTANT_PACKAGEINFO

Tag value for CONSTANT_Package_info entry (within a module)

CONSTANT_STRINGback to summary
public static final int CONSTANT_STRING

Tag value for String entries.

CONSTANT_UTF8back to summary
public static final int CONSTANT_UTF8

Tag value for UTF8 entries.

numEntriesback to summary
private int numEntries

The number of slots in the constant pool, occupied by this entry.

resolvedback to summary
private boolean resolved

A flag which indicates if this entry has been resolved or not.

tagback to summary
private int tag

This entry's tag which identifies the type of this constant pool entry.

Constructor Detail

ConstantPoolEntryback to summary
public ConstantPoolEntry(int tagValue, int entries)

Initialise the constant pool entry.

Parameters
tagValue:int

the tag value which identifies which type of constant pool entry this is.

entries:int

the number of constant pool entry slots this entry occupies.

Method Detail

getNumEntriesback to summary
public final int getNumEntries()

Get the number of Constant Pool Entry slots within the constant pool occupied by this entry.

Returns:int

the number of slots used.

getTagback to summary
public int getTag()

Get the Entry's type tag.

Returns:int

The Tag value of this entry

isResolvedback to summary
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.

Returns:boolean

true if this entry has been resolved.

readback to summary
public abstract void read(DataInputStream cpStream) throws IOException

read a constant pool entry from a class stream.

Parameters
cpStream:DataInputStream

the DataInputStream which contains the constant pool entry to be read.

Exceptions
IOException:
if there is a problem reading the entry from the stream.
readEntryback to summary
public static ConstantPoolEntry readEntry(DataInputStream cpStream) throws IOException

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.

Parameters
cpStream:DataInputStream

the stream from which the constant pool entry is to be read.

Returns:ConstantPoolEntry

the appropriate ConstantPoolEntry subclass representing the constant pool entry from the stream.

Exceptions
IOException:
if the constant pool entry cannot be read from the stream
resolveback to summary
public void resolve(ConstantPool constantPool)

Resolve this constant pool entry with respect to its dependents in the constant pool.

Parameters
constantPool:ConstantPool

the constant pool of which this entry is a member and against which this entry is to be resolved.