You're viewing an older version of Vaadin JavaDoc. Please see version 24.7.0 for the latest.
com.vaadin.flow.templatemodel.

Class ListModelType<T>

  • Type Parameters:

    T - the proxy type used by the bean type of this type

    All Implemented Interfaces:

    ComplexModelType<T>, ModelType, Serializable

    @Deprecated
    public class ListModelType<T>
    extends Object
    implements ComplexModelType<T>
    Deprecated.
    Template model and polymer template support is deprecated - we recommend you to use LitTemplate instead. Read more details from the Vaadin blog. For lit templates, you can use @Id mapping and the component API or the element API with property synchronization instead.

    A model type corresponding to a list of bean types.

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

    Since:

    1.0

    Author:

    Vaadin Ltd

    See Also:

    Serialized Form

    • Constructor Detail

      • ListModelType

        public ListModelType​(ComplexModelType<T> itemType)
        Deprecated.

        Creates a new list model type with the given bean model type.

        Parameters:

        itemType - the model type of the list items

    • Method Detail

      • getItemType

        public ComplexModelType<T> getItemType()
        Deprecated.

        Gets the item type.

        Returns:

        the item type, not null

      • modelToApplication

        public List<T> modelToApplication​(Serializable modelValue)
        Deprecated.

        Description copied from interface: ModelType

        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.

        Specified by:

        modelToApplication in interface ModelType

        Parameters:

        modelValue - the model value to convert

        Returns:

        a user-friendly representation of the provided model value

      • applicationToModel

        public StateNode applicationToModel​(Object applicationValue,
                                            PropertyFilter filter)
        Deprecated.

        Description copied from interface: ModelType

        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.

        Specified by:

        applicationToModel in interface ComplexModelType<T>

        Specified by:

        applicationToModel in interface ModelType

        Parameters:

        applicationValue - the user value to convert

        filter - the filter to use to determine which properties to include, not null

        Returns:

        a model value representation of the provided user value.

      • cast

        public <C> ComplexModelType<C> cast​(Class<C> proxyType)
        Deprecated.

        Description copied from interface: ComplexModelType

        Checks that this type uses the provided proxy type and returns this type as a model type with that proxy type.

        Specified by:

        cast in interface ComplexModelType<T>

        Type Parameters:

        C - the proxy type

        Parameters:

        proxyType - the proxy type to cast to

        Returns:

        this model type

      • isList

        public static boolean isList​(Type type)
        Deprecated.

        Checks if the given type will be handled as a list of beans in the model.

        Parameters:

        type - the type to check

        Returns:

        true if the given type will be handled as a list of beans, false otherwise

      • importBeans

        public void importBeans​(ModelList modelList,
                                List<T> beans,
                                PropertyFilter propertyFilter)
        Deprecated.

        Imports beans into a model list based on the properties in the item type of this model type.

        Parameters:

        modelList - the model list to import beans into

        beans - the list of beans to import

        propertyFilter - defines which properties from the item model type to import

      • 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 Type 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