Class NpmTemplateParser

  • All Implemented Interfaces:
    TemplateParser

    @Deprecated
    public class NpmTemplateParser
    extends Object
    implements TemplateParser
    Deprecated.
    Use LitTemplateParserImpl class for LitTemplate components. Polymer template support is deprecated - we recommend you to use LitTemplate instead. Read more details from the Vaadin blog.
    Npm template parser implementation.

    The implementation scans all JsModule annotations for the given template class and tries to find the one that contains template definition using the tag name.

    The class is Singleton. Use getInstance() to get its instance.

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

    Since:
    2.0
    Author:
    Vaadin Ltd
    See Also:
    BundleParser
    • Constructor Detail

      • NpmTemplateParser

        protected NpmTemplateParser()
        Deprecated.
        The default constructor. Protected in order to prevent direct instantiation, but not private in order to allow mocking/overrides for testing purposes.
    • Method Detail

      • getInstance

        public static TemplateParser getInstance()
        Deprecated.
      • getSourcesFromTemplate

        protected String getSourcesFromTemplate​(VaadinService service,
                                                String tag,
                                                String url)
        Deprecated.
        Finds the JavaScript sources for given tag.
        Parameters:
        service - the related Vaadin service
        tag - the value of the Tag annotation, e.g. `my-component`
        url - the URL resolved according to the JsModule spec, for example ./view/my-view.js or @vaadin/vaadin-button.js.
        Returns:
        the .js source which declares given custom element, or null if no such source can be found.