Data Request Broker
2-3-release

fr.gael.drb.query
Class StaticException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by fr.gael.drb.query.StaticException
All Implemented Interfaces:
Serializable

public class StaticException
extends RuntimeException

Static exception of an XQuery static analysis phase.

A static error is an error that must be detected during the analysis phase. A syntax error is an example of a static error.

In addition to the detailed error message, this exception provides the co-oordinates of the static error in the original script: begin to end lines or column where the static occurred.

See Also:
Serialized Form

Constructor Summary
protected StaticException(fr.gael.drb.query.ParseException exception)
          Builds a static exception from a parse exception of the token manager.
protected StaticException(String message, fr.gael.drb.query.Token token)
          Builds a static exception with a message.
 
Method Summary
 int getBeginColumn()
          Returns the column number where the static error has started.
 int getBeginLine()
          Returns the line number where the static error has stared.
 String getDetailedMessage()
          Returns a detailed exception message.
 int getEndColumn()
          Returns the column number where the static error has ended.
 int getEndLine()
          Returns the line number where the static error has ended.
 String getMessage()
          Returns a short exception message.
protected  fr.gael.drb.query.ParseException getParseException()
          Accessor of the encapsulated parse exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

StaticException

protected StaticException(String message,
                          fr.gael.drb.query.Token token)
Builds a static exception with a message.

Parameters:
message - the exception message should fit in the sentence " at line l, column c.". It shall therefore be a single line message whith no trailing sign or symbol (e.g. no trailing point, comma or question mark).
token - token involved in the error or null detected outside parsing.

StaticException

protected StaticException(fr.gael.drb.query.ParseException exception)
Builds a static exception from a parse exception of the token manager.

Parameters:
exception - the originated parse exception.
Method Detail

getParseException

protected fr.gael.drb.query.ParseException getParseException()
Accessor of the encapsulated parse exception.

Returns:
the parse exception.

getBeginLine

public int getBeginLine()
Returns the line number where the static error has stared.

Returns:
line the error started or -1 if not available.

getEndLine

public int getEndLine()
Returns the line number where the static error has ended.

Returns:
line the error ended or -1 if not available.

getBeginColumn

public int getBeginColumn()
Returns the column number where the static error has started.

Returns:
column the error started or -1 if not available.

getEndColumn

public int getEndColumn()
Returns the column number where the static error has ended.

Returns:
line the error ended or -1 if not available.

getMessage

public String getMessage()
Returns a short exception message. An example of output message would be:
 Static error at line 1, column 26.
 XQ0053 - The URI of namespace prefix "ns" cannot be a zero-length string.
 
It is a committment that the output message ends with a trailing ".".

Overrides:
getMessage in class Throwable
Returns:
the exception message.

getDetailedMessage

public String getDetailedMessage()
Returns a detailed exception message. When the static error is a syntax error raised by the token manager, the detailed exception message reports the list of expected token in lieu of the encoutered one.

Returns:
the exception message.

Data Request Broker - DRB API®
2-3-release

Copyright© 2001-2009 GAEL Consultant. All rights reserved. Use is subject to license terms .