com.vaadin.flow.component.polymertemplate.
Class NpmTemplateParser
- java.lang.Object
-
- com.vaadin.flow.component.polymertemplate.NpmTemplateParser
-
All Implemented Interfaces:
Deprecated.
UseLitTemplateParserImpl
class forLitTemplate
components. Polymer template support is deprecated - we recommend you to useLitTemplate
instead. Read more details from the Vaadin blog.
@Deprecated public class NpmTemplateParser extends Object implements TemplateParser
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:
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.flow.component.polymertemplate.TemplateParser
TemplateParser.TemplateData, TemplateParser.TemplateParserFactory
-
-
Constructor Summary
Constructors Modifier Constructor and Description protected
NpmTemplateParser()
Deprecated.
The default constructor.
-
Method Summary
All Methods Modifier and Type Method and Description static TemplateParser
getInstance()
Deprecated.
protected String
getSourcesFromTemplate(VaadinService service, String tag, String url)
Deprecated.
Finds the JavaScript sources for given tag.
TemplateParser.TemplateData
getTemplateContent(Class<? extends PolymerTemplate<?>> clazz, String tag, VaadinService service)
Deprecated.
Gets the template data which contains a JSOUP
Element
representing the template content and the template uri.protected boolean
isStatsFileReadNeeded(VaadinService service)
Deprecated.
Check status to see if stats.json needs to be loaded and parsed.
-
-
-
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.
-
getTemplateContent
public TemplateParser.TemplateData getTemplateContent(Class<? extends PolymerTemplate<?>> clazz, String tag, VaadinService service)
Deprecated.
Description copied from interface:
TemplateParser
Gets the template data which contains a JSOUP
Element
representing the template content and the template uri.Specified by:
getTemplateContent
in interfaceTemplateParser
Parameters:
clazz
- the template classtag
- the template tag nameservice
- the related Vaadin serviceReturns:
the template data
-
getSourcesFromTemplate
protected String getSourcesFromTemplate(VaadinService service, String tag, String url)
Deprecated.
Finds the JavaScript sources for given tag.
Parameters:
service
- the related Vaadin servicetag
- the value of theTag
annotation, e.g. `my-component`url
- the URL resolved according to theJsModule
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.
-
isStatsFileReadNeeded
protected boolean isStatsFileReadNeeded(VaadinService service) throws IOException
Deprecated.
Check status to see if stats.json needs to be loaded and parsed.
Always load if jsonStats is null, never load again when we have a bundle as it never changes, always load a new stats if the hash has changed and we do not have a bundle.
Parameters:
service
- the Vaadin service.Returns:
true
if we need to re-load and parse stats.json, elsefalse
Throws:
-
-