Methods Summary |
---|
protected static org.xml.sax.SAXParseException | createSAXParseException(com.sun.org.apache.xerces.internal.xni.parser.XMLParseException exception)Creates a SAXParseException from an XMLParseException.
return new SAXParseException(exception.getMessage(),
exception.getPublicId(),
exception.getExpandedSystemId(),
exception.getLineNumber(),
exception.getColumnNumber(),
exception.getException());
|
protected static com.sun.org.apache.xerces.internal.xni.parser.XMLParseException | createXMLParseException(org.xml.sax.SAXParseException exception)Creates an XMLParseException from a SAXParseException.
final String fPublicId = exception.getPublicId();
final String fExpandedSystemId = exception.getSystemId();
final int fLineNumber = exception.getLineNumber();
final int fColumnNumber = exception.getColumnNumber();
XMLLocator location = new XMLLocator() {
public String getPublicId() { return fPublicId; }
public String getExpandedSystemId() { return fExpandedSystemId; }
public String getBaseSystemId() { return null; }
public String getLiteralSystemId() { return null; }
public int getColumnNumber() { return fColumnNumber; }
public int getLineNumber() { return fLineNumber; }
public int getCharacterOffset() { return -1; }
public String getEncoding() { return null; }
public String getXMLVersion() { return null; }
};
return new XMLParseException(location, exception.getMessage(),exception);
|
protected static com.sun.org.apache.xerces.internal.xni.XNIException | createXNIException(org.xml.sax.SAXException exception)Creates an XNIException from a SAXException.
NOTE: care should be taken *not* to call this with a SAXParseException; this will
lose information!!!
return new XNIException(exception.getMessage(),exception);
|
public void | error(java.lang.String domain, java.lang.String key, com.sun.org.apache.xerces.internal.xni.parser.XMLParseException exception)Reports an error. Errors are non-fatal and usually signify that the
document is invalid with respect to its grammar(s).
if (fErrorHandler != null) {
SAXParseException saxException = createSAXParseException(exception);
try {
fErrorHandler.error(saxException);
}
catch (SAXParseException e) {
throw createXMLParseException(e);
}
catch (SAXException e) {
throw createXNIException(e);
}
}
|
public void | fatalError(java.lang.String domain, java.lang.String key, com.sun.org.apache.xerces.internal.xni.parser.XMLParseException exception)Report a fatal error. Fatal errors usually occur when the document
is not well-formed and signifies that the parser cannot continue
normal operation.
Note: The error handler should always
throw an XNIException from this method. This exception
can either be the same exception that is passed as a parameter to
the method or a new XNI exception object. If the registered error
handler fails to throw an exception, the continuing operation of
the parser is undetermined.
if (fErrorHandler != null) {
SAXParseException saxException = createSAXParseException(exception);
try {
fErrorHandler.fatalError(saxException);
}
catch (SAXParseException e) {
throw createXMLParseException(e);
}
catch (SAXException e) {
throw createXNIException(e);
}
}
|
public org.xml.sax.ErrorHandler | getErrorHandler()Returns the SAX error handler.
return fErrorHandler;
|
public void | setErrorHandler(org.xml.sax.ErrorHandler errorHandler)Sets the SAX error handler.
fErrorHandler = errorHandler;
|
public void | warning(java.lang.String domain, java.lang.String key, com.sun.org.apache.xerces.internal.xni.parser.XMLParseException exception)Reports a warning. Warnings are non-fatal and can be safely ignored
by most applications.
if (fErrorHandler != null) {
SAXParseException saxException = createSAXParseException(exception);
try {
fErrorHandler.warning(saxException);
}
catch (SAXParseException e) {
throw createXMLParseException(e);
}
catch (SAXException e) {
throw createXNIException(e);
}
}
|