klyn.reflection.Attribute.getValue
method
public native getValue(target as Object) as Object
Description

Returns the current value of the attribute on the given target object.

Non-public attributes require accessible = true.

Parameters
ParameterDescription
targetInstance owning the reflected attribute.
Returns

Current boxed value of the attribute.

Throws
  • TypeError if target is null, belongs to an unrelated class, or the field is inaccessible.
Example
attr = type(r).getAttribute("_numerator")
attr.accessible = true
assert attr.getValue(r) == 1