Package org.apache.bcel.classfile
Class SimpleElementValue
- java.lang.Object
-
- org.apache.bcel.classfile.ElementValue
-
- org.apache.bcel.classfile.SimpleElementValue
-
public class SimpleElementValue extends ElementValue
Represents a simple element value in an annotation.- Since:
- 6.0
-
-
Field Summary
Fields Modifier and Type Field Description private intindex-
Fields inherited from class org.apache.bcel.classfile.ElementValue
ANNOTATION, ARRAY, CLASS, cpool, EMPTY_ARRAY, ENUM_CONSTANT, PRIMITIVE_BOOLEAN, PRIMITIVE_BYTE, PRIMITIVE_CHAR, PRIMITIVE_DOUBLE, PRIMITIVE_FLOAT, PRIMITIVE_INT, PRIMITIVE_LONG, PRIMITIVE_SHORT, STRING, type
-
-
Constructor Summary
Constructors Constructor Description SimpleElementValue(int type, int index, ConstantPool cpool)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddump(java.io.DataOutputStream dos)Dumps this element value to a DataOutputStream.intgetIndex()booleangetValueBoolean()bytegetValueByte()chargetValueChar()doublegetValueDouble()floatgetValueFloat()intgetValueInt()longgetValueLong()shortgetValueShort()java.lang.StringgetValueString()voidsetIndex(int index)java.lang.StringstringifyValue()Returns a string representation of the element value.java.lang.StringtoString()Returns a string representation of the element value.-
Methods inherited from class org.apache.bcel.classfile.ElementValue
getConstantPool, getElementValueType, getType, readElementValue, readElementValue, toShortString
-
-
-
-
Constructor Detail
-
SimpleElementValue
public SimpleElementValue(int type, int index, ConstantPool cpool)
-
-
Method Detail
-
dump
public void dump(java.io.DataOutputStream dos) throws java.io.IOExceptionDescription copied from class:ElementValueDumps this element value to a DataOutputStream.- Specified by:
dumpin classElementValue- Parameters:
dos- the output stream.- Throws:
java.io.IOException- if an I/O error occurs.
-
getIndex
public int getIndex()
- Returns:
- Value entry index in the constant pool.
-
getValueBoolean
public boolean getValueBoolean()
-
getValueByte
public byte getValueByte()
-
getValueChar
public char getValueChar()
-
getValueDouble
public double getValueDouble()
-
getValueFloat
public float getValueFloat()
-
getValueInt
public int getValueInt()
-
getValueLong
public long getValueLong()
-
getValueShort
public short getValueShort()
-
getValueString
public java.lang.String getValueString()
-
setIndex
public void setIndex(int index)
-
stringifyValue
public java.lang.String stringifyValue()
Description copied from class:ElementValueReturns a string representation of the element value.- Specified by:
stringifyValuein classElementValue- Returns:
- a string representation of the element value.
-
toString
public java.lang.String toString()
Description copied from class:ElementValueReturns a string representation of the element value.- Overrides:
toStringin classElementValue- Returns:
- a string representation of the element value.
-
-