public interface ModelType extends Serializable
StateNode.
Model type instances are shared between all instances of a given
TemplateModel type and should therefore be immutable to prevent race
conditions. The root type for a model can be found using
ModelDescriptor.get(Class).
For internal use only. May be renamed or removed in a future release.
| Modifier and Type | Method and Description |
|---|---|
boolean |
accepts(Type applicationType)
Checks whether this type can accept application values of the given type.
|
Serializable |
applicationToModel(Object applicationValue,
PropertyFilter filter)
Creates a model value representation of the provided application value.
|
void |
createInitialValue(StateNode node,
String property)
Create initial value for the given
property and set it for the
node. |
Type |
getJavaType()
Gets the Java
Type that this model encapsulates. |
static String |
getSupportedTypesString()
Gets a string explaining the supported property types in model.
|
Object |
modelToApplication(Serializable modelValue)
Creates a representation of the provided model value that is intended for
use in application code.
|
elemental.json.JsonValue |
toJson()
Creates a JSON representation of this model type.
|
Object modelToApplication(Serializable modelValue) throws IllegalArgumentException
modelValue - the model value to convertIllegalArgumentException - if modelValue cannot be handled by the typeSerializable applicationToModel(Object applicationValue, PropertyFilter filter)
For application values that contain properties (i.e. beans), the provided filter is used to determine which properties from the bean should be included in the model representation.
applicationValue - the user value to convertfilter - the filter to use to determine which properties to include,
not nullboolean accepts(Type applicationType)
applicationType - the application type to check, not nulltrue if the provided type is acceptable,
false otherwiseType getJavaType()
Type that this model encapsulates.static String getSupportedTypesString()
elemental.json.JsonValue toJson()
nullCopyright © 2025. All rights reserved.