public class TemplateParser extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static java.util.Collection<Tokenizer.TokenType> |
CONDITION_WITH_APOSTROPHES_END_TOKENS |
private static java.util.Collection<Tokenizer.TokenType> |
EXPRESSION_END_TOKENS |
private Tokenizer |
tokenizer |
| Constructor and Description |
|---|
TemplateParser(java.lang.String template)
Constructs a new
TemplateParser. |
| Modifier and Type | Method and Description |
|---|---|
private Tokenizer.Token |
check(Tokenizer.TokenType expectedToken) |
TemplateEntry |
parse()
Parse the template.
|
private TemplateEntry |
parseCondition() |
private TemplateEntry |
parseContextSwitch() |
private TemplateEntry |
parseExpression(java.util.Collection<Tokenizer.TokenType> endTokens) |
private TemplateEntry |
parseVariable() |
private void |
skipWhitespace() |
private static final java.util.Collection<Tokenizer.TokenType> EXPRESSION_END_TOKENS
private static final java.util.Collection<Tokenizer.TokenType> CONDITION_WITH_APOSTROPHES_END_TOKENS
public TemplateParser(java.lang.String template)
TemplateParser.template - template string to parseprivate Tokenizer.Token check(Tokenizer.TokenType expectedToken) throws ParseError
ParseErrorpublic TemplateEntry parse() throws ParseError
ParseError - if the template cannot be parsedprivate TemplateEntry parseExpression(java.util.Collection<Tokenizer.TokenType> endTokens) throws ParseError
ParseErrorprivate TemplateEntry parseVariable() throws ParseError
ParseErrorprivate void skipWhitespace() throws ParseError
ParseErrorprivate TemplateEntry parseCondition() throws ParseError
ParseErrorprivate TemplateEntry parseContextSwitch() throws ParseError
ParseError