org.wsmo.wsml
Class ParserException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.wsmo.wsml.ParserException
All Implemented Interfaces:
Serializable

public class ParserException
extends Exception

This is a checked exception thrown when the stream being parsed contains syntax errors or is invalid w.r.t. the predefined grammar

Version:
$Revision: 1156 $ $Date: 2005-10-17 17:57:00 +0300 (Mon, 17 Oct 2005) $
Author:
not attributable
See Also:
Serialized Form

Field Summary
static String ANONYMOUS_ID_AS_ATOM
           
static String FUNCTION_SYMBOL_AS_ATOM
           
static String NAMESPACE_PREFIX_NOT_FOUND
           
static String NB_ANONYMOUS_ID_AS_ATOM
           
static String NO_NAMESPACE
           
static String NOT_VALID_PARSETREE
           
static String VALUE_AS_ATOM
           
static String VARIABLE_AS_ATOM
           
static String WRONG_ARG_SIMPLE_DT
           
 
Constructor Summary
ParserException(String msg, Throwable cause)
          Creates a Parser Exception indicating a problem found when processing an InputStream.
 
Method Summary
 int getErrorLine()
          Indicates the line where the parsing error occured.
 int getErrorPos()
          inicates the position where the parsing error occured.
 String getExpectedToken()
          Indicates which token was expecting when parsing error occured
 String getFoundToken()
          returns the token that was expected.
 String getMessage()
          Returns human readable description of error.
 void setErrorLine(int line)
          Sets the line where the error occured.
 void setErrorPos(int pos)
          sets the position (column) where the error occured.
 void setExpectedToken(String token)
          sets the token that was expected when parsing error occured.
 void setFoundToken(String token)
          set the token that was found during parsing.
 
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
 

Field Detail

NO_NAMESPACE

public static final String NO_NAMESPACE
See Also:
Constant Field Values

NAMESPACE_PREFIX_NOT_FOUND

public static final String NAMESPACE_PREFIX_NOT_FOUND
See Also:
Constant Field Values

NOT_VALID_PARSETREE

public static final String NOT_VALID_PARSETREE
See Also:
Constant Field Values

ANONYMOUS_ID_AS_ATOM

public static final String ANONYMOUS_ID_AS_ATOM
See Also:
Constant Field Values

NB_ANONYMOUS_ID_AS_ATOM

public static final String NB_ANONYMOUS_ID_AS_ATOM
See Also:
Constant Field Values

VALUE_AS_ATOM

public static final String VALUE_AS_ATOM
See Also:
Constant Field Values

FUNCTION_SYMBOL_AS_ATOM

public static final String FUNCTION_SYMBOL_AS_ATOM
See Also:
Constant Field Values

VARIABLE_AS_ATOM

public static final String VARIABLE_AS_ATOM
See Also:
Constant Field Values

WRONG_ARG_SIMPLE_DT

public static final String WRONG_ARG_SIMPLE_DT
See Also:
Constant Field Values
Constructor Detail

ParserException

public ParserException(String msg,
                       Throwable cause)
Creates a Parser Exception indicating a problem found when processing an InputStream.

Parameters:
msg - message indicating the error that occured. Note that this class appends some exta information (if given) like the line and position of the error when "getMessage()" is called.
cause - the initial cause of the error. In case the problem is caused by the underlying parser (e.g. sableCC it will contain this Exception
Method Detail

getErrorLine

public int getErrorLine()
Indicates the line where the parsing error occured.

Returns:
line with parsing error or -1 if not known.

setErrorLine

public void setErrorLine(int line)
Sets the line where the error occured.

Parameters:
line - where the error occured.

getErrorPos

public int getErrorPos()
inicates the position where the parsing error occured.

Returns:
position where parsing error occured or -1 if not known.

setErrorPos

public void setErrorPos(int pos)
sets the position (column) where the error occured.

Parameters:
pos - of error.

getFoundToken

public String getFoundToken()
returns the token that was expected.

Returns:
the token that was expected or null if not known.

setFoundToken

public void setFoundToken(String token)
set the token that was found during parsing.

Parameters:
token - the token that was found during parsing.

getExpectedToken

public String getExpectedToken()
Indicates which token was expecting when parsing error occured

Returns:
list of token (comma sperated) that are expecting at the position with parsing error, null if not known.

setExpectedToken

public void setExpectedToken(String token)
sets the token that was expected when parsing error occured.

Parameters:
token - the toke that was expected when parsing error occured.

getMessage

public String getMessage()
Returns human readable description of error.

Overrides:
getMessage in class Throwable
Returns:
message indicating the error that occured. Note that this class appends some exta information (if given) like the line and position of the error when "getMessage()" is called.
See Also:
Throwable.getMessage()


Copyright © 2004-2008 Ontotext Lab.. All Rights Reserved.