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 DefaultTemplateParser.getInstance() to
get its instance.
BundleParserTemplateParser.TemplateData| Modifier and Type | Method and Description |
|---|---|
static TemplateParser |
getInstance() |
TemplateParser.TemplateData |
getTemplateContent(Class<? extends PolymerTemplate<?>> clazz,
String tag,
VaadinService service)
Gets the template data which contains a JSOUP
Element
representing the template content and the template uri. |
protected boolean |
isStatsFileReadNeeded(VaadinService service)
Check status to see if stats.json needs to be loaded and parsed.
|
public static TemplateParser getInstance()
public TemplateParser.TemplateData getTemplateContent(Class<? extends PolymerTemplate<?>> clazz, String tag, VaadinService service)
TemplateParserElement
representing the template content and the template uri.getTemplateContent in interface TemplateParserclazz - the template classtag - the template tag nameservice - the related Vaadin serviceprotected 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
falseIOExceptionCopyright © 2000–2019 Vaadin Ltd. All rights reserved.