Class AbstractBasicModelType<T>

java.lang.Object
com.vaadin.flow.templatemodel.AbstractBasicModelType<T>
Type Parameters:
T - the (basic) Java type used by this model type
All Implemented Interfaces:
ModelType, Serializable
Direct Known Subclasses:
BasicComplexModelType, BasicModelType

@Deprecated public abstract class AbstractBasicModelType<T> extends Object implements ModelType
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 use LitTemplate instead. Read more details from the Vaadin blog.
Common abstract class with generic functionality for basic mode type.

For internal use only. May be renamed or removed in a future release.

Since:
1.0
Author:
Vaadin Ltd
See Also:
  • Constructor Details

    • AbstractBasicModelType

      protected AbstractBasicModelType(Class<T> type)
      Deprecated.
  • Method Details

    • accepts

      public boolean accepts(Type applicationType)
      Deprecated.
      Description copied from interface: ModelType
      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.
      Specified by:
      accepts in interface ModelType
      Parameters:
      applicationType - the application type to check, not null
      Returns:
      true if the provided type is acceptable, false otherwise
    • getJavaType

      public Class<T> getJavaType()
      Deprecated.
      Description copied from interface: ModelType
      Gets the Java Type that this model encapsulates.
      Specified by:
      getJavaType in interface ModelType
      Returns:
      the java type
    • toJson

      public elemental.json.JsonValue toJson()
      Deprecated.
      Description copied from interface: ModelType
      Creates a JSON representation of this model type.
      Specified by:
      toJson in interface ModelType
      Returns:
      a JSON representation of this model type, not null
    • createInitialValue

      public void createInitialValue(StateNode node, String property)
      Deprecated.
      Description copied from interface: ModelType
      Create initial value for the given property and set it for the node.
      Specified by:
      createInitialValue in interface ModelType
      Parameters:
      node - the node where the initial value should be set the property
      property - the property in the node whose initial value needs to be created
    • convertToApplication

      protected Object convertToApplication(Serializable modelValue)
      Deprecated.
      Converts the given model value to the application type of this model type. The conversion automatically handles default values for primitive types and conversion of client-originated numbers to the expected Java number type.
      Parameters:
      modelValue - the model value to convert
      Returns:
      the converted value, not null if the application type is a primitive
    • loadBasicTypes

      protected static <M> Map<Class<?>,M> loadBasicTypes(Function<Class<?>,M> factory)
      Deprecated.