|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.flagstone.transform.action.ExceptionHandler
public final class ExceptionHandler
The ExceptionHandler class is used to represent try..catch blocks in Actionscript.
When an exception is thrown, the object can be assigned to either one of the Flash Player's 256 internal registers or to a variable in memory.
The ExceptionHandler class contains three lists of actions supporting the standard syntax for an exception with try, catch and finally blocks. Both the catch and finally blocks are optional when defining an exception, the corresponding arguments in constructors and methods may be set to empty.
| Nested Class Summary | |
|---|---|
static class |
ExceptionHandler.Builder
The Builder class is used to generate a new ExceptionHandler object using a small set of convenience methods. |
| Constructor Summary | |
|---|---|
ExceptionHandler(ExceptionHandler.Builder builder)
Creates and initialises an ExceptionHandler using parameters defined in the Builder. |
|
ExceptionHandler(ExceptionHandler object)
Creates and initialises an ExceptionHandler action using the values copied from another ExceptionHandler. |
|
ExceptionHandler(int index,
List<Action> tryArray,
List<Action> catchArray,
List<Action> finallyArray)
Constructs a new exception handler with the thrown object assigned to one of the Flash Player's internal registers. |
|
ExceptionHandler(String name,
List<Action> tryArray,
List<Action> catchArray,
List<Action> finallyArray)
Creates a new exception handler with the thrown object assigned to a local variable. |
|
ExceptionHandler(SWFDecoder coder,
Context context)
Creates and initialises an ExceptionHandler action using values encoded in the Flash binary format. |
|
| Method Summary | |
|---|---|
ExceptionHandler |
copy()
Creates a complete copy of this object. |
void |
encode(SWFEncoder coder,
Context context)
Encode an object to the Flash binary format. |
List<Action> |
getCatchActions()
Returns the list of actions executed in the catch block. |
List<Action> |
getFinalActions()
Returns the list of actions executed in the finally block. |
int |
getRegister()
Returns the index of the register that the exception object is assigned to. |
List<Action> |
getTryActions()
Returns the list of actions executed in the try block. |
String |
getVariable()
Returns the name of the variable which the exception object is assigned to. |
int |
prepareToEncode(Context context)
Prepare an object for encoding, returning the expected size of an object when it is encoded. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ExceptionHandler(ExceptionHandler.Builder builder)
builder - a Builder object containing the parameters to generate
the ExceptionHandler.
public ExceptionHandler(SWFDecoder coder,
Context context)
throws IOException
coder - an SWFDecoder object that contains the encoded Flash data.context - a Context object used to manage the decoders for different
type of object and to pass information on how objects are
decoded.
IOException - if an error occurs while decoding the data.
public ExceptionHandler(String name,
List<Action> tryArray,
List<Action> catchArray,
List<Action> finallyArray)
name - the name of the variable that the thrown object will be
assigned to. Must not be null.tryArray - actions that will be executed in the try block of the
exception. Must not be null.catchArray - actions that will be executed in the catch block of the
exception, if one is defined. This may be empty if no
catch block is required - the exception will be handled by
another catch block higher in the exception tree.finallyArray - actions that will be executed in the finally block of the
exception, if one is defined. This may be empty if no
finally block is required.
public ExceptionHandler(int index,
List<Action> tryArray,
List<Action> catchArray,
List<Action> finallyArray)
index - the number of the register that the thrown object will be
assigned to. Must be in the range 0..255.tryArray - actions that will be executed in the try block of the
exception. Must not be null.catchArray - actions that will be executed in the catch block of the
exception, if one is defined. This may be empty if no
catch block is required - the exception will be handled by
another catch block higher in the exception tree.finallyArray - actions that will be executed in the finally block of the
exception, if one is defined. This may be empty is no
finally block is required.public ExceptionHandler(ExceptionHandler object)
object - an ExceptionHandler object from which the values will be
copied. References to immutable objects will be shared.| Method Detail |
|---|
public String getVariable()
public int getRegister()
public List<Action> getTryActions()
public List<Action> getCatchActions()
public List<Action> getFinalActions()
public ExceptionHandler copy()
copy in interface Copyable<Action>public String toString()
toString in class Objectpublic int prepareToEncode(Context context)
prepareToEncode in interface SWFEncodeablecontext - an Context that allows information to be passed between
objects to control how they are initialised for encoding.
public void encode(SWFEncoder coder,
Context context)
throws IOException
encode in interface SWFEncodeablecoder - an SWFEncoder object.context - an Context that allows information to be passed between
objects to control how they are initialised for encoding.
IOException - if an error occurs while encoding the object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||