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
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:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intTag value for Class entries.static final intTag value for Double entries.static final intTag value for Dynamic entriesstatic final intTag value for Field Reference entries.static final intTag value for Float entries.static final intTag value for Integer entries.static final intTag value for Interface Method Reference entries.static final intTag value for InvokeDynamic entriesstatic final intTag value for Long entries.static final intTag value for Method Handle entriesstatic final intTag value for Method Reference entries.static final intTag value for Method Type entriesstatic final intTag value for CONSTANT_Module_info entrystatic final intTag value for Name and Type entries.static final intTag value for CONSTANT_Package_info entry (within a module)static final intTag value for String entries.static final intTag value for UTF8 entries.
- 
Constructor SummaryConstructorsConstructorDescriptionConstantPoolEntry(int tagValue, int entries) Initialise the constant pool entry.
- 
Method SummaryModifier and TypeMethodDescriptionfinal intGet the number of Constant Pool Entry slots within the constant pool occupied by this entry.intgetTag()Get the Entry's type tag.booleanIndicates whether this entry has been resolved.abstract voidread(DataInputStream cpStream) read a constant pool entry from a class stream.static ConstantPoolEntryreadEntry(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 Details- 
CONSTANT_UTF8public static final int CONSTANT_UTF8Tag value for UTF8 entries.- See Also:
 
- 
CONSTANT_INTEGERpublic static final int CONSTANT_INTEGERTag value for Integer entries.- See Also:
 
- 
CONSTANT_FLOATpublic static final int CONSTANT_FLOATTag value for Float entries.- See Also:
 
- 
CONSTANT_LONGpublic static final int CONSTANT_LONGTag value for Long entries.- See Also:
 
- 
CONSTANT_DOUBLEpublic static final int CONSTANT_DOUBLETag value for Double entries.- See Also:
 
- 
CONSTANT_CLASSpublic static final int CONSTANT_CLASSTag value for Class entries.- See Also:
 
- 
CONSTANT_STRINGpublic static final int CONSTANT_STRINGTag value for String entries.- See Also:
 
- 
CONSTANT_FIELDREFpublic static final int CONSTANT_FIELDREFTag value for Field Reference entries.- See Also:
 
- 
CONSTANT_METHODREFpublic static final int CONSTANT_METHODREFTag value for Method Reference entries.- See Also:
 
- 
CONSTANT_INTERFACEMETHODREFpublic static final int CONSTANT_INTERFACEMETHODREFTag value for Interface Method Reference entries.- See Also:
 
- 
CONSTANT_NAMEANDTYPEpublic static final int CONSTANT_NAMEANDTYPETag value for Name and Type entries.- See Also:
 
- 
CONSTANT_METHODHANDLEpublic static final int CONSTANT_METHODHANDLETag value for Method Handle entries- See Also:
 
- 
CONSTANT_METHODTYPEpublic static final int CONSTANT_METHODTYPETag value for Method Type entries- See Also:
 
- 
CONSTANT_DYNAMICpublic static final int CONSTANT_DYNAMICTag value for Dynamic entries- See Also:
 
- 
CONSTANT_INVOKEDYNAMICpublic static final int CONSTANT_INVOKEDYNAMICTag value for InvokeDynamic entries- See Also:
 
- 
CONSTANT_MODULEINFOpublic static final int CONSTANT_MODULEINFOTag value for CONSTANT_Module_info entry- See Also:
 
- 
CONSTANT_PACKAGEINFOpublic static final int CONSTANT_PACKAGEINFOTag value for CONSTANT_Package_info entry (within a module)- See Also:
 
 
- 
- 
Constructor Details- 
ConstantPoolEntrypublic ConstantPoolEntry(int tagValue, int entries) Initialise the constant pool entry.- Parameters:
- tagValue- the tag value which identifies which type of constant pool entry this is.
- entries- the number of constant pool entry slots this entry occupies.
 
 
- 
- 
Method Details- 
readEntryRead 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:
- IOException- if the constant pool entry cannot be read from the stream
 
- 
isResolvedpublic 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.
 
- 
resolveResolve 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.
 
- 
readread a constant pool entry from a class stream.- Parameters:
- cpStream- the DataInputStream which contains the constant pool entry to be read.
- Throws:
- IOException- if there is a problem reading the entry from the stream.
 
- 
getTagpublic int getTag()Get the Entry's type tag.- Returns:
- The Tag value of this entry
 
- 
getNumEntriespublic 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.
 
 
-