public abstract class CPInfo extends java.lang.Object implements Node
CPInfo
denotes a cp_info structure somewhere in a ClassFile structure.
This class is not thread-safe.
Modifier | Constructor and Description |
---|---|
protected |
CPInfo(java.lang.String name,
int tag,
int constantPoolEntryCount)
Constructs a new
CPInfo instance. |
Modifier and Type | Method and Description |
---|---|
abstract CPInfo |
copy()
Returns a copy of this
CPInfo instance. |
int |
getConstantPoolEntryCount()
Returns the entry count of the constant_pool table.
|
java.lang.String |
getName()
Returns the name of the this
CPInfo instance. |
int |
getTag()
Returns the tag of this
CPInfo instance. |
abstract void |
write(java.io.DataOutput dataOutput)
Writes this
CPInfo to dataOutput . |
abstract void |
write(Document document)
Writes this
CPInfo to document . |
protected CPInfo(java.lang.String name, int tag, int constantPoolEntryCount)
CPInfo
instance.
If name
is null
, a NullPointerException
will be thrown.
If either tag
or constantPoolEntryCount
are less than 0
, an IllegalArgumentException
will be thrown.
name
- the name of the cp_info structuretag
- the tag of the cp_info structureconstantPoolEntryCount
- the entry count of the constant_pool tablejava.lang.IllegalArgumentException
- thrown if, and only if, either tag
or constantPoolEntryCount
are less than 0
java.lang.NullPointerException
- thrown if, and only if, name
is null
public abstract CPInfo copy()
CPInfo
instance.CPInfo
instancepublic final java.lang.String getName()
CPInfo
instance.CPInfo
instancepublic final int getConstantPoolEntryCount()
public final int getTag()
CPInfo
instance.CPInfo
instancepublic abstract void write(java.io.DataOutput dataOutput)
CPInfo
to dataOutput
.
If dataOutput
is an OutputStream
(or any other type of stream), this method will not close it.
If dataOutput
is null
, a NullPointerException
may be thrown. But no guarantees can be made.
If an I/O-error occurs, an UncheckedIOException
may be thrown. But no guarantees can be made.
dataOutput
- the DataOutput
to write tojava.lang.NullPointerException
- thrown if, and only if, dataOutput
is null
java.io.UncheckedIOException
- thrown if, and only if, an I/O-error occurspublic abstract void write(Document document)
CPInfo
to document
.
If document
is null
, a NullPointerException
may be thrown. But no guarantees can be made.
document
- the Document
to write tojava.lang.NullPointerException
- thrown if, and only if, document
is null