Package com.vaadin.flow.templatemodel
Interface ModelType
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
ComplexModelType<T>
- All Known Implementing Classes:
AbstractBasicModelType,BasicComplexModelType,BasicModelType,BeanModelType,ConvertedModelType,ListModelType,ModelDescriptor
Deprecated.
A model type that can convert values between a representation suitable for
users and a representation suitable for storage in a
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.
- Since:
- 1.0
- Author:
- Vaadin Ltd
-
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.Checks whether this type can accept application values of the given type.applicationToModel(Object applicationValue, PropertyFilter filter) Deprecated.Creates a model value representation of the provided application value.voidcreateInitialValue(StateNode node, String property) Deprecated.Create initial value for the givenpropertyand set it for thenode.Deprecated.Gets the JavaTypethat this model encapsulates.static StringDeprecated.Gets a string explaining the supported property types in model.modelToApplication(Serializable modelValue) Deprecated.Creates a representation of the provided model value that is intended for use in application code.elemental.json.JsonValuetoJson()Deprecated.Creates a JSON representation of this model type.
-
Method Details
-
modelToApplication
Deprecated.Creates a representation of the provided model value that is intended for use in application code. For mutable values, this is typically a proxy that is directly connected to the underlying model value.- Parameters:
modelValue- the model value to convert- Returns:
- a user-friendly representation of the provided model value
- Throws:
IllegalArgumentException- ifmodelValuecannot be handled by the type
-
applicationToModel
Deprecated.Creates a model value representation of the provided application value.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.
- Parameters:
applicationValue- the user value to convertfilter- the filter to use to determine which properties to include, notnull- Returns:
- a model value representation of the provided user value.
-
accepts
Deprecated.Checks whether this type can accept application values of the given type. The method only considers this actual type, not the types of sub properties or list items.- Parameters:
applicationType- the application type to check, notnull- Returns:
trueif the provided type is acceptable,falseotherwise
-
getJavaType
Type getJavaType()Deprecated.Gets the JavaTypethat this model encapsulates.- Returns:
- the java type
-
getSupportedTypesString
Deprecated.Gets a string explaining the supported property types in model.- Returns:
- a string explaining supported property types
-
toJson
elemental.json.JsonValue toJson()Deprecated.Creates a JSON representation of this model type.- Returns:
- a JSON representation of this model type, not
null
-
createInitialValue
Deprecated.Create initial value for the givenpropertyand set it for thenode.- Parameters:
node- the node where the initial value should be set thepropertyproperty- the property in thenodewhose initial value needs to be created
-
@Idmapping and the component API or the element API with property synchronization instead. Polymer template support is deprecated - we recommend you to useLitTemplateinstead. Read more details from the Vaadin blog.