public final class ConstantValueWriter extends ClassWriter.Element
Constructor and Description |
---|
ConstantValueWriter(ClassWriter w)
Build an empty writer.
|
ConstantValueWriter(ClassWriter w,
double v)
Build an writer for a 'double' constant value.
|
ConstantValueWriter(ClassWriter w,
float v)
Build an writer for a 'float' constant value.
|
ConstantValueWriter(ClassWriter w,
int v)
Build an writer for an 'int' constant value.
|
ConstantValueWriter(ClassWriter w,
long v)
Build an writer for a 'long' constant value.
|
ConstantValueWriter(ClassWriter w,
String v)
Build an writer for a 'String' constant value.
|
Modifier and Type | Method and Description |
---|---|
int |
copyInto(byte[] buf,
int offset)
Copy the bytes into 'buf' at offset 'offset'.
|
int |
getSize() |
void |
setDouble(double value)
Set the constant value to a double.
|
void |
setFloat(float value)
Set the constant value to a float.
|
void |
setInt(int value)
Set the constant value to an int.
|
void |
setLong(long value)
Set the constant value to a long.
|
void |
setString(String value)
Set the constant value to a String.
|
void |
setValueCPIndex(int index)
Set the index of the constant pool item holding the constant value.
|
public ConstantValueWriter(ClassWriter w)
IllegalArgumentException
- if w is nullpublic ConstantValueWriter(ClassWriter w, long v)
public ConstantValueWriter(ClassWriter w, int v)
public ConstantValueWriter(ClassWriter w, float v)
public ConstantValueWriter(ClassWriter w, double v)
public ConstantValueWriter(ClassWriter w, String v)
public int getSize()
getSize
in class ClassWriter.Element
public int copyInto(byte[] buf, int offset) throws IllegalArgumentException
ClassWriter.Element
copyInto
in class ClassWriter.Element
IllegalArgumentException
public void setLong(long value)
public void setDouble(double value)
public void setInt(int value)
public void setFloat(float value)
public void setString(String value)
public void setValueCPIndex(int index) throws IllegalArgumentException
IllegalArgumentException