Package gnu.kawa.reflect
Class FieldLocation<T>
- java.lang.Object
-
- gnu.mapping.Location<T>
-
- gnu.kawa.reflect.ClassMemberLocation<T>
-
- gnu.kawa.reflect.FieldLocation<T>
-
- Direct Known Subclasses:
StaticFieldLocation
public class FieldLocation<T> extends ClassMemberLocation<T>
-
-
Field Summary
Fields Modifier and Type Field Description static int
KIND_FLAGS_SET
True if the flagsPROCEDURE|SYNTAX|INDIRECT_LOCATION|CONSTANT
are valid.static int
PROCEDURE
static int
SYNTAX
-
Constructor Summary
Constructors Constructor Description FieldLocation(Object instance, ClassType type, String mname)
FieldLocation(Object instance, Field field)
FieldLocation(Object instance, String cname, String fname)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description T
get()
Get the current value of this location.T
get(T defaultValue)
Declaration
getDeclaration()
Field
getField()
Type
getFType()
Get the type of the field.boolean
isBound()
boolean
isConstant()
boolean
isIndirectLocation()
boolean
isProcedureOrSyntax()
static FieldLocation
make(Object instance, Declaration decl)
static FieldLocation
make(Object instance, String cname, String fldName)
void
set(Object newValue)
void
setDeclaration(Declaration decl)
void
setProcedure()
void
setRestore(Object oldValue)
Restore an old value.void
setSyntax()
Object
setWithSave(T newValue)
Set a value, but return cookie so old value can be restored.String
toString()
-
Methods inherited from class gnu.kawa.reflect.ClassMemberLocation
define, defineAll, getDeclaringClass, getDeclaringClassname, getInstance, getMemberName, getRClass, getRField, setInstance
-
-
-
-
Field Detail
-
PROCEDURE
public static final int PROCEDURE
- See Also:
- Constant Field Values
-
SYNTAX
public static final int SYNTAX
- See Also:
- Constant Field Values
-
KIND_FLAGS_SET
public static final int KIND_FLAGS_SET
True if the flagsPROCEDURE|SYNTAX|INDIRECT_LOCATION|CONSTANT
are valid.- See Also:
- Constant Field Values
-
-
Method Detail
-
isIndirectLocation
public boolean isIndirectLocation()
-
setProcedure
public void setProcedure()
-
setSyntax
public void setSyntax()
-
isProcedureOrSyntax
public boolean isProcedureOrSyntax()
-
setDeclaration
public void setDeclaration(Declaration decl)
-
getField
public Field getField()
-
getFType
public Type getFType()
Get the type of the field.
-
getDeclaration
public Declaration getDeclaration()
-
get
public T get(T defaultValue)
- Overrides:
get
in classClassMemberLocation<T>
-
set
public void set(Object newValue)
- Overrides:
set
in classClassMemberLocation<T>
-
setWithSave
public Object setWithSave(T newValue)
Description copied from class:Location
Set a value, but return cookie so old value can be restored. This is intended for fluid-let where (in the case of multiple threads) a simple save-restore isn't always the right thing.- Overrides:
setWithSave
in classLocation<T>
-
setRestore
public void setRestore(Object oldValue)
Description copied from class:Location
Restore an old value.- Overrides:
setRestore
in classLocation<T>
- Parameters:
oldValue
- the return value from a prior setWithSave.
-
isConstant
public boolean isConstant()
- Overrides:
isConstant
in classClassMemberLocation<T>
-
isBound
public boolean isBound()
- Overrides:
isBound
in classClassMemberLocation<T>
-
make
public static FieldLocation make(Object instance, Declaration decl)
-
make
public static FieldLocation make(Object instance, String cname, String fldName)
-
-