use of com.axellience.vuegwt.processors.component.template.parser.context.localcomponents.LocalComponents in project vue-gwt by Axellience.
the class ComponentTemplateProcessor method processComponentTemplate.
public void processComponentTemplate(TypeElement componentTypeElement, Builder componentJsTypeBuilder) {
ClassName componentTypeName = ClassName.get(componentTypeElement);
Optional<String> optionalTemplateContent = getTemplateContent(componentTypeName, componentTypeElement);
if (!optionalTemplateContent.isPresent())
return;
LocalComponents localComponents = new LocalComponents();
findLocalComponentsForComponent(localComponents, componentTypeElement);
// Initialize the template parser context based on the VueComponent type element
TemplateParserContext templateParserContext = new TemplateParserContext(componentTypeElement, localComponents);
registerFieldsAndMethodsInContext(templateParserContext, componentTypeElement, new HashSet<>(), new HashSet<>());
// Parse the template
TemplateParserResult templateParserResult = new TemplateParser().parseHtmlTemplate(optionalTemplateContent.get(), templateParserContext, messager);
// Add expressions from the template to JsType and compile template
TemplateMethodsBuilder templateMethodsBuilder = new TemplateMethodsBuilder();
templateMethodsBuilder.addTemplateMethodsToComponentJsType(componentJsTypeBuilder, templateParserResult);
}
Aggregations