|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rit.classfile.FieldReference
edu.rit.classfile.FieldDescription
edu.rit.classfile.SynthesizedFieldDescription
edu.rit.classfile.SynthesizedClassConstantFieldDescription
public class SynthesizedClassConstantFieldDescription
Class SynthesizedClassConstantFieldDescription is used to synthesize a field description for some actual field that is part of a class and that has an initial constant value. A class constant field is always static. A class constant field may or may not be final. (When a field has a constant value, it only means the field is initialized automatically with a constant value. It doesn't mean the field has to keep that value forever.) To synthesize a class constant field:
In the documentation below, the term "described field" means "the synthesized class constant field described by this synthesized class constant field description object."
To synthesize a class field that is not constant, see class SynthesizedClassFieldDescription
. To
synthesize an interface field, see class SynthesizedInterfaceFieldDescription
.
Constructor Summary | |
---|---|
SynthesizedClassConstantFieldDescription(SynthesizedClassDescription theClassDescription,
String theFieldName,
boolean theValue)
Construct a new synthesized class constant field description object with the given class, field name, and boolean constant value. |
|
SynthesizedClassConstantFieldDescription(SynthesizedClassDescription theClassDescription,
String theFieldName,
byte theValue)
Construct a new synthesized class constant field description object with the given class, field name, and byte constant value. |
|
SynthesizedClassConstantFieldDescription(SynthesizedClassDescription theClassDescription,
String theFieldName,
char theValue)
Construct a new synthesized class constant field description object with the given class, field name, and character constant value. |
|
SynthesizedClassConstantFieldDescription(SynthesizedClassDescription theClassDescription,
String theFieldName,
double theValue)
Construct a new synthesized class constant field description object with the given class, field name, and double constant value. |
|
SynthesizedClassConstantFieldDescription(SynthesizedClassDescription theClassDescription,
String theFieldName,
float theValue)
Construct a new synthesized class constant field description object with the given class, field name, and float constant value. |
|
SynthesizedClassConstantFieldDescription(SynthesizedClassDescription theClassDescription,
String theFieldName,
int theValue)
Construct a new synthesized class constant field description object with the given class, field name, and integer constant value. |
|
SynthesizedClassConstantFieldDescription(SynthesizedClassDescription theClassDescription,
String theFieldName,
long theValue)
Construct a new synthesized class constant field description object with the given class, field name, and long constant value. |
|
SynthesizedClassConstantFieldDescription(SynthesizedClassDescription theClassDescription,
String theFieldName,
short theValue)
Construct a new synthesized class constant field description object with the given class, field name, and short constant value. |
|
SynthesizedClassConstantFieldDescription(SynthesizedClassDescription theClassDescription,
String theFieldName,
String theValue)
Construct a new synthesized class constant field description object with the given class, field name, and string constant value. |
Method Summary | |
---|---|
void |
setFinal()
Specify that the described field is final and is not volatile, that is, may not be changed after initialization and can be cached. |
void |
setNonFinalNonVolatile()
Specify that the described field is not final and is not volatile, that is, may be changed after initialization and can be cached. |
void |
setPackageScoped()
Specify that the described field has default access (also known as package scoped), that is, may be accessed only from inside its defining package or inside its defining class. |
void |
setPrivate()
Specify that the described field is private, that is, may be accessed only from inside its defining class. |
void |
setProtected()
Specify that the described field is protected, that is, may be accessed only from inside its defining package, inside its defining class, or inside subclasses of its defining class. |
void |
setPublic()
Specify that the described field is public, that is, may be accessed from inside and outside its defining package. |
void |
setTransient(boolean isTransient)
Specify whether the described field is transient, that is, not written or read by a persistent object manager. |
void |
setVolatile()
Specify that the described field is not final and is volatile, that is, may be changed after initialization and cannot be cached. |
Methods inherited from class edu.rit.classfile.FieldDescription |
---|
getConstantValue, isFinal, isPackageScoped, isPrivate, isProtected, isPublic, isStatic, isTransient, isVolatile |
Methods inherited from class edu.rit.classfile.FieldReference |
---|
equals, getClassReference, getFieldDescriptor, getFieldName, getFieldType, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SynthesizedClassConstantFieldDescription(SynthesizedClassDescription theClassDescription, String theFieldName, String theValue) throws ListFullException
theClassDescription
- Class containing this field.theFieldName
- Field name.theValue
- String constant value.
NullPointerException
- (unchecked exception) Thrown if theClassDescription is null,
theFieldName is null, or theValue is null.
IllegalArgumentException
- (unchecked exception) Thrown if theFieldName is zero length.
ListFullException
- Thrown if the requisite constant pool entries could not be added
because the constant pool is full. Also thrown if
theClassDescription's field list is full (i.e., contains
65535 fields).public SynthesizedClassConstantFieldDescription(SynthesizedClassDescription theClassDescription, String theFieldName, int theValue) throws ListFullException
theClassDescription
- Class containing this field.theFieldName
- Field name.theValue
- Integer constant value.
NullPointerException
- (unchecked exception) Thrown if theClassDescription is null
or theFieldName is null.
IllegalArgumentException
- (unchecked exception) Thrown if theFieldName is zero length.
ListFullException
- Thrown if the requisite constant pool entries could not be added
because the constant pool is full. Also thrown if
theClassDescription's field list is full (i.e., contains
65535 fields).public SynthesizedClassConstantFieldDescription(SynthesizedClassDescription theClassDescription, String theFieldName, short theValue) throws ListFullException
theClassDescription
- Class containing this field.theFieldName
- Field name.theValue
- Short constant value.
NullPointerException
- (unchecked exception) Thrown if theClassDescription is null
or theFieldName is null.
IllegalArgumentException
- (unchecked exception) Thrown if theFieldName is zero length.
ListFullException
- Thrown if the requisite constant pool entries could not be added
because the constant pool is full. Also thrown if
theClassDescription's field list is full (i.e., contains
65535 fields).public SynthesizedClassConstantFieldDescription(SynthesizedClassDescription theClassDescription, String theFieldName, char theValue) throws ListFullException
theClassDescription
- Class containing this field.theFieldName
- Field name.theValue
- Character constant value.
NullPointerException
- (unchecked exception) Thrown if theClassDescription is null
or theFieldName is null.
IllegalArgumentException
- (unchecked exception) Thrown if theFieldName is zero length.
ListFullException
- Thrown if the requisite constant pool entries could not be added
because the constant pool is full. Also thrown if
theClassDescription's field list is full (i.e., contains
65535 fields).public SynthesizedClassConstantFieldDescription(SynthesizedClassDescription theClassDescription, String theFieldName, byte theValue) throws ListFullException
theClassDescription
- Class containing this field.theFieldName
- Field name.theValue
- Byte constant value.
NullPointerException
- (unchecked exception) Thrown if theClassDescription is null
or theFieldName is null.
IllegalArgumentException
- (unchecked exception) Thrown if theFieldName is zero length.
ListFullException
- Thrown if the requisite constant pool entries could not be added
because the constant pool is full. Also thrown if
theClassDescription's field list is full (i.e., contains
65535 fields).public SynthesizedClassConstantFieldDescription(SynthesizedClassDescription theClassDescription, String theFieldName, boolean theValue) throws ListFullException
theClassDescription
- Class containing this field.theFieldName
- Field name.theValue
- Boolean constant value.
NullPointerException
- (unchecked exception) Thrown if theClassDescription is null
or theFieldName is null.
IllegalArgumentException
- (unchecked exception) Thrown if theFieldName is zero length.
ListFullException
- Thrown if the requisite constant pool entries could not be added
because the constant pool is full. Also thrown if
theClassDescription's field list is full (i.e., contains
65535 fields).public SynthesizedClassConstantFieldDescription(SynthesizedClassDescription theClassDescription, String theFieldName, float theValue) throws ListFullException
theClassDescription
- Class containing this field.theFieldName
- Field name.theValue
- Float constant value.
NullPointerException
- (unchecked exception) Thrown if theClassDescription is null
or theFieldName is null.
IllegalArgumentException
- (unchecked exception) Thrown if theFieldName is zero length.
ListFullException
- Thrown if the requisite constant pool entries could not be added
because the constant pool is full. Also thrown if
theClassDescription's field list is full (i.e., contains
65535 fields).public SynthesizedClassConstantFieldDescription(SynthesizedClassDescription theClassDescription, String theFieldName, long theValue) throws ListFullException
theClassDescription
- Class containing this field.theFieldName
- Field name.theValue
- Long constant value.
NullPointerException
- (unchecked exception) Thrown if theClassDescription is null
or theFieldName is null.
IllegalArgumentException
- (unchecked exception) Thrown if theFieldName is zero length.
ListFullException
- Thrown if the requisite constant pool entries could not be added
because the constant pool is full. Also thrown if
theClassDescription's field list is full (i.e., contains
65535 fields).public SynthesizedClassConstantFieldDescription(SynthesizedClassDescription theClassDescription, String theFieldName, double theValue) throws ListFullException
theClassDescription
- Class containing this field.theFieldName
- Field name.theValue
- Double constant value.
NullPointerException
- (unchecked exception) Thrown if theClassDescription is null
or theFieldName is null.
IllegalArgumentException
- (unchecked exception) Thrown if theFieldName is zero length.
ListFullException
- Thrown if the requisite constant pool entries could not be added
because the constant pool is full. Also thrown if
theClassDescription's field list is full (i.e., contains
65535 fields).Method Detail |
---|
public void setPublic()
public void setPrivate()
public void setProtected()
public void setPackageScoped()
public void setNonFinalNonVolatile()
public void setFinal()
public void setVolatile()
public void setTransient(boolean isTransient)
isTransient
- True if the described field is transient, false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |