koala.dynamicjava.tree
Class AssertStatement

java.lang.Object
  extended by koala.dynamicjava.tree.Node
      extended by koala.dynamicjava.tree.Statement
          extended by koala.dynamicjava.tree.AssertStatement
All Implemented Interfaces:
SourceInfo.Wrapper

public class AssertStatement
extends Statement

This class represents the assert statement nodes of the syntax tree


Constructor Summary
AssertStatement(Expression cond, Expression falseString)
          Creates a new assert statement
AssertStatement(Expression cond, Expression falseString, SourceInfo si)
          Creates a new assert statement
 
Method Summary
<T> T
acceptVisitor(Visitor<T> visitor)
          Allows a visitor to traverse the tree
 Expression getCondition()
          Gets the condition to assert
 Expression getFailString()
          Gets the failed string to display when assertion fails
 void setCondition(Expression e)
          Sets the condition to evaluate
 void setFailString(Expression e)
          Sets the string to display on failure
 String toString()
          Implementation of toString for use in unit testing
 
Methods inherited from class koala.dynamicjava.tree.Node
archiveProperties, getProperties, getProperty, getSourceInfo, hasProperty, setProperty, setSourceInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AssertStatement

public AssertStatement(Expression cond,
                       Expression falseString)
Creates a new assert statement

Throws:
IllegalArgumentException - if cond is null or falseString is null

AssertStatement

public AssertStatement(Expression cond,
                       Expression falseString,
                       SourceInfo si)
Creates a new assert statement

Throws:
IllegalArgumentException - if cond is null or falseString is null
Method Detail

getCondition

public Expression getCondition()
Gets the condition to assert


getFailString

public Expression getFailString()
Gets the failed string to display when assertion fails


setCondition

public void setCondition(Expression e)
Sets the condition to evaluate

Throws:
IllegalArgumentException - if e is null

setFailString

public void setFailString(Expression e)
Sets the string to display on failure


acceptVisitor

public <T> T acceptVisitor(Visitor<T> visitor)
Allows a visitor to traverse the tree

Specified by:
acceptVisitor in class Node
Parameters:
visitor - the visitor to accept

toString

public String toString()
Implementation of toString for use in unit testing

Overrides:
toString in class Object