See: Description
| Annotation Type | Description |
|---|---|
| Layout |
Annotate an interface with
Layout to generate an implementation of the interface which
uses object-model properties. |
| Nullable |
Apply to the constructor parameter that corresponds to an object-model DSL property to mark it as
being able to contain a null value.
|
| Volatile |
Apply to the constructor parameter that corresponds to an object-model DSL property to mark it as
volatile, in the sense of the Java Language Specification section 8.3.1.4.
|
The dynamic object storage model (com.oracle.truffle.api.object) is well suited to
supporting dynamic object models such as those found in Ruby and JavaScript. This domain specific
language makes it easier to also use the object storage model when you know at the time you are
writing your language what properties you will need, you want to be able to specify that
declaratively, and you want to be able to access the properties of the objects efficiently
without creating many nodes to do that.
A typical use-case of the object storage model DSL is to implement language built-in classes
which need internal implementation properties, as well as dynamic properties set by the language
user. Using the object storage model DSL allows the object storage model to be conveniently used
for both of these with just the one DynamicObject instance,
while providing an interface that is similar to if you were defining normal Java fields in a
separate object.
The object storage model DSL is used by creating interfaces annotated with
Layout.
Layout