Package org.eclipse.birt.core.framework.parser

# Class XMLParserException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.xml.sax.SAXException
org.eclipse.birt.core.framework.parser.XMLParserException

All Implemented Interfaces:
  `Serializable`

public class XMLParserException extends SAXException
Reports a parse error. Describes errors as codes so that the error text can be localized.

See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`protected String`
`errorCode`
Detailed error description.
`protected ArrayList`
`errorList`
Additional exceptions, if any, associated with the error.
`static final String`
`EXCEPTION`
A generic exception occurred.
`static final String`
`INVALID_BOOLEAN`
A Boolean attribute does not contain a valid value.
`static final String`
`INVALID_INTEGER`
An integer attribute contains an invalid value.
`protected int`
`lineNo`
The line of the file on which the error occurred.
`static final String`
`SAX_ERROR`
SAX detected an error with the basic XML syntax of the file.
`protected SAXException`
`saxException`
The SAX exception, if any, associated with the error.
`protected String`
`tag`
The element that was in effect at the time of the error.
`static final String`
`UNKNOWN_TAG`
The XML file contains an unsupported element.
`static final String`
`WARNINGS_FOUND`
The parse completed, but recoverable errors occurred.

## Constructor Summary

Constructors
Constructor
Description
`XMLParserException(Exception e)`
Constructor.
`XMLParserException(Exception e, String errCode)`
Constructor.
`XMLParserException(String errCode)`
Constructor.
`XMLParserException(ArrayList errors)`
Constructor.
`XMLParserException(SAXException e)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`String`
`getErrorCode()`
Gets the error code associated with the exception.
`List`
`getErrorList()`
Returns the error list.
`int`
`getLineNumber()`
Gets the line number associated with the exception.
`String`
`getMessage()`
`String`
`getTag()`
Gets the element associated with the exception.
`void`
`setLineNumber(int n)`
Sets the line number associated with the exception.
`void`
`setTag(String theTag)`
Sets the element associated with the exception.

### Methods inherited from class org.xml.sax.SAXException

`getCause, getException, toString`

### Methods inherited from class java.lang.Throwable

`addSuppressed, fillInStackTrace, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### lineNo

protected int lineNo
The line of the file on which the error occurred.

### errorCode

protected String errorCode
Detailed error description.

### tag

protected String tag
The element that was in effect at the time of the error.

### saxException

protected SAXException saxException
The SAX exception, if any, associated with the error.

### errorList

protected ArrayList errorList
Additional exceptions, if any, associated with the error.

### UNKNOWN_TAG

public static final String UNKNOWN_TAG
The XML file contains an unsupported element.

See Also:
  - Constant Field Values

### SAX_ERROR

public static final String SAX_ERROR
SAX detected an error with the basic XML syntax of the file.

See Also:
  - Constant Field Values

### INVALID_BOOLEAN

public static final String INVALID_BOOLEAN
A Boolean attribute does not contain a valid value.

See Also:
  - Constant Field Values

### WARNINGS_FOUND

public static final String WARNINGS_FOUND
The parse completed, but recoverable errors occurred.

See Also:
  - Constant Field Values

### EXCEPTION

public static final String EXCEPTION
A generic exception occurred.

See Also:
  - Constant Field Values

### INVALID_INTEGER

public static final String INVALID_INTEGER
An integer attribute contains an invalid value.

See Also:
  - Constant Field Values

## Constructor Details

### XMLParserException

public XMLParserException(String errCode)
Constructor.

Parameters:
  `errCode` - the error code

### XMLParserException

public XMLParserException(SAXException e)
Constructor.

Parameters:
  `e` - a SAX exception

### XMLParserException

public XMLParserException(Exception e)
Constructor.

Parameters:
  `e` - a generic exception

### XMLParserException

public XMLParserException(Exception e, String errCode)
Constructor.

Parameters:
  `e` - generic exception
  `errCode` - error code that explains the exception

### XMLParserException

public XMLParserException(ArrayList errors)
Constructor.

Parameters:
  `errors` - list of errors

## Method Details

### setLineNumber

public void setLineNumber(int n)
Sets the line number associated with the exception.

Parameters:
  `n` - The line number to set.

### setTag

public void setTag(String theTag)
Sets the element associated with the exception.

Parameters:
  `theTag` - the element name to set.

### getErrorCode

public String getErrorCode()
Gets the error code associated with the exception.

Returns:
  the error code

### getTag

public String getTag()
Gets the element associated with the exception.

Returns:
  the element name

### getLineNumber

public int getLineNumber()
Gets the line number associated with the exception.

Returns:
  the line number

### getMessage

public String getMessage()

Overrides:
  `getMessage` in class `SAXException`

### getErrorList

public List getErrorList()
Returns the error list.

Returns:
  the error list