com.bbn.swede.core.dom
Class OASTException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended bycom.bbn.swede.core.dom.OASTException
All Implemented Interfaces:
Serializable

public class OASTException
extends Exception

Custom exception type for OAST errors.

Author:
jlerner
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.lang.Exception
 
Constructor Summary
OASTException(String sMessage, IOWLAbstractSyntaxTree tree)
          Constructs an exception that represents a problem that occurred during an OAST API call.
OASTException(String sMessage, OASTNode node)
          Constructs an exception that represents a problem that occurred during an OAST API call.
 
Method Summary
 OASTNode getNode()
          Retrieves the node that caused the exception.
 IOWLAbstractSyntaxTree getOAST()
          Retrieves the tree that caused the exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OASTException

public OASTException(String sMessage,
                     IOWLAbstractSyntaxTree tree)
Constructs an exception that represents a problem that occurred during an OAST API call. This version of the constructor should be used for general tree errors that do not involve a specific node, such as a read-only error or a locked for modifications error. The node returned by getNode() in the resulting exception object will be null.

Parameters:
sMessage - The detail message for the exception
tree - The tree that caused the error.

OASTException

public OASTException(String sMessage,
                     OASTNode node)

Constructs an exception that represents a problem that occurred during an OAST API call. This version of the constructor should be used for errors relating to a high-level API call on a specific node, such as attempting to insert a node in a parent that does not contain its starting offset.

The return value of node.getOWLAbstractSyntaxTree() is assumed to be the tree that caused the exception. If node is not attached to an OAST, getOAST() will return null for this exception.

Parameters:
sMessage - The detail message for the exception
node - The node that caused the error.
Method Detail

getOAST

public IOWLAbstractSyntaxTree getOAST()
Retrieves the tree that caused the exception. This may be null if the error occurred in a high-level API call on a node that is not attached to an OAST.

Returns:
The tree

getNode

public OASTNode getNode()
Retrieves the node that caused the exception. This may be null if the error was a general OAST error such as a read-only exception or a locked for modifications exception.

Returns:
The node


Copyright © 2004-2005 BBN Technologies. All Rights Reserved.