edu.rit.classfile
Class SynthesizedClassFieldDescription

java.lang.Object
  extended by edu.rit.classfile.FieldReference
      extended by edu.rit.classfile.FieldDescription
          extended by edu.rit.classfile.SynthesizedFieldDescription
              extended by edu.rit.classfile.SynthesizedClassFieldDescription

public class SynthesizedClassFieldDescription
extends SynthesizedFieldDescription

Class SynthesizedInterfacefieldDescription is used to synthesize a field description for some actual field that is part of a class. To synthesize a class field:

  1. Create an instance of class SynthesizedClassFieldDescription, specifying the class, the field's name, and the field's type.

  2. Specify the field's access mode, static mode, final mode, volatile mode, and transient mode if necessary.

In the documentation below, the term "described field" means "the synthesized class field described by this synthesized class field description object."

To synthesize a class constant field, see class SynthesizedClassConstantFieldDescription. To synthesize an interface field, see class SynthesizedInterfaceFieldDescription.


Constructor Summary
SynthesizedClassFieldDescription(SynthesizedClassDescription theClassDescription, String theFieldName, TypeReference theFieldType)
          Construct a new synthesized class field description object with the given class, field name, and field type.
 
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 setStatic(boolean isStatic)
          Specify whether the described field is static.
 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

SynthesizedClassFieldDescription

public SynthesizedClassFieldDescription(SynthesizedClassDescription theClassDescription,
                                        String theFieldName,
                                        TypeReference theFieldType)
                                 throws ListFullException
Construct a new synthesized class field description object with the given class, field name, and field type. The described field is initially public, non-static, non-final, non-volatile, and non-transient. As a side effect, the described field is added to the given class.

Parameters:
theClassDescription - Class containing this field.
theFieldName - Field name.
theFieldType - Field type.
Throws:
NullPointerException - (unchecked exception) Thrown if theClassDescription is null, theFieldName is null, or theFieldType is null.
IllegalArgumentException - (unchecked exception) Thrown if theFieldName is zero length.
ListFullException - Thrown if theClassDescription's field list is full (i.e., contains 65535 fields).
Method Detail

setPublic

public void setPublic()
Specify that the described field is public, that is, may be accessed from inside and outside its defining package.


setPrivate

public void setPrivate()
Specify that the described field is private, that is, may be accessed only from inside its defining class.


setProtected

public 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.


setPackageScoped

public 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.


setStatic

public void setStatic(boolean isStatic)
Specify whether the described field is static.

Parameters:
isStatic - True if the described field is static, false otherwise.

setNonFinalNonVolatile

public 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.


setFinal

public 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.


setVolatile

public void setVolatile()
Specify that the described field is not final and is volatile, that is, may be changed after initialization and cannot be cached.


setTransient

public void setTransient(boolean isTransient)
Specify whether the described field is transient, that is, not written or read by a persistent object manager.

Parameters:
isTransient - True if the described field is transient, false otherwise.


Copyright © 2001-2006 by Alan Kaminsky. All rights reserved. Send comments to ark­@­cs.rit.edu.