com.vaadin.flow.templatemodel.
Interface ModelType
-
All Superinterfaces:
All Known Subinterfaces:
All Known Implementing Classes:
AbstractBasicModelType
,BasicComplexModelType
,BasicModelType
,BeanModelType
,ConvertedModelType
,ListModelType
,ModelDescriptor
@Deprecated public interface ModelType extends Serializable
Deprecated.Template model and model types are not supported for lit template, but you can use@Id
mapping and the component API or the element API with property synchronization instead. Polymer template support is deprecated - we recommend you to useLitTemplate
instead. Read more details from the Vaadin blog.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 usingModelDescriptor.get(Class)
.For internal use only. May be renamed or removed in a future release.
Since:
1.0
Author:
Vaadin Ltd
-
-
Method Summary
All Methods Modifier and Type Method Description boolean
accepts(Type applicationType)
Deprecated.
Checks whether this type can accept application values of the given type.
Serializable
applicationToModel(Object applicationValue, PropertyFilter filter)
Deprecated.
Creates a model value representation of the provided application value.
void
createInitialValue(StateNode node, String property)
Deprecated.
Create initial value for the given
property
and set it for thenode
.Type
getJavaType()
Deprecated.
Gets the Java
Type
that this model encapsulates.static String
getSupportedTypesString()
Deprecated.
Gets a string explaining the supported property types in model.
Object
modelToApplication(Serializable modelValue)
Deprecated.
Creates a representation of the provided model value that is intended for use in application code.
elemental.json.JsonValue
toJson()
Deprecated.
Creates a JSON representation of this model type.
-
-
-
Method Detail
-
modelToApplication
Object modelToApplication(Serializable modelValue) throws IllegalArgumentException
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 convertReturns:
a user-friendly representation of the provided model value
Throws:
IllegalArgumentException
- ifmodelValue
cannot be handled by the type
-
applicationToModel
Serializable applicationToModel(Object applicationValue, PropertyFilter filter)
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
boolean accepts(Type applicationType)
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:
true
if the provided type is acceptable,false
otherwise
-
getJavaType
Type getJavaType()
Deprecated.Gets the Java
Type
that this model encapsulates.Returns:
the java type
-
getSupportedTypesString
static String 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
void createInitialValue(StateNode node, String property)
Deprecated.Create initial value for the given
property
and set it for thenode
.Parameters:
node
- the node where the initial value should be set theproperty
property
- the property in thenode
whose initial value needs to be created
-
-