TemplateElement rootTreeNode = template.getRootTreeNode(); for (int i = 0; i < rootTreeNode.getChildCount(); i++) { TemplateModel templateModel = rootTreeNode.getChildNodes().get(i); if (!(templateModel instanceof StringModel)) { continue;
public void extractFields(Reader reader, String entryName, FieldsExtractor extractor) throws XDocReportException { try { Template template = new Template(entryName, reader, getFreemarkerConfiguration()); TemplateElement templateElement = template.getRootTreeNode(); extractVariables(templateElement, extractor); templateElement.getChildNodes(); } catch (IOException e) { throw new XDocReportException(e); } catch (TemplateModelException e) { throw new XDocReportException(e); } }
public void extractFields( Reader reader, String entryName, FieldsExtractor extractor ) throws XDocReportException { try { Template template = new Template( entryName, reader, getFreemarkerConfiguration() ); TemplateElement templateElement = template.getRootTreeNode(); extractVariables( templateElement, extractor ); templateElement.getChildNodes(); } catch ( IOException e ) { throw new XDocReportException( e ); } catch ( TemplateModelException e ) { throw new XDocReportException( e ); } }