org.teatrove.tea.parsetree
Class Template

java.lang.Object
  extended by org.teatrove.tea.parsetree.Node
      extended by org.teatrove.tea.parsetree.Template
All Implemented Interfaces:
Serializable, Cloneable, Returnable

public class Template
extends Node
implements Returnable

Template is the main container node for Tea templates.

Author:
Brian S O'Neill
See Also:
Serialized Form

Constructor Summary
Template()
           
Template(SourceInfo info, Name name, Variable[] params, boolean subParam, Statement statement, List<Directive> directiveList)
           
 
Method Summary
 Object accept(NodeVisitor visitor)
          Every subclass of Node must override this method with the following: return visitor.visit(this).
 Object clone()
          Returns a clone of this Node and all its children.
 List<Directive> getDirectives()
           
 Name getName()
           
 Variable[] getParams()
           
 Object getProperty(String propertyName)
           
 Type getReturnType()
          The return type is set by a type checker.
 Statement getStatement()
          Will likely return a StatementList or Block in order to hold many statements.
 boolean hasSubstitutionParam()
           
 void setName(Name name)
           
 void setParams(Variable[] params)
           
 void setProperty(String propertyName, Object value)
           
 void setReturnType(Type type)
           
 void setStatement(Statement stmt)
           
 
Methods inherited from class org.teatrove.tea.parsetree.Node
getSourceInfo, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Template

public Template()

Template

public Template(SourceInfo info,
                Name name,
                Variable[] params,
                boolean subParam,
                Statement statement,
                List<Directive> directiveList)
Method Detail

accept

public Object accept(NodeVisitor visitor)
Description copied from class: Node
Every subclass of Node must override this method with the following: return visitor.visit(this).

Specified by:
accept in class Node
Parameters:
visitor - A visitor of this Node
Returns:
Node The Node returned by the visitor
See Also:
NodeVisitor

clone

public Object clone()
Description copied from class: Node
Returns a clone of this Node and all its children. Immutable child objects are not necessarily cloned

Overrides:
clone in class Node

getName

public Name getName()

setName

public void setName(Name name)

getParams

public Variable[] getParams()

setParams

public void setParams(Variable[] params)

getProperty

public Object getProperty(String propertyName)

setProperty

public void setProperty(String propertyName,
                        Object value)

hasSubstitutionParam

public boolean hasSubstitutionParam()

getStatement

public Statement getStatement()
Will likely return a StatementList or Block in order to hold many statements.

See Also:
StatementList, Block

setStatement

public void setStatement(Statement stmt)

getDirectives

public List<Directive> getDirectives()

getReturnType

public Type getReturnType()
The return type is set by a type checker. Returns null if this template returns void, which is the default value.

Specified by:
getReturnType in interface Returnable

setReturnType

public void setReturnType(Type type)
Specified by:
setReturnType in interface Returnable


Copyright © 1997-2012 TeaTrove.org. All Rights Reserved.