Top Description Inners Fields Constructors Methods
com.sun.org.apache.xerces.internal.util

public Class DOMErrorHandlerWrapper

extends Object
implements XMLErrorHandler, DOMErrorHandler
Class Inheritance
All Implemented Interfaces
org.w3c.dom.DOMErrorHandler, com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler
Imports
com.sun.org.apache.xerces.internal.dom.DOMErrorImpl, .DOMLocatorImpl, com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter, com.sun.org.apache.xerces.internal.xni.XNIException, com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler, .XMLParseException, java.io.PrintWriter, java.util.Collections, .HashMap, .Map, org.w3c.dom.DOMError, .DOMErrorHandler, .DOMLocator, .Node

This class handles DOM errors .
Author
Gopal Sharma, SUN Microsystems Inc.
See Also
DOMErrorHandler

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
DOMErrorHandlerWrapper.DOMErrorTypeMap

A convenience class for converting between internal error codes and DOM error types.

Field Summary

Modifier and TypeField and Description
pack-priv boolean
public Node
protected final DOMErrorImpl
protected DOMErrorHandler
protected final XMLErrorCode
fErrorCode

Error code for comparisons.

protected PrintWriter

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
error(String
The domain of the error. The domain can be any string but is suggested to be a valid URI. The domain can be used to conveniently specify a web site location of the relevent specification or document pertaining to this error.
domain
,
String
The error key. This key can be any string and is implementation dependent.
key
,
XMLParseException
Exception.
exception
)

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler.error.

Reports an error.

public void
fatalError(String
The domain of the fatal error. The domain can be any string but is suggested to be a valid URI. The domain can be used to conveniently specify a web site location of the relevent specification or document pertaining to this fatal error.
domain
,
String
The fatal error key. This key can be any string and is implementation dependent.
key
,
XMLParseException
Exception.
exception
)

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler.fatalError.

Report a fatal error.

public DOMErrorHandler
public boolean
handleError(DOMError
The error object that describes the error. This object may be reused by the DOM implementation across multiple calls to the handleError method.
error
)

Implements org.w3c.dom.DOMErrorHandler.handleError.

This method is called on the error handler when an error occurs.

private void
printError(DOMError error)

Prints the error message.

public void
setErrorHandler(DOMErrorHandler errorHandler)

Sets the DOM error handler.

public void
warning(String
The domain of the warning. The domain can be any string but is suggested to be a valid URI. The domain can be used to conveniently specify a web site location of the relevent specification or document pertaining to this warning.
domain
,
String
The warning key. This key can be any string and is implementation dependent.
key
,
XMLParseException
Exception.
exception
)

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler.warning.

Reports a warning.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

eStatusback to summary
pack-priv boolean eStatus
fCurrentNodeback to summary
public Node fCurrentNode
fDOMErrorback to summary
protected final DOMErrorImpl fDOMError
fDomErrorHandlerback to summary
protected DOMErrorHandler fDomErrorHandler
fErrorCodeback to summary
protected final XMLErrorCode fErrorCode

Error code for comparisons.

fOutback to summary
protected PrintWriter fOut

Constructor Detail

DOMErrorHandlerWrapperback to summary
public DOMErrorHandlerWrapper()
DOMErrorHandlerWrapperback to summary
public DOMErrorHandlerWrapper(DOMErrorHandler domErrorHandler)

Method Detail

errorback to summary
public void error(String domain, String key, XMLParseException exception) throws XNIException

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler.error.

Reports an error. Errors are non-fatal and usually signify that the document is invalid with respect to its grammar(s).

Parameters
domain:String

The domain of the error. The domain can be any string but is suggested to be a valid URI. The domain can be used to conveniently specify a web site location of the relevent specification or document pertaining to this error.

key:String

The error key. This key can be any string and is implementation dependent.

exception:XMLParseException

Exception.

Exceptions
XNIException:
Thrown to signal that the parser should stop parsing the document.
fatalErrorback to summary
public void fatalError(String domain, String key, XMLParseException exception) throws XNIException

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler.fatalError.

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.

Parameters
domain:String

The domain of the fatal error. The domain can be any string but is suggested to be a valid URI. The domain can be used to conveniently specify a web site location of the relevent specification or document pertaining to this fatal error.

key:String

The fatal error key. This key can be any string and is implementation dependent.

exception:XMLParseException

Exception.

Exceptions
XNIException:
Thrown to signal that the parser should stop parsing the document.
getErrorHandlerback to summary
public DOMErrorHandler getErrorHandler()
handleErrorback to summary
public boolean handleError(DOMError error)

Implements org.w3c.dom.DOMErrorHandler.handleError.

Doc from org.w3c.dom.DOMErrorHandler.handleError.

This method is called on the error handler when an error occurs.
If an exception is thrown from this method, it is considered to be equivalent of returning true.

Parameters
error:DOMError

The error object that describes the error. This object may be reused by the DOM implementation across multiple calls to the handleError method.

Returns:boolean

If the handleError method returns false, the DOM implementation should stop the current processing when possible. If the method returns true, the processing may continue depending on DOMError.severity.

printErrorback to summary
private void printError(DOMError error)

Prints the error message.

setErrorHandlerback to summary
public void setErrorHandler(DOMErrorHandler errorHandler)

Sets the DOM error handler.

warningback to summary
public void warning(String domain, String key, XMLParseException exception) throws XNIException

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler.warning.

Reports a warning. Warnings are non-fatal and can be safely ignored by most applications.

Parameters
domain:String

The domain of the warning. The domain can be any string but is suggested to be a valid URI. The domain can be used to conveniently specify a web site location of the relevent specification or document pertaining to this warning.

key:String

The warning key. This key can be any string and is implementation dependent.

exception:XMLParseException

Exception.

Exceptions
XNIException:
Thrown to signal that the parser should stop parsing the document.
com.sun.org.apache.xerces.internal.util back to summary

private Class DOMErrorHandlerWrapper.DOMErrorTypeMap

extends Object
Class Inheritance
  • java.lang.Object
  • com.sun.org.apache.xerces.internal.util.DOMErrorHandlerWrapper.DOMErrorTypeMap

A convenience class for converting between internal error codes and DOM error types.

Field Summary

Modifier and TypeField and Description
private static final Map<XMLErrorCode, String>
fgDOMErrorTypeTable

Map for converting internal error codes to DOM error types.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fgDOMErrorTypeTableback to summary
private static final Map<XMLErrorCode, String> fgDOMErrorTypeTable

Map for converting internal error codes to DOM error types.

Constructor Detail

DOMErrorTypeMapback to summary
private DOMErrorTypeMap()

Method Detail

getDOMErrorTypeback to summary
public static String getDOMErrorType(XMLErrorCode error)