com.flagstone.transform.action
Class ExceptionHandler.Builder

java.lang.Object
  extended by com.flagstone.transform.action.ExceptionHandler.Builder
Enclosing class:
ExceptionHandler

public static final class ExceptionHandler.Builder
extends Object

The Builder class is used to generate a new ExceptionHandler object using a small set of convenience methods.


Constructor Summary
ExceptionHandler.Builder()
           
 
Method Summary
 ExceptionHandler.Builder addToCatch(Action action)
          Add an action to the catch block of the exception handler.
 ExceptionHandler.Builder addToFinal(Action action)
          Add an action to the final block of the exception handler.
 ExceptionHandler.Builder addToTry(Action action)
          Add an action to the try block of the exception handler.
 ExceptionHandler build()
          Generate an ExceptionHandler using the parameters defined in the Builder.
 ExceptionHandler.Builder setRegister(int index)
          Set the register where the thrown object will be stored.
 ExceptionHandler.Builder setVariable(String name)
          Set the name of the variable where thrown object will be assigned.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionHandler.Builder

public ExceptionHandler.Builder()
Method Detail

setRegister

public ExceptionHandler.Builder setRegister(int index)
Set the register where the thrown object will be stored.

Parameters:
index - the register number. Must be in the range 0..255.
Returns:
this object.

setVariable

public ExceptionHandler.Builder setVariable(String name)
Set the name of the variable where thrown object will be assigned.

Parameters:
name - the name of the actionsctipt variable.
Returns:
this object.

addToTry

public ExceptionHandler.Builder addToTry(Action action)
Add an action to the try block of the exception handler.

Parameters:
action - the action to the executed in the try block.
Returns:
this object.

addToCatch

public ExceptionHandler.Builder addToCatch(Action action)
Add an action to the catch block of the exception handler.

Parameters:
action - the action to the executed in the catch block.
Returns:
this object.

addToFinal

public ExceptionHandler.Builder addToFinal(Action action)
Add an action to the final block of the exception handler.

Parameters:
action - the action to the executed in the final block.
Returns:
this object.

build

public ExceptionHandler build()
Generate an ExceptionHandler using the parameters defined in the Builder.

Returns:
an initialized ExceptionHandler object.


Copyright © 2002-2010 Flagstone Software Ltd.. All Rights Reserved.