public class ContextSwitchTemplate extends java.lang.Object implements TemplateEntry
| Modifier and Type | Class and Description |
|---|---|
private static class |
ContextSwitchTemplate.AndSet |
private static class |
ContextSwitchTemplate.ChildSet |
private static class |
ContextSwitchTemplate.ContextProvider |
private static class |
ContextSwitchTemplate.OrSet |
private static class |
ContextSwitchTemplate.ParentSet |
| Modifier and Type | Field and Description |
|---|---|
private ContextSwitchTemplate.ContextProvider |
context |
private static TemplateEngineDataProvider |
EMPTY_PROVIDER |
private TemplateEntry |
template |
| Constructor and Description |
|---|
ContextSwitchTemplate(SearchCompiler.Match match,
TemplateEntry template,
int searchExpressionPosition)
Constructs a new
ContextSwitchTemplate. |
| Modifier and Type | Method and Description |
|---|---|
void |
appendText(java.lang.StringBuilder result,
TemplateEngineDataProvider dataProvider)
Execute this template by generating text for a given data provider.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
isValid(TemplateEngineDataProvider dataProvider)
Check if this template is applicable to the given data provider.
|
private static SearchCompiler.Match |
transform(SearchCompiler.Match m,
int searchExpressionPosition) |
private static final TemplateEngineDataProvider EMPTY_PROVIDER
private final ContextSwitchTemplate.ContextProvider context
private final TemplateEntry template
public ContextSwitchTemplate(SearchCompiler.Match match, TemplateEntry template, int searchExpressionPosition) throws ParseError
ContextSwitchTemplate.match - matchtemplate - templatesearchExpressionPosition - search expression positionParseError - if a parse error occurs, or if the match transformation returns the same primitiveprivate static SearchCompiler.Match transform(SearchCompiler.Match m, int searchExpressionPosition) throws ParseError
ParseErrorpublic void appendText(java.lang.StringBuilder result, TemplateEngineDataProvider dataProvider)
TemplateEntryappendText in interface TemplateEntryresult - the StringBuilder to append the text todataProvider - the data provider from which information should be compiled to a stringpublic boolean isValid(TemplateEngineDataProvider dataProvider)
TemplateEntryisValid in interface TemplateEntrydataProvider - the data provider to checkpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object