Package javafx.reflect

Provides reflective access to JavaFX values and types.

See:
          Description

Interface Summary
MemberHandler Call-back object for use when iterating over a set of members.
 

Class Summary
AttributeRef A run-time represention of a JavaFX attribute in a class.
ClassRef A run-time representation of a JavaFX class.
FunctionTypeRef A run-time representation of a JavaFX function type.
FunctionValueRef A mirror of a function value.
LocalReflectionContext Implementation of ReflectionContext using Java reflection.
LocationRef A reference to a specific location (var or attribute).
MemberRef A run-time represention of a JavaFX member of a class.
MethodRef A reference to a function in a class.
ObjectRef A handle/proxy for an Object reference.
ReflectionContext Context for reflective operations.
SequenceBuilder Helper class for reflectively building sequences.
SequenceTypeRef A run-time representation of a JavaFX sequence type.
TypeRef A run-time representation of a JavaFX type.
ValueRef A proxy/mirror for a run-time value.
 

Package javafx.reflect Description

Provides reflective access to JavaFX values and types. This packages defines a Java API (rather than a JavaFX API), so it can be used from both Java and JavaFX code. A future JavaFX API may be layered on top of this.

Values

The various reflection operations do not directly use Java values. Instead, an ObjectRef is a handle or proxy for an Object. This extra layer of indirection isn't needed in many cases, bur it is useful for remote invocation, remote control, or in general access to data in a different VM,

Context

The objects in this package are directly or indirectly created from a ReflectionContext. In the default case there is a single ReflectionContext instance that makes use of Java reflection. However, using a ReflectionContext again allows various kinds of indirection.

Object creation

To do the equivalent of the JavaFX code:
 var x = ...;
 var z = Foo { a: 10; b: bind x.y };
 
you can do:
 ReflectionContext rcontext = ...;
 ClassRef cls = rcontext.findClass(...);
 ObjectRef x = ...;
 ObjectRef z = cls.allocation();
 z.initAttribute("a", ???);
 z.initBinding("b", ???);
 z = obj.initialize();
 

Sequence operations

Use SequenceBuilder to create a new sequence.

To get the number of items in a sequence, use ValueRef.getItemCount. To index into a sequence, use ValueRef.getItem.

Design notes and issues

Some design principles, influenced by the "Mirrored reflection" APIs (Bracha and Ungar: Mirrors: Design Principles for Meta-level Facilities of Object-Oritented Programming Languages, OOPSLA 2004), and JDI :

To do