public class FieldVariableAccessor extends VariableAccessor
classId, DUMMY_ACCESSOR, index, name, realClass| Constructor and Description |
|---|
FieldVariableAccessor(RubyClass realClass,
java.lang.String name,
int index,
int classId,
java.lang.invoke.MethodHandle getter,
java.lang.invoke.MethodHandle setter)
Construct a new FieldVariableAccessor for the given "real" class,
variable name, variable index, class ID, and field offset
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
get(java.lang.Object object)
Retrieve the variable's value from the given object.
|
java.lang.invoke.MethodHandle |
getGetter() |
java.lang.invoke.MethodHandle |
getSetter() |
void |
set(java.lang.Object object,
java.lang.Object value)
Set this variable into the given object using Unsafe to ensure
safe updating of the variable table.
|
protected java.lang.invoke.MethodHandle |
wrapSetter(java.lang.invoke.MethodHandle setter) |
getClassId, getIndex, getName, getVariable, toString, verifypublic FieldVariableAccessor(RubyClass realClass, java.lang.String name, int index, int classId, java.lang.invoke.MethodHandle getter, java.lang.invoke.MethodHandle setter)
realClass - the "real" classname - the variable's nameindex - the variable's indexclassId - the class's IDgetter - the getter handle for the fieldsetter - the setter handle for the fieldprotected java.lang.invoke.MethodHandle wrapSetter(java.lang.invoke.MethodHandle setter)
public java.lang.invoke.MethodHandle getGetter()
public java.lang.invoke.MethodHandle getSetter()
public java.lang.Object get(java.lang.Object object)
get in class VariableAccessorobject - the object from which to retrieve this variablepublic void set(java.lang.Object object,
java.lang.Object value)
set in class VariableAccessorobject - the object into which to set this variablevalue - the variable's valueCopyright © 2001-2022 JRuby. All Rights Reserved.