T- the default or the user-defined factory interface to allocate static objects
public abstract class StaticShape<T> extends Object
StaticShape.Builderobject that can be used to register static properties and to generate a new static shape by calling one of its build methods.
StaticShape.getFactory()returns an implementation of the default or the user-defined factory interface that must be used to allocate static objects with the current shape.
StaticPropertyinstances registered to the builder that generated that shape or one of its parent shapes. Note that static shapes do not store the list of static properties associated to them. It is up to the user to store this information when required, for example in a class that contains references to the static shape and the list of static properties.
StaticShape cannot be subclassed by custom implementations and, when required, it allows static properties to check that the receiver object matches the expected shape.
|Modifier and Type||Class and Description|
Builder class to construct
|Modifier and Type||Method and Description|
Returns an instance of the default or the user-defined factory interface that must be used to allocate static objects with the current shape.
Creates a new static shape builder.
public static StaticShape.Builder newBuilder(TruffleLanguage<?> language)
DefaultStaticProperty, a trivial default implementation. In both cases, static properties must be registered to a static shape builder using
StaticShape.Builder.property(StaticProperty, Class, boolean). Then, after allocating a
StaticShapeinstance with one of the
StaticShape.Builder.build()methods and allocating a static object using the factory class provided by
StaticShape.getFactory(), users can call the accessor methods defined in
StaticPropertyto get and set property values stored in a static object instance.
language- an instance of the
TruffleLanguagethat uses the Static Object Model
NullPointerException- if language is null
public final T getFactory()