LitTemplateParserImpl
class for LitTemplate
components. Polymer template support is deprecated - we recommend
you to use LitTemplate
instead. Read more details from
the
Vaadin blog.@Deprecated public class NpmTemplateParser extends Object implements TemplateParser
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.
BundleParser
TemplateParser.TemplateData, TemplateParser.TemplateParserFactory
Modifier | Constructor and Description |
---|---|
protected |
NpmTemplateParser()
Deprecated.
The default constructor.
|
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.
|
protected NpmTemplateParser()
public static TemplateParser getInstance()
public TemplateParser.TemplateData getTemplateContent(Class<? extends PolymerTemplate<?>> clazz, String tag, VaadinService service)
TemplateParser
Element
representing the template content and the template uri.getTemplateContent
in interface TemplateParser
clazz
- the template classtag
- the template tag nameservice
- the related Vaadin serviceprotected String getSourcesFromTemplate(VaadinService service, String tag, String url)
service
- the related Vaadin servicetag
- 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
.protected boolean isStatsFileReadNeeded(VaadinService service) throws IOException
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.
service
- the Vaadin service.true
if we need to re-load and parse stats.json, else
false
IOException
Copyright © 2021. All rights reserved.