io.sarl.api.naming.namespace
Class FieldAccess
class FieldAccess
extends java.lang.Object
Accessor to a field.
Maven Group Identifier:
io.sarl.sdk
Maven Artifact Identifier:
api.naming
Since:
0.12
Property Summary
Modifier and type Property and description
java.lang.reflect.Field field
java.lang.Object instance
SarlName name
Constructor Summary
Constructor and description
new(SarlName,Field,Object,boolean)
Constructor.
Action Summary
Modifier and type Action and description
java.lang.Object get
Replies the value of the field.
java.lang.reflect.Field getField
java.lang.Object getInstance
SarlName getName
boolean isWritable
java.lang.Object set(Object)
Change the value of the field.
java.lang.String toString
Property Details
field
val field : java.lang.reflect.Field

This property is an alias for the action: getField

instance
val instance : java.lang.Object

This property is an alias for the action: getInstance

name
val name : SarlName

This property is an alias for the action: getName

Constructor Details
new(SarlName,Field,Object,boolean)
new(SarlName,Field,Object,boolean)
Constructor.
Parameters:
name - the name of the field.
field - the field declaration.
instance - the object to have access to.
writable - indicates if the field is writeable through this accessor.
Action Details
get
def get : java.lang.Object
Replies the value of the field.
Returns:
the field's value.
getField
def getField : java.lang.reflect.Field
getInstance
def getInstance : java.lang.Object
getName
def getName : SarlName
isWritable
def isWritable : boolean
set(Object)
def set(Object) : java.lang.Object

throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException

Change the value of the field.
Parameters:
value - the field's value.
Returns:
the value before setting.
Throws exception:
  • java.lang.IllegalArgumentException: if the given value cannot be assigned to the field.
  • java.lang.IllegalAccessException: if the field cannot be written.
toString
def toString : java.lang.String