private void processType(TypeElement type, Templated templated, String inject) { String isElementTypeParameter = getIsElementTypeParameter(type.getInterfaces()); String subclass = TypeSimplifier.simpleNameOf(generatedClassName(type, "Templated_", "")); TemplateContext context = new TemplateContext(TypeSimplifier.packageNameOf(type), TypeSimplifier.classNameOf(type), subclass, isElementTypeParameter, inject); // root element and template TemplateSelector templateSelector = getTemplateSelector(type, templated); org.jsoup.nodes.Element root = parseTemplate(type, templateSelector); context.setRoot(createRootElementInfo(root, subclass)); // find and verify all @DataElement members List<DataElementInfo> dataElements = processDataElements(type, templateSelector, root); context.setDataElements(dataElements); // find and verify all @PostConstruct methods List<PostConstructInfo> postConstructs = processPostConstruct(type); context.setPostConstructs(postConstructs); // init parameters and abstract properties List<AbstractPropertyInfo> abstractProperties = processAbstractProperties(type); context.setAbstractProperties(abstractProperties); // generate code code(FREEMARKER_TEMPLATE, context.getPackage(), context.getSubclass(), () -> ImmutableMap.of("context", context)); info("Generated templated implementation [%s] for [%s]", context.getSubclass(), context.getBase()); }
private void processType(TypeElement type, Templated templated, String inject) { String isElementTypeParameter = getIsElementTypeParameter(type.getInterfaces()); String subclass = TypeSimplifier.simpleNameOf(generatedClassName(type, "Templated_", "")); TemplateContext context = new TemplateContext(TypeSimplifier.packageNameOf(type), TypeSimplifier.classNameOf(type), subclass, isElementTypeParameter, inject); // root element and template TemplateSelector templateSelector = getTemplateSelector(type, templated); org.jsoup.nodes.Element root = parseTemplate(type, templateSelector); context.setRoot(createRootElementInfo(root, subclass)); // find and verify all @DataElement members List<DataElementInfo> dataElements = processDataElements(type, templateSelector, root); context.setDataElements(dataElements); // find and verify all @PostConstruct methods List<PostConstructInfo> postConstructs = processPostConstruct(type); context.setPostConstructs(postConstructs); // init parameters and abstract properties List<AbstractPropertyInfo> abstractProperties = processAbstractProperties(type); context.setAbstractProperties(abstractProperties); // generate code code(FREEMARKER_TEMPLATE, context.getPackage(), context.getSubclass(), () -> ImmutableMap.of("context", context)); info("Generated templated implementation [%s] for [%s]", context.getSubclass(), context.getBase()); }
private void processType(TypeElement type, Templated templated, String inject) { String isElementTypeParameter = getIsElementTypeParameter(type.getInterfaces()); String subclass = TypeSimplifier.simpleNameOf(generatedClassName(type, "Templated_", "")); TemplateContext context = new TemplateContext(TypeSimplifier.packageNameOf(type), TypeSimplifier.classNameOf(type), subclass, isElementTypeParameter, inject); // root element and template TemplateSelector templateSelector = getTemplateSelector(type, templated); org.jsoup.nodes.Element root = parseTemplate(type, templateSelector); context.setRoot(createRootElementInfo(root, subclass)); // find and verify all @DataElement members List<DataElementInfo> dataElements = processDataElements(type, templateSelector, root); context.setDataElements(dataElements); // find and verify all @PostConstruct methods List<PostConstructInfo> postConstructs = processPostConstruct(type); context.setPostConstructs(postConstructs); // init parameters and abstract properties List<AbstractPropertyInfo> abstractProperties = processAbstractProperties(type); context.setAbstractProperties(abstractProperties); // generate code code(FREEMARKER_TEMPLATE, context.getPackage(), context.getSubclass(), () -> ImmutableMap.of("context", context)); info("Generated templated implementation [%s] for [%s]", context.getSubclass(), context.getBase()); }