Class ConstantPoolEntry
- java.lang.Object
-
- org.apache.tools.ant.taskdefs.optional.depend.constantpool.ConstantPoolEntry
-
- Direct Known Subclasses:
ClassCPInfo,ConstantCPInfo,FieldRefCPInfo,InterfaceMethodRefCPInfo,MethodHandleCPInfo,MethodRefCPInfo,NameAndTypeCPInfo,Utf8CPInfo
public abstract class ConstantPoolEntry extends java.lang.ObjectAn 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
Fields Modifier and Type Field Description static intCONSTANT_CLASSTag value for Class entries.static intCONSTANT_DOUBLETag value for Double entries.static intCONSTANT_FIELDREFTag value for Field Reference entries.static intCONSTANT_FLOATTag value for Float entries.static intCONSTANT_INTEGERTag value for Integer entries.static intCONSTANT_INTERFACEMETHODREFTag value for Interface Method Reference entries.static intCONSTANT_INVOKEDYNAMICTag value for InvokeDynamic entriesstatic intCONSTANT_LONGTag value for Long entries.static intCONSTANT_METHODHANDLETag value for Method Handle entriesstatic intCONSTANT_METHODREFTag value for Method Reference entries.static intCONSTANT_METHODTYPETag value for Method Type entriesstatic intCONSTANT_MODULEINFOTag value for CONSTANT_Module_info entrystatic intCONSTANT_NAMEANDTYPETag value for Name and Type entries.static intCONSTANT_PACKAGEINFOTag value for CONSTANT_Package_info entry (within a module)static intCONSTANT_STRINGTag value for String entries.static intCONSTANT_UTF8Tag value for UTF8 entries.
-
Constructor Summary
Constructors Constructor Description ConstantPoolEntry(int tagValue, int entries)Initialise the constant pool entry.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intgetNumEntries()Get the number of Constant Pool Entry slots within the constant pool occupied by this entry.intgetTag()Get the Entry's type tag.booleanisResolved()Indicates whether this entry has been resolved.abstract voidread(java.io.DataInputStream cpStream)read a constant pool entry from a class stream.static ConstantPoolEntryreadEntry(java.io.DataInputStream cpStream)Read a constant pool entry from a stream.voidresolve(ConstantPool constantPool)Resolve this constant pool entry with respect to its dependents in the constant pool.
-
-
-
Field Detail
-
CONSTANT_UTF8
public static final int CONSTANT_UTF8
Tag value for UTF8 entries.- See Also:
- Constant Field Values
-
CONSTANT_INTEGER
public static final int CONSTANT_INTEGER
Tag value for Integer entries.- See Also:
- Constant Field Values
-
CONSTANT_FLOAT
public static final int CONSTANT_FLOAT
Tag value for Float entries.- See Also:
- Constant Field Values
-
CONSTANT_LONG
public static final int CONSTANT_LONG
Tag value for Long entries.- See Also:
- Constant Field Values
-
CONSTANT_DOUBLE
public static final int CONSTANT_DOUBLE
Tag value for Double entries.- See Also:
- Constant Field Values
-
CONSTANT_CLASS
public static final int CONSTANT_CLASS
Tag value for Class entries.- See Also:
- Constant Field Values
-
CONSTANT_STRING
public static final int CONSTANT_STRING
Tag value for String entries.- See Also:
- Constant Field Values
-
CONSTANT_FIELDREF
public static final int CONSTANT_FIELDREF
Tag value for Field Reference entries.- See Also:
- Constant Field Values
-
CONSTANT_METHODREF
public static final int CONSTANT_METHODREF
Tag value for Method Reference entries.- See Also:
- Constant Field Values
-
CONSTANT_INTERFACEMETHODREF
public static final int CONSTANT_INTERFACEMETHODREF
Tag value for Interface Method Reference entries.- See Also:
- Constant Field Values
-
CONSTANT_NAMEANDTYPE
public static final int CONSTANT_NAMEANDTYPE
Tag value for Name and Type entries.- See Also:
- Constant Field Values
-
CONSTANT_METHODHANDLE
public static final int CONSTANT_METHODHANDLE
Tag value for Method Handle entries- See Also:
- Constant Field Values
-
CONSTANT_METHODTYPE
public static final int CONSTANT_METHODTYPE
Tag value for Method Type entries- See Also:
- Constant Field Values
-
CONSTANT_INVOKEDYNAMIC
public static final int CONSTANT_INVOKEDYNAMIC
Tag value for InvokeDynamic entries- See Also:
- Constant Field Values
-
CONSTANT_MODULEINFO
public static final int CONSTANT_MODULEINFO
Tag value for CONSTANT_Module_info entry- See Also:
- Constant Field Values
-
CONSTANT_PACKAGEINFO
public static final int CONSTANT_PACKAGEINFO
Tag value for CONSTANT_Package_info entry (within a module)- See Also:
- Constant Field Values
-
-
Method Detail
-
readEntry
public static ConstantPoolEntry readEntry(java.io.DataInputStream cpStream) throws java.io.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- the stream from which the constant pool entry is to be read.- Returns:
- the appropriate ConstantPoolEntry subclass representing the constant pool entry from the stream.
- Throws:
java.io.IOException- if the constant pool entry cannot be read from the stream
-
isResolved
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:
- true if this entry has been resolved.
-
resolve
public void resolve(ConstantPool constantPool)
Resolve this constant pool entry with respect to its dependents in the constant pool.- Parameters:
constantPool- the constant pool of which this entry is a member and against which this entry is to be resolved.
-
read
public abstract void read(java.io.DataInputStream cpStream) throws java.io.IOExceptionread a constant pool entry from a class stream.- Parameters:
cpStream- the DataInputStream which contains the constant pool entry to be read.- Throws:
java.io.IOException- if there is a problem reading the entry from the stream.
-
getTag
public int getTag()
Get the Entry's type tag.- Returns:
- The Tag value of this entry
-
getNumEntries
public final int getNumEntries()
Get the number of Constant Pool Entry slots within the constant pool occupied by this entry.- Returns:
- the number of slots used.
-
-