public final class ConstantValueWriter extends ClassWriter.Element
After constructing a ConstantValueWriter, you must call setValueCPIndex.
| 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,
java.lang.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(java.lang.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)
java.lang.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, java.lang.String v)
public int getSize()
getSize in class ClassWriter.Elementpublic int copyInto(byte[] buf,
int offset)
throws java.lang.IllegalArgumentException
ClassWriter.ElementcopyInto in class ClassWriter.Elementjava.lang.IllegalArgumentExceptionpublic void setLong(long value)
public void setDouble(double value)
public void setInt(int value)
public void setFloat(float value)
public void setString(java.lang.String value)
public void setValueCPIndex(int index)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException