Home | News | Wiki | About StringTemplate | Feedback | Support | Bugs


Latest version is 3.2.
Download now! »

Download
» Home
» Download
» News
»Using StringTemplate
» Documentation
» Wiki
» Articles
» File Sharing
» Code API
» Tech Support
»About StringTemplate
» What is it?
» Showcase
» Testimonials
» Software License
» Changes
»Feedback
»Credits
»Contact


Support StringTemplate, ANTLR Project by making a donation! Terence often pays for things like the antlr.org server, conference travel, and this site design (that alone cost US$1000). Buy him a beer and pizza remotely ;)

Search



ConditionalExpr


org.antlr.stringtemplate.language
Class ConditionalExpr

java.lang.Object
  extended byorg.antlr.stringtemplate.language.Expr
      extended byorg.antlr.stringtemplate.language.ASTExpr
          extended byorg.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
(package private)  java.util.List elseIfSubtemplates
           
(package private)  StringTemplate elseSubtemplate
           
(package private)  StringTemplate subtemplate
           
 
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, exprTree, formatString, MAP_KEY_VALUE, nullValue, options, separatorString, supportedOptions, wrapString
 
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
 
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
 

Field Detail

subtemplate

StringTemplate subtemplate

elseIfSubtemplates

java.util.List elseIfSubtemplates

elseSubtemplate

StringTemplate elseSubtemplate
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