Creates a new mirror which uses the same symbol, but is bound to a different receiver.
Creates a new mirror which uses the same symbol, but is bound to a different receiver. This is significantly faster than recreating the mirror from scratch.
Retrieves the value stored in the field.
Retrieves the value stored in the field.
Scala reflection uses reflection capabilities of the underlying platform,
so FieldMirror.get
might throw platform-specific exceptions associated
with getting a field or invoking a getter method of the field.
If symbol
represents a field of a base class with respect to the class of the receiver,
and this base field is overriden in the class of the receiver, then this method will retrieve
the value of the base field. To achieve overriding behavior, use reflectMethod on an accessor.
The object containing the field
Updates the value stored in the field.
Updates the value stored in the field.
If a field is immutable, a ScalaReflectionException
will be thrown.
Scala reflection uses reflection capabilities of the underlying platform,
so FieldMirror.get
might throw platform-specific exceptions associated
with setting a field or invoking a setter method of the field.
If symbol
represents a field of a base class with respect to the class of the receiver,
and this base field is overriden in the class of the receiver, then this method will set
the value of the base field. To achieve overriding behavior, use reflectMethod on an accessor.
The field symbol representing the field.
The field symbol representing the field.
In Scala val
and var
declarations are usually compiled down to a pair of
a backing field and corresponding accessor/accessors, which means that a single
declaration might correspond to up to three different symbols. Nevertheless
the FieldMirror.symbol
field always points to a backing field symbol.
Returns string formatted according to given format
string.
Returns string formatted according to given format
string.
Format strings are as for String.format
(@see java.lang.String.format).
A mirror that reflects a field. See the overview page for details on how to use runtime reflection.