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 intKIND_FLAGS_SETTrue if the flagsPROCEDURE|SYNTAX|INDIRECT_LOCATION|CONSTANTare valid.static intPROCEDUREstatic intSYNTAX
-
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 Tget()Get the current value of this location.Tget(T defaultValue)DeclarationgetDeclaration()FieldgetField()TypegetFType()Get the type of the field.booleanisBound()booleanisConstant()booleanisIndirectLocation()booleanisProcedureOrSyntax()static FieldLocationmake(Object instance, Declaration decl)static FieldLocationmake(Object instance, String cname, String fldName)voidset(Object newValue)voidsetDeclaration(Declaration decl)voidsetProcedure()voidsetRestore(Object oldValue)Restore an old value.voidsetSyntax()ObjectsetWithSave(T newValue)Set a value, but return cookie so old value can be restored.StringtoString()-
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|CONSTANTare 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:
getin classClassMemberLocation<T>
-
set
public void set(Object newValue)
- Overrides:
setin classClassMemberLocation<T>
-
setWithSave
public Object setWithSave(T newValue)
Description copied from class:LocationSet 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:
setWithSavein classLocation<T>
-
setRestore
public void setRestore(Object oldValue)
Description copied from class:LocationRestore an old value.- Overrides:
setRestorein classLocation<T>- Parameters:
oldValue- the return value from a prior setWithSave.
-
isConstant
public boolean isConstant()
- Overrides:
isConstantin classClassMemberLocation<T>
-
isBound
public boolean isBound()
- Overrides:
isBoundin classClassMemberLocation<T>
-
make
public static FieldLocation make(Object instance, Declaration decl)
-
make
public static FieldLocation make(Object instance, String cname, String fldName)
-
-