com.vaadin.flow.component.polymertemplate.

Class TemplateInitializer

  • java.lang.Object
    • com.vaadin.flow.component.polymertemplate.TemplateInitializer

  • public class TemplateInitializer
    extends Object

    Template initialization related logic (parse template, create sub-templates, inject elements by id).

    Since:

    1.0

    Author:

    Vaadin Ltd

    • Constructor Detail

      • TemplateInitializer

        public TemplateInitializer(PolymerTemplate<?> template,
                                   TemplateParser parser,
                                   VaadinService service)

        Creates a new initializer instance.

        Parameters:

        template - a template to initialize

        parser - a template parser instance

        service - the related service

    • Method Detail

      • initChildElements

        public void initChildElements()

        Initializes child elements.

      • getTwoWayBindingPaths

        public Set<String> getTwoWayBindingPaths()

        Gets a set of two way binding paths encountered in the template.

        Returns:

        an unmodifiable collection of two way binding paths

      • getUsesClass

        public static Optional<Class<? extends Component>> getUsesClass(Class<? extends PolymerTemplate<?>> templateType,
                                                                        String tagName)

        Looks for a component class with the given tag name among the classes used by the given polymer template class. Usage is determined based on the @Uses annotation.

        Parameters:

        templateType - the polymer template type

        tagName - the tag name to look for

        Returns:

        an optional component class, or an empty optional if the template doesn't use any component with the given tag name