MCPcopy Create free account
hub / github.com/apache/freemarker / transform

Method transform

src/main/java/freemarker/ext/dom/Transform.java:118–133  ·  view source on GitHub ↗

Performs the transformation.

()

Source from the content-addressed store, hash-verified

116 * Performs the transformation.
117 */
118 void transform() throws Exception {
119 String templateName = ftlFile.getName();
120 Template template = cfg.getTemplate(templateName, locale);
121 NodeModel rootNode = NodeModel.parse(inputFile);
122 OutputStream outputStream = System.out;
123 if (outputFile != null) {
124 outputStream = new FileOutputStream(outputFile);
125 }
126 Writer outputWriter = new OutputStreamWriter(outputStream, encoding);
127 try {
128 template.process(null, outputWriter, null, rootNode);
129 } finally {
130 if (outputFile != null)
131 outputWriter.close();
132 }
133 }
134
135 static Transform transformFromArgs(String[] args) throws IOException {
136 int i=0;

Callers 1

mainMethod · 0.95

Calls 5

parseMethod · 0.95
processMethod · 0.95
getNameMethod · 0.45
getTemplateMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected