class file. Entries are
read from class files, and can be created with a ConstantPoolBuilder to write to class files.
class file. Their index() return a non-positive invalid
value, and behaviors of their constantPool() are
unspecified. They are considered alien to any contextual constant pool and will be
converted when they are written to class files.
Implementation Note
Alien Constant Pool Entries
| Modifier and Type | Field and Description |
|---|---|
| public static final int | TAG_CLASS
The tag for |
| public static final int | TAG_DOUBLE
The tag for |
| public static final int | TAG_DYNAMIC
The tag for |
| public static final int | TAG_FIELDREF
The tag for |
| public static final int | TAG_FLOAT
The tag for |
| public static final int | TAG_INTEGER
The tag for |
| public static final int | TAG_INTERFACE_METHODREF
The tag for |
| public static final int | TAG_INVOKE_DYNAMIC
The tag for |
| public static final int | TAG_LONG
The tag for |
| public static final int | TAG_METHOD_HANDLE
The tag for |
| public static final int | TAG_METHOD_TYPE
The tag for |
| public static final int | TAG_METHODREF
The tag for |
| public static final int | TAG_MODULE
The tag for |
| public static final int | TAG_NAME_AND_TYPE
The tag for |
| public static final int | TAG_PACKAGE
The tag for |
| public static final int | TAG_STRING
The tag for |
| public static final int | TAG_UTF8
The tag for |
| Modifier and Type | Method and Description |
|---|---|
| public ConstantPool | Returns: the constant pool this entry is fromReturns the constant pool this entry is from. |
| public int | Returns: the index within the constant pool corresponding to this entryReturns the index within the constant pool corresponding to this entry. |
| public int | Returns: the constant pool tag that describes the type of this entryReturns the constant pool tag that describes the type of this entry. |
| public int | Returns: the number of constant pool slots this entry consumesReturns the number of constant pool slots this entry consumes. |
| TAG_CLASS | back to summary |
|---|---|
| public static final int TAG_CLASS The tag for | |
| TAG_DOUBLE | back to summary |
|---|---|
| public static final int TAG_DOUBLE The tag for | |
| TAG_DYNAMIC | back to summary |
|---|---|
| public static final int TAG_DYNAMIC The tag for | |
| TAG_FIELDREF | back to summary |
|---|---|
| public static final int TAG_FIELDREF The tag for | |
| TAG_FLOAT | back to summary |
|---|---|
| public static final int TAG_FLOAT The tag for | |
| TAG_INTEGER | back to summary |
|---|---|
| public static final int TAG_INTEGER The tag for | |
| TAG_INTERFACE_METHODREF | back to summary |
|---|---|
| public static final int TAG_INTERFACE_METHODREF The tag for | |
| TAG_INVOKE_DYNAMIC | back to summary |
|---|---|
| public static final int TAG_INVOKE_DYNAMIC The tag for | |
| TAG_LONG | back to summary |
|---|---|
| public static final int TAG_LONG The tag for | |
| TAG_METHOD_HANDLE | back to summary |
|---|---|
| public static final int TAG_METHOD_HANDLE The tag for | |
| TAG_METHOD_TYPE | back to summary |
|---|---|
| public static final int TAG_METHOD_TYPE The tag for | |
| TAG_METHODREF | back to summary |
|---|---|
| public static final int TAG_METHODREF The tag for | |
| TAG_MODULE | back to summary |
|---|---|
| public static final int TAG_MODULE The tag for | |
| TAG_NAME_AND_TYPE | back to summary |
|---|---|
| public static final int TAG_NAME_AND_TYPE The tag for | |
| TAG_PACKAGE | back to summary |
|---|---|
| public static final int TAG_PACKAGE The tag for | |
| TAG_STRING | back to summary |
|---|---|
| public static final int TAG_STRING The tag for | |
| TAG_UTF8 | back to summary |
|---|---|
| public static final int TAG_UTF8 The tag for | |
| constantPool | back to summary |
|---|---|
| public ConstantPool constantPool() Returns the constant pool this entry is from. API Note Given a
| |
| index | back to summary |
|---|---|
| public int index() Returns the index within the constant pool corresponding to this entry. A valid index is always positive; if the index is non-positive, this entry is unbound.
| |
| tag | back to summary |
|---|---|
| public int tag() Returns the constant pool tag that describes the type of this entry. API Note
| |
| width | back to summary |
|---|---|
| public int width() Returns the number of constant pool slots this entry consumes.
All pool entries except API Note If this entry is loadable, the width
of this entry does not decide if this entry should be loaded with
| |