edu.rit.classfile
Class FieldDescription

java.lang.Object
  extended by edu.rit.classfile.FieldReference
      extended by edu.rit.classfile.FieldDescription
Direct Known Subclasses:
SynthesizedFieldDescription

public abstract class FieldDescription
extends FieldReference

Class FieldDescription encapsulates the information needed to refer to or to describe a field. This includes the field's class, name, type, access flags, and constant value if any. In the documentation below, the term "described field" means "the field described by this field description object."


Method Summary
 Object getConstantValue()
          Returns the described field's constant value.
 boolean isFinal()
          Returns true if the described field is final, that is, may not be changed after initialization.
 boolean isPackageScoped()
          Returns true if 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.
 boolean isPrivate()
          Returns true if the described field is private, that is, may be accessed only from inside its defining class.
 boolean isProtected()
          Returns true if 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.
 boolean isPublic()
          Returns true if the described field is public, that is, may be accessed from inside and outside its defining package.
 boolean isStatic()
          Returns true if the described field is static.
 boolean isTransient()
          Returns true if the described field is transient, that is, not written or read by a persistent object manager.
 boolean isVolatile()
          Returns true if the described field is volatile, that is, cannot be cached.
 
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
 

Method Detail

isPublic

public boolean isPublic()
Returns true if the described field is public, that is, may be accessed from inside and outside its defining package.


isPrivate

public boolean isPrivate()
Returns true if the described field is private, that is, may be accessed only from inside its defining class.


isProtected

public boolean isProtected()
Returns true if 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.


isPackageScoped

public boolean isPackageScoped()
Returns true if 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.


isStatic

public boolean isStatic()
Returns true if the described field is static.


isFinal

public boolean isFinal()
Returns true if the described field is final, that is, may not be changed after initialization.


isVolatile

public boolean isVolatile()
Returns true if the described field is volatile, that is, cannot be cached.


isTransient

public boolean isTransient()
Returns true if the described field is transient, that is, not written or read by a persistent object manager.


getConstantValue

public Object getConstantValue()
Returns the described field's constant value. This pertains only to a static field of one of the types listed below. All other fields have no constant value. Depending on the described field's type, the returned object is an instance of one of the following classes:

Field's Type   Returned Object
java.lang.String   String
int   Integer
short   Short
char   Character
byte   Byte
boolean   Boolean
float   Float
long   Long
double   Double

Returns:
Object containing the described field's constant value, or null if the described field does not have a constant value.


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