Package org.jruby.runtime.ivars
Class RawFieldVariableAccessor
java.lang.Object
org.jruby.runtime.ivars.VariableAccessor
org.jruby.runtime.ivars.FieldVariableAccessor
org.jruby.runtime.ivars.RawFieldVariableAccessor
A variable accessor that accesses a reified java field directly (Storing java objects that may not be IRubyObjects
-
Field Summary
Fields inherited from class org.jruby.runtime.ivars.VariableAccessor
classId, DUMMY_ACCESSOR, index, name, realClass -
Constructor Summary
ConstructorsConstructorDescriptionRawFieldVariableAccessor(RubyClass realClass, boolean unwrapInSet, Class<?> toJava, Class<?> returnType, String name, int index, int classId, MethodHandle getter, MethodHandle setter) Construct a new RawFieldVariableAccessor for the given "real" class, variable name, variable index, class ID, and field offset -
Method Summary
Modifier and TypeMethodDescriptionprotected static MethodHandlewrapGetter(MethodHandle getter, RubyClass realClass, Class<?> basetype) protected MethodHandlewrapSetter(MethodHandle setter) protected static MethodHandlewrapSetter(MethodHandle setter, RubyClass realClass, boolean unwrap, Class<?> toJava, Class<?> basetype) Methods inherited from class org.jruby.runtime.ivars.FieldVariableAccessor
get, getGetter, getOrNil, getSetter, setMethods inherited from class org.jruby.runtime.ivars.VariableAccessor
getClassId, getIndex, getName, getOrUndefined, getVariable, toString, verify
-
Constructor Details
-
RawFieldVariableAccessor
public RawFieldVariableAccessor(RubyClass realClass, boolean unwrapInSet, Class<?> toJava, Class<?> returnType, String name, int index, int classId, MethodHandle getter, MethodHandle setter) Construct a new RawFieldVariableAccessor for the given "real" class, variable name, variable index, class ID, and field offset- Parameters:
realClass- the "real" classunwrapInSet- if the setter should unwrap ruby objects for java use usetoJava- the variable's java typename- the variable's nameindex- the variable's indexclassId- the class's IDgetter- the getter handle for the fieldsetter- the setter handle for the field
-
-
Method Details
-
wrapSetter
- Overrides:
wrapSetterin classFieldVariableAccessor
-
wrapSetter
protected static MethodHandle wrapSetter(MethodHandle setter, RubyClass realClass, boolean unwrap, Class<?> toJava, Class<?> basetype) -
wrapGetter
protected static MethodHandle wrapGetter(MethodHandle getter, RubyClass realClass, Class<?> basetype)
-