Top Description Fields Constructors Methods
org.apache.tomcat.util.bcel.classfile

public abstract Class Constant

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.tomcat.util.bcel.classfile.ConstantClass, org.apache.tomcat.util.bcel.classfile.ConstantDouble, org.apache.tomcat.util.bcel.classfile.ConstantFloat, org.apache.tomcat.util.bcel.classfile.ConstantInteger, org.apache.tomcat.util.bcel.classfile.ConstantLong, org.apache.tomcat.util.bcel.classfile.ConstantUtf8
Imports
java.io.DataInput, .IOException, org.apache.tomcat.util.bcel.Const

Abstract superclass for classes to represent the different constant types in the constant pool of a class file. The classes keep closely to the JVM specification.

Field Summary

Modifier and TypeField and Description
private final byte

Constructor Summary

AccessConstructor and Description
pack-priv
Constant(final byte tag)

Method Summary

Modifier and TypeMethod and Description
public final byte

Returns:

Tag of constant, i.e., its type. No setTag() method to avoid confusion.
getTag
()

pack-priv static Constant

Returns:

Constant object
readConstant
(final DataInput
Input stream
dataInput
)

Reads one constant from the given input, the type depends on a tag byte.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

tagback to summary
private final byte tag

Constructor Detail

Constantback to summary
pack-priv Constant(final byte tag)

Method Detail

getTagback to summary
public final byte getTag()
Returns:byte

Tag of constant, i.e., its type. No setTag() method to avoid confusion.

readConstantback to summary
pack-priv static Constant readConstant(final DataInput dataInput) throws IOException, ClassFormatException

Reads one constant from the given input, the type depends on a tag byte.

Parameters
dataInput:DataInput

Input stream

Returns:Constant

Constant object

Exceptions
IOException:
if an I/O error occurs reading from the given dataInput.
ClassFormatException:
if the next byte is not recognized
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override