com.go.tea.parsetree
Class ExceptionGuardStatement

java.lang.Object
  |
  +--com.go.tea.parsetree.Node
        |
        +--com.go.tea.parsetree.Statement
              |
              +--com.go.tea.parsetree.ExceptionGuardStatement
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class ExceptionGuardStatement
extends Statement

A statement that catches instances of Exception, calls ThreadGroup.uncaughtException, and moves on. This statement is inserted by a TypeChecker, and does not appear directly in Tea templates.

Version:
4 , 01/05/31
Author:
Brian S O'Neill
See Also:
Serialized Form

Constructor Summary
ExceptionGuardStatement(SourceInfo info, Statement guarded, Statement replacement)
           
ExceptionGuardStatement(Statement guarded, Statement replacement)
           
 
Method Summary
 java.lang.Object accept(NodeVisitor visitor)
          Every subclass of Node must override this method with the following: return visitor.visit(this).
 java.lang.Object clone()
          Returns a clone of this Node and all its children.
 Statement getGuarded()
          May return null if removed.
 Statement getReplacement()
          May return null since this is optional.
 boolean isBreak()
          Returns true if Statement 'breaks' during its execution.
 boolean isReturn()
          Returns true if Statement definitely returns from its method either from a return statement or a throw statement.
 void setGuarded(Statement guarded)
           
 void setReplacement(Statement replacement)
           
 
Methods inherited from class com.go.tea.parsetree.Node
getSourceInfo, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExceptionGuardStatement

public ExceptionGuardStatement(Statement guarded,
                               Statement replacement)
Parameters:
guarded - Statement to guard.
replacement - Optional Statement to execute in catch handler.

ExceptionGuardStatement

public ExceptionGuardStatement(SourceInfo info,
                               Statement guarded,
                               Statement replacement)
Parameters:
guarded - Statement to guard.
replacement - Optional Statement to execute in catch handler.
Method Detail

accept

public java.lang.Object accept(NodeVisitor visitor)
Description copied from class: Node
Every subclass of Node must override this method with the following: return visitor.visit(this).
Overrides:
accept in class Statement
Following copied from class: com.go.tea.parsetree.Node
Parameters:
visitor - A visitor of this Node
Returns:
Node The Node returned by the visitor
See Also:
NodeVisitor

clone

public java.lang.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

isReturn

public boolean isReturn()
Description copied from class: Statement
Returns true if Statement definitely returns from its method either from a return statement or a throw statement.
Overrides:
isReturn in class Statement

isBreak

public boolean isBreak()
Description copied from class: Statement
Returns true if Statement 'breaks' during its execution.
Overrides:
isBreak in class Statement

getGuarded

public Statement getGuarded()
May return null if removed.

getReplacement

public Statement getReplacement()
May return null since this is optional.

setGuarded

public void setGuarded(Statement guarded)

setReplacement

public void setReplacement(Statement replacement)