gnu.kawa.reflect
Class ClassMemberLocation

java.lang.Object
  extended by gnu.mapping.Location
      extended by gnu.kawa.reflect.ClassMemberLocation
Direct Known Subclasses:
FieldLocation

public class ClassMemberLocation
extends Location

A Location whose value is that of a named field/method of an object. The object is used as the owning Location's value. (For now, only fields are supported.)


Field Summary
 
Fields inherited from class gnu.mapping.Location
UNBOUND
 
Constructor Summary
ClassMemberLocation(java.lang.Object instance, java.lang.Class clas, java.lang.String mname)
           
ClassMemberLocation(java.lang.Object instance, ClassType type, java.lang.String mname)
           
ClassMemberLocation(java.lang.Object instance, java.lang.reflect.Field field)
           
 
Method Summary
static void define(java.lang.Object instance, java.lang.reflect.Field rfield, java.lang.String uri, Language language, Environment env)
           
static void defineAll(java.lang.Object instance, Environment env)
          Import all the public fields of an object.
 java.lang.Object get(java.lang.Object defaultValue)
           
 ClassType getDeclaringClass()
           
 java.lang.Object getInstance()
           
 java.lang.String getMemberName()
           
 java.lang.reflect.Field getRField()
           
 boolean isBound()
           
 boolean isConstant()
           
 void set(java.lang.Object value)
           
 void setInstance(java.lang.Object obj)
           
 
Methods inherited from class gnu.mapping.Location
entered, get, getBase, getKeyProperty, getKeySymbol, getValue, make, make, make, print, setRestore, setValue, setWithSave, toString, undefine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassMemberLocation

public ClassMemberLocation(java.lang.Object instance,
                           ClassType type,
                           java.lang.String mname)

ClassMemberLocation

public ClassMemberLocation(java.lang.Object instance,
                           java.lang.Class clas,
                           java.lang.String mname)

ClassMemberLocation

public ClassMemberLocation(java.lang.Object instance,
                           java.lang.reflect.Field field)
Method Detail

getInstance

public final java.lang.Object getInstance()

setInstance

public final void setInstance(java.lang.Object obj)

getMemberName

public java.lang.String getMemberName()

getDeclaringClass

public ClassType getDeclaringClass()

getRField

public java.lang.reflect.Field getRField()

get

public java.lang.Object get(java.lang.Object defaultValue)
Specified by:
get in class Location

isConstant

public boolean isConstant()
Overrides:
isConstant in class Location

isBound

public boolean isBound()
Overrides:
isBound in class Location

set

public void set(java.lang.Object value)
Specified by:
set in class Location

define

public static void define(java.lang.Object instance,
                          java.lang.reflect.Field rfield,
                          java.lang.String uri,
                          Language language,
                          Environment env)
                   throws java.lang.IllegalAccessException
Throws:
java.lang.IllegalAccessException

defineAll

public static void defineAll(java.lang.Object instance,
                             Environment env)
                      throws java.lang.IllegalAccessException
Import all the public fields of an object.

Throws:
java.lang.IllegalAccessException