net.scheinerman.phoenix.interpreter.exceptions
Class SyntaxException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by net.scheinerman.phoenix.interpreter.exceptions.PhoenixRuntimeException
                  extended by net.scheinerman.phoenix.interpreter.exceptions.SyntaxException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
IllegalArgumentException, IllegalIdentifierException, UnknownFunctionException

public class SyntaxException
extends PhoenixRuntimeException

This is the root of all syntax based exceptions that can be thrown during Phoenix program execution. Any program that has a syntax error in its code should throw an instance of this class or any of its subclasses. This class allows for alternate messages to be passed in via the constructor. Thus, depending on the instance that this exception is thrown, a different message might be displayed in the output.

Since:
1.5
Version:
1.0
Author:
Jonah Scheinerman
See Also:
PhoenixRuntimeException}, Serialized Form

Field Summary
protected  java.lang.String briefMessage
          "Generic syntax error"
private static long serialVersionUID
           
 
Constructor Summary
SyntaxException()
          Creates a new SyntaxException with the default brief message "Generic syntax error."
SyntaxException(java.lang.String briefMessage)
          Creates a new SyntaxException with a user defined brief message.
 
Method Summary
 java.lang.String getBriefMessage()
          This returns the brief message for this exception.
 java.lang.String getErrorType()
          This returns the error type for this exception which is always, "Syntax error".
 
Methods inherited from class net.scheinerman.phoenix.interpreter.exceptions.PhoenixRuntimeException
getLastLine, isLastLineSet, printErrorMessage, setLastLine, setLastLineSet
 
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
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

briefMessage

protected java.lang.String briefMessage
"Generic syntax error"

Constructor Detail

SyntaxException

public SyntaxException()
Creates a new SyntaxException with the default brief message "Generic syntax error."


SyntaxException

public SyntaxException(java.lang.String briefMessage)
Creates a new SyntaxException with a user defined brief message.

Parameters:
briefMessage - - What should be returned by a call to getBriefMessage().
Method Detail

getErrorType

public java.lang.String getErrorType()
This returns the error type for this exception which is always, "Syntax error".

Overrides:
getErrorType in class PhoenixRuntimeException
Returns:
"Syntax error"

getBriefMessage

public java.lang.String getBriefMessage()
This returns the brief message for this exception. If no message was passed to the constructor, the result is the default phrase "Generic syntax error"

Overrides:
getBriefMessage in class PhoenixRuntimeException
Returns:
The user defined brief message or, if none, "Generic syntax error"