Class TemplateModelUtil

java.lang.Object
com.vaadin.flow.templatemodel.TemplateModelUtil

@Deprecated public final class TemplateModelUtil extends Object
Deprecated.
This functionality is internal and bound to template model which is not supported for lit template. Polymer template support is deprecated - we recommend you to use LitTemplate instead. Read more details from the Vaadin blog.
Utility class for mapping Bean values to TemplateModel values.

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

Since:
1.0
Author:
Vaadin Ltd
  • Method Details

    • resolveBeanAndRun

      public static <R> R resolveBeanAndRun(TemplateModel model, String modelPath, BiFunction<BeanModelType<?>,com.vaadin.flow.internal.nodefeature.ElementPropertyMap,R> callback)
      Deprecated.
      Resolves a bean model type and model map based on a model instance and passes those values to the provided callback.
      Type Parameters:
      R - the return type
      Parameters:
      model - the model instance for which to resolve a type and a map, not null
      modelPath - the model path to resolve, not null
      callback - the callback to run with the resolved bean type and the model map, not null
      Returns:
      the value returned by the callback
    • resolveListAndRun

      public static <R> R resolveListAndRun(TemplateModel model, String modelPath, BiFunction<ListModelType<?>,com.vaadin.flow.internal.nodefeature.ModelList,R> callback)
      Deprecated.
      Resolves a list model type and a model list based on a model instance and passes those to the provided callback.
      Type Parameters:
      R - the return type
      Parameters:
      model - the model instance for which to resolve a type and a list, not null
      modelPath - the model path to resolve, not null
      callback - the callback to run with the resolved list type and model list, not null
      Returns:
      the value returned by the callback
    • getFilterFromIncludeExclude

      public static Predicate<String> getFilterFromIncludeExclude(Method method)
      Deprecated.
      Gets a filter based on any @Include and/or @Exclude annotations present on the given method.
      Parameters:
      method - the method to check
      Returns:
      a filter based on the given annotations