org.antlr.stringtemplate.language
Class ConditionalExpr

java.lang.Object
  extended by org.antlr.stringtemplate.language.Expr
      extended by org.antlr.stringtemplate.language.ASTExpr
          extended by org.antlr.stringtemplate.language.ConditionalExpr

public class ConditionalExpr
extends ASTExpr

A conditional reference to an embedded subtemplate.


Nested Class Summary
protected static class ConditionalExpr.ElseIfClauseData
           
 
Field Summary
 
Fields inherited from class org.antlr.stringtemplate.language.ASTExpr
DEFAULT_ATTRIBUTE_NAME, DEFAULT_ATTRIBUTE_NAME_DEPRECATED, DEFAULT_INDEX_VARIABLE_NAME, DEFAULT_INDEX0_VARIABLE_NAME, DEFAULT_MAP_KEY_NAME, DEFAULT_MAP_VALUE_NAME, defaultOptionValues, EMPTY_OPTION, MAP_KEY_VALUE, MISSING, supportedOptions
 
Fields inherited from class org.antlr.stringtemplate.language.Expr
enclosingTemplate, indentation
 
Constructor Summary
ConditionalExpr(StringTemplate enclosingTemplate, antlr.collections.AST tree)
           
 
Method Summary
 void addElseIfSubtemplate(ASTExpr conditionalTree, StringTemplate subtemplate)
           
 StringTemplate getElseSubtemplate()
           
 StringTemplate getSubtemplate()
           
 void setElseSubtemplate(StringTemplate elseSubtemplate)
           
 void setSubtemplate(StringTemplate subtemplate)
           
 int write(StringTemplate self, StringTemplateWriter out)
          To write out the value of a condition expr, invoke the evaluator in eval.g to walk the condition tree computing the boolean value.
protected  int writeSubTemplate(StringTemplate self, StringTemplateWriter out, StringTemplate subtemplate)
           
 
Methods inherited from class org.antlr.stringtemplate.language.ASTExpr
accessField, add, applyListOfAlternatingTemplates, applyTemplateToListOfAttributes, convertAnythingIteratableToIterator, convertAnythingToIterator, convertArrayToList, evaluateArguments, evaluateExpression, first, getAST, getMethod, getObjectProperty, getOption, getTemplateInclude, handleExprOptions, invokeMethod, last, length, rawGetObjectProperty, rest, setSoleFormalArgumentToIthValue, strip, testAttributeTrue, toString, trunc, write, writeAttribute, writeIterableValue, writePOJO, writeTemplate
 
Methods inherited from class org.antlr.stringtemplate.language.Expr
getEnclosingTemplate, getIndentation, setIndentation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConditionalExpr

public ConditionalExpr(StringTemplate enclosingTemplate,
                       antlr.collections.AST tree)
Method Detail

setSubtemplate

public void setSubtemplate(StringTemplate subtemplate)

addElseIfSubtemplate

public void addElseIfSubtemplate(ASTExpr conditionalTree,
                                 StringTemplate subtemplate)

getSubtemplate

public StringTemplate getSubtemplate()

getElseSubtemplate

public StringTemplate getElseSubtemplate()

setElseSubtemplate

public void setElseSubtemplate(StringTemplate elseSubtemplate)

write

public int write(StringTemplate self,
                 StringTemplateWriter out)
          throws java.io.IOException
To write out the value of a condition expr, invoke the evaluator in eval.g to walk the condition tree computing the boolean value. If result is true, then write subtemplate.

Overrides:
write in class ASTExpr
Throws:
java.io.IOException

writeSubTemplate

protected int writeSubTemplate(StringTemplate self,
                               StringTemplateWriter out,
                               StringTemplate subtemplate)
                        throws java.io.IOException
Throws:
java.io.IOException