gnu.kawa.reflect

Class ClassMemberLocation

Known Direct 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(Object instance, Class clas, String mname)
ClassMemberLocation(Object instance, ClassType type, String mname)
ClassMemberLocation(Object instance, java.lang.reflect.Field field)

Method Summary

static void
define(Object instance, java.lang.reflect.Field rfield, String uri, Language language, Environment env)
static void
defineAll(Object instance, Environment env)
Import all the public fields of an object.
Object
get(Object defaultValue)
ClassType
getDeclaringClass()
Object
getInstance()
String
getMemberName()
java.lang.reflect.Field
getRField()
boolean
isBound()
boolean
isConstant()
void
set(Object value)
void
setInstance(Object obj)

Methods inherited from class gnu.mapping.Location

entered, get, get, getBase, getKeyProperty, getKeySymbol, getValue, isBound, isConstant, make, make, make, print, set, setRestore, setValue, setWithSave, toString, undefine

Constructor Details

ClassMemberLocation

public ClassMemberLocation(Object instance,
                           Class clas,
                           String mname)

ClassMemberLocation

public ClassMemberLocation(Object instance,
                           ClassType type,
                           String mname)

ClassMemberLocation

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

Method Details

define

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

defineAll

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

get

public Object get(Object defaultValue)
Overrides:
get in interface Location

getDeclaringClass

public ClassType getDeclaringClass()

getInstance

public final Object getInstance()

getMemberName

public String getMemberName()

getRField

public java.lang.reflect.Field getRField()

isBound

public boolean isBound()
Overrides:
isBound in interface Location

isConstant

public boolean isConstant()
Overrides:
isConstant in interface Location

set

public void set(Object value)
Overrides:
set in interface Location

setInstance

public final void setInstance(Object obj)