ValueSemanticsProvider
Provides a mechanism for providing a set of value semantics.
This interface is used by Value to allow these semantics to be provided through a single point. Alternatively, Value supports this information being provided via the configuration files.
Whatever the class that implements this interface, it must also expose either a public
no-arg constructor, or (for implementations that also are Facet
s) a public
constructor that accepts a FacetHolder
, and CausewayConfiguration
and a ValueSemanticsProviderContext
. This constructor is then used by the framework to instantiate the object reflectively.
API
interface ValueSemanticsProvider<T> {
Class<T> getCorrespondingClass()
ValueType getSchemaValueType() (1)
ValueDecomposition decompose(T value) (2)
T compose(ValueDecomposition decomposition) (3)
OrderRelation<T, ?> getOrderRelation() (4)
Converter<T, ?> getConverter() (5)
Renderer<T> getRenderer() (6)
Parser<T> getParser() (7)
DefaultsProvider<T> getDefaultsProvider() (8)
IdStringifier<T> getIdStringifier() (9)
ValueSemanticsProvider<X> castTo(Class<X> cls)
boolean isEnumType()
boolean isNumberType()
boolean isTemporalType()
boolean isCompositeType()
}
1 | getSchemaValueType()
Values might appear within CommandDto , InteractionDto and ChangesDto , where a mapping onto one of ValueType (s) as provided by the XML schema is required. |
2 | decompose(T)
Converts a value object into either a ValueWithTypeDto or TypedTupleDto . |
3 | compose(ValueDecomposition)
Converts either a ValueWithTypeDto or a TypedTupleDto to an instance of the object. |
4 | getOrderRelation()
The OrderRelation , if any. |
5 | getConverter()
The Converter , if any. |
6 | getRenderer()
The Renderer , if any. |
7 | getParser()
The Parser , if any. |
8 | getDefaultsProvider()
The DefaultsProvider , if any. |
9 | getIdStringifier()
The IdStringifier , if any. |
Members
getSchemaValueType()
Values might appear within CommandDto , InteractionDto and ChangesDto , where a mapping onto one of ValueType (s) as provided by the XML schema is required.
compose(ValueDecomposition)
Converts either a ValueWithTypeDto or a TypedTupleDto to an instance of the object.
getOrderRelation()
The OrderRelation , if any.
getConverter()
The Converter , if any.
getRenderer()
The Renderer , if any.
getParser()
The Parser , if any.
getDefaultsProvider()
The DefaultsProvider , if any.
If not null
, implies that the value has (or may have) a default.
getIdStringifier()
The IdStringifier , if any.