Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removing Templater: TemplateFactory is now the only way to create tem…
…plates
- Loading branch information
Showing
19 changed files
with
234 additions
and
429 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
stencil/src/net/stencilproject/template/GatingTemplateLexer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
stencil/src/net/stencilproject/template/InternalParserTestSupport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
stencil/src/net/stencilproject/template/TemplateBuilderEvents.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package net.stencilproject.template; | ||
|
||
import org.antlr.runtime.tree.Tree; | ||
|
||
/** | ||
* Events that {@link TemplateBuilder} handles. | ||
*/ | ||
interface TemplateBuilderEvents { | ||
void text(TemplateFileSourceInfo source, String text) throws TemplateParserException; | ||
|
||
void tree(TemplateFileSourceInfo source, Tree tree) throws TemplateParserException; | ||
|
||
void done() throws TemplateParserException; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
stencil/test/net/stencilproject/template/AbstractTemplateTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package net.stencilproject.template; | ||
|
||
import java.io.IOException; | ||
|
||
public abstract class AbstractTemplateTest { | ||
protected Template parse(String text) throws TemplateParserException { | ||
return new TemplateFactory(new TemplateOptions()).parseString(TemplateMode.TEXT, null, text); | ||
} | ||
|
||
protected Template parseResource(String filename) throws TemplateParserException, IOException { | ||
return new TemplateFactory(new TemplateOptions()).parse(TemplateMode.TEXT, null, getClass(), filename); | ||
} | ||
|
||
protected Template parse(TemplateRootScope rootScope, String text) throws TemplateParserException { | ||
return new TemplateFactory(new TemplateOptions()).parseString(TemplateMode.TEXT, rootScope, text); | ||
} | ||
|
||
protected Template parseHtml(String text) throws TemplateParserException { | ||
return new TemplateFactory(new TemplateOptions()).parseString(TemplateMode.HTML, null, text); | ||
} | ||
|
||
protected Template parseXml(String text) throws TemplateParserException { | ||
return new TemplateFactory(new TemplateOptions()).parseString(TemplateMode.XML, null, text); | ||
} | ||
|
||
protected Template parseResourceXml(String filename) throws TemplateParserException, IOException { | ||
return new TemplateFactory(new TemplateOptions()).parse(TemplateMode.XML, null, getClass(), filename); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.