Hilbert II - Version 0.03.01

org.qedeq.kernel.xml.parser
Class SyntaxException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byorg.qedeq.kernel.xml.parser.SyntaxException
All Implemented Interfaces:
Serializable

public final class SyntaxException
extends Exception

Exception that occurs during XML parsing. It specifies an syntactical error. It can also mark a lack of inner consistence of something.

Version:
$Revision: 1.6 $
See Also:
Serialized Form

Field Summary
static int MISSING_ATTRIBUTE_CODE
          Error code for unexpected character data.
static String MISSING_ATTRIBUTE_TEXT_1
          Missing attribute text.
static String MISSING_ATTRIBUTE_TEXT_2
          Missing attribute, part two.
static int SAX_PARSER_EXCEPTION
          Error code for Exceptions thrown by the SAXParser.
static int UNEXPECTED_DATA_CODE
          Error code for unexpected character data.
static String UNEXPECTED_DATA_TEXT
          Unexpected tag message text, part one.
static int UNEXPECTED_TAG_CODE
          Error code for unexpected tag.
static String UNEXPECTED_TAG_TEXT
          Unexpected tag message text.
 
Constructor Summary
SyntaxException(int code, String message)
          Constructor.
SyntaxException(SAXParseException e, URL url)
          Constructor.
 
Method Summary
static SyntaxException createMissingAttributeException(String name, String attribute)
          Create exception for missing attribute within a tag.
static SyntaxException createUnexpectedTagException(String name)
          Create exception for unexpected tag.
static SyntaxException createUnexpectedTextDataException(String name, String value)
          Create exception for unexpected text data within a tag.
 int getErrorCode()
          Get error code.
 SourcePosition getErrorPosition()
          Get error position.
 void setErrorPosition(SourcePosition position)
          Set error position.
 
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

SAX_PARSER_EXCEPTION

public static final int SAX_PARSER_EXCEPTION
Error code for Exceptions thrown by the SAXParser.

See Also:
Constant Field Values

UNEXPECTED_TAG_CODE

public static final int UNEXPECTED_TAG_CODE
Error code for unexpected tag.

See Also:
Constant Field Values

UNEXPECTED_TAG_TEXT

public static final String UNEXPECTED_TAG_TEXT
Unexpected tag message text.

See Also:
Constant Field Values

UNEXPECTED_DATA_CODE

public static final int UNEXPECTED_DATA_CODE
Error code for unexpected character data.

See Also:
Constant Field Values

UNEXPECTED_DATA_TEXT

public static final String UNEXPECTED_DATA_TEXT
Unexpected tag message text, part one.

See Also:
Constant Field Values

MISSING_ATTRIBUTE_CODE

public static final int MISSING_ATTRIBUTE_CODE
Error code for unexpected character data.

See Also:
Constant Field Values

MISSING_ATTRIBUTE_TEXT_1

public static final String MISSING_ATTRIBUTE_TEXT_1
Missing attribute text.

See Also:
Constant Field Values

MISSING_ATTRIBUTE_TEXT_2

public static final String MISSING_ATTRIBUTE_TEXT_2
Missing attribute, part two.

See Also:
Constant Field Values
Constructor Detail

SyntaxException

public SyntaxException(SAXParseException e,
                       URL url)
Constructor.

Parameters:
e - Exception thrown by the SAXParser.
url - Parsed file.

SyntaxException

public SyntaxException(int code,
                       String message)
Constructor.

Parameters:
code - Error code.
message - Error message.
Method Detail

getErrorCode

public final int getErrorCode()
Get error code.

Returns:
Error code.

getErrorPosition

public final SourcePosition getErrorPosition()
Get error position.

Returns:
Error position.

setErrorPosition

public final void setErrorPosition(SourcePosition position)
Set error position.

Parameters:
position - Error position.

createUnexpectedTagException

public static final SyntaxException createUnexpectedTagException(String name)
Create exception for unexpected tag.

Parameters:
name - Tag name.
Returns:
Exception.

createUnexpectedTextDataException

public static final SyntaxException createUnexpectedTextDataException(String name,
                                                                      String value)
Create exception for unexpected text data within a tag.

Parameters:
name - Tag name.
value - Data found.
Returns:
Exception.

createMissingAttributeException

public static final SyntaxException createMissingAttributeException(String name,
                                                                    String attribute)
Create exception for missing attribute within a tag.

Parameters:
name - Tag name.
attribute - Attribute name.
Returns:
Exception.

Hilbert II - Version 0.03.01

©left GNU General Public Licence
All Rights Reserved.