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 public interface ModelType extends Serializable
Deprecated.Template model and model types are not supported for lit template, but you can use@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.A model type that can convert values between a representation suitable for users and a representation suitable for storage in aStateNode.Model type instances are shared between all instances of a given
TemplateModeltype 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 Static Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description booleanaccepts(Type applicationType)Deprecated.Checks whether this type can accept application values of the given type.SerializableapplicationToModel(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.TypegetJavaType()Deprecated.Gets the JavaTypethat this model encapsulates.static StringgetSupportedTypesString()Deprecated.Gets a string explaining the supported property types in model.ObjectmodelToApplication(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 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 convert- Returns:
- a user-friendly representation of the provided model value
- Throws:
IllegalArgumentException- ifmodelValuecannot 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:
trueif the provided type is acceptable,falseotherwise
-
getJavaType
Type getJavaType()
Deprecated.Gets the JavaTypethat 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 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
-
-