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(java.lang.Object instance, ClassType type, java.lang.String mname)FieldLocation(java.lang.Object instance, java.lang.reflect.Field field)FieldLocation(java.lang.Object instance, java.lang.String cname, java.lang.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(java.lang.Object instance, Declaration decl)static FieldLocationmake(java.lang.Object instance, java.lang.String cname, java.lang.String fldName)voidset(java.lang.Object newValue)voidsetDeclaration(Declaration decl)voidsetProcedure()voidsetRestore(java.lang.Object oldValue)Restore an old value.voidsetSyntax()java.lang.ObjectsetWithSave(T newValue)Set a value, but return cookie so old value can be restored.java.lang.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
-
-
Constructor Detail
-
FieldLocation
public FieldLocation(java.lang.Object instance, java.lang.String cname, java.lang.String fname)
-
FieldLocation
public FieldLocation(java.lang.Object instance, ClassType type, java.lang.String mname)
-
FieldLocation
public FieldLocation(java.lang.Object instance, java.lang.reflect.Field field)
-
-
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(java.lang.Object newValue)
- Overrides:
setin classClassMemberLocation<T>
-
setWithSave
public java.lang.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(java.lang.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(java.lang.Object instance, Declaration decl)
-
make
public static FieldLocation make(java.lang.Object instance, java.lang.String cname, java.lang.String fldName)
-
-