org.basex.query
Class QueryException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.basex.query.QueryException
All Implemented Interfaces:
java.io.Serializable

public final class QueryException
extends java.lang.Exception

This class indicates exceptions during the parsing or evaluation of a query.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen
See Also:
Serialized Form

Constructor Summary
QueryException(InputInfo ii, Err er, java.lang.Object... ext)
          Default constructor.
QueryException(InputInfo ii, QNm errc, java.lang.String msg, java.lang.Object... ext)
          Constructor, specifying the error code and message as string.
QueryException(java.lang.String msg)
          Constructor, specifying a simple error message.
QueryException(java.lang.Throwable th)
          Constructor, specifying an exception or error.
 
Method Summary
 void add(InputInfo ii)
          Adds an input info to the stack.
 int col()
          Returns the error column.
 Err err()
          Returns the error.
 QueryException err(Err e)
          Sets an error.
 java.lang.String file()
          Returns the file.
 java.lang.String getLocalizedMessage()
           
 java.lang.String getMessage()
           
 InputInfo info()
          Returns the input info.
 QueryException info(InputInfo ii)
          Sets input info.
 boolean isCatchable()
          Checks if this exception can be caught by a try/catch expression.
 int line()
          Returns the error line.
 int markedCol()
          Returns the marked error column.
 QueryException notCatchable()
          Makes this exception uncatchable by a try/catch expression.
 QNm qname()
          Returns the error name.
 StringList suggest()
          Returns suggestions for code suggestions.
 QueryException suggest(InputParser qp, StringList sug)
          Sets code suggestions.
 Value value()
          Returns the error value.
 QueryException value(Value v)
          Sets the error value.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, 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

QueryException

public QueryException(java.lang.Throwable th)
Constructor, specifying an exception or error. Err.BASX_GENERIC will be set as error code.

Parameters:
th - exception or error

QueryException

public QueryException(java.lang.String msg)
Constructor, specifying a simple error message. Err.BASX_GENERIC will be set as error code.

Parameters:
msg - error message

QueryException

public QueryException(InputInfo ii,
                      Err er,
                      java.lang.Object... ext)
Default constructor.

Parameters:
ii - input info
er - error reference
ext - error extension

QueryException

public QueryException(InputInfo ii,
                      QNm errc,
                      java.lang.String msg,
                      java.lang.Object... ext)
Constructor, specifying the error code and message as string.

Parameters:
ii - input info
errc - error code
msg - error message
ext - error extension
Method Detail

col

public int col()
Returns the error column.

Returns:
error column

markedCol

public int markedCol()
Returns the marked error column.

Returns:
marked error column

line

public int line()
Returns the error line.

Returns:
error line

file

public java.lang.String file()
Returns the file.

Returns:
error line

suggest

public StringList suggest()
Returns suggestions for code suggestions.

Returns:
suggestions

suggest

public QueryException suggest(InputParser qp,
                              StringList sug)
Sets code suggestions.

Parameters:
qp - query parser
sug - code suggestions
Returns:
self reference

add

public void add(InputInfo ii)
Adds an input info to the stack.

Parameters:
ii - input info

info

public QueryException info(InputInfo ii)
Sets input info.

Parameters:
ii - input info
Returns:
self reference

info

public InputInfo info()
Returns the input info.

Returns:
input info

value

public QueryException value(Value v)
Sets the error value.

Parameters:
v - error value
Returns:
self reference

err

public QueryException err(Err e)
Sets an error.

Parameters:
e - error
Returns:
self reference

qname

public QNm qname()
Returns the error name.

Returns:
error name

err

public Err err()
Returns the error.

Returns:
error

value

public Value value()
Returns the error value.

Returns:
error value

getLocalizedMessage

public java.lang.String getLocalizedMessage()
Overrides:
getLocalizedMessage in class java.lang.Throwable

getMessage

public java.lang.String getMessage()
Overrides:
getMessage in class java.lang.Throwable

isCatchable

public boolean isCatchable()
Checks if this exception can be caught by a try/catch expression.

Returns:
result of check

notCatchable

public QueryException notCatchable()
Makes this exception uncatchable by a try/catch expression.

Returns:
self reference for convenience