FileDocCategorySizeDatePackage
XPointerErrorHandler.javaAPI DocApache Xerces 3.0.13540Fri Sep 14 20:33:52 BST 2007org.apache.xerces.xpointer

XPointerErrorHandler

public class XPointerErrorHandler extends Object implements org.apache.xerces.xni.parser.XMLErrorHandler
The Default XPointer error handler used by the XInclude implementation. XPointer error's are thrown so that they may be caught by the XInclude implementation and reported as resource errors.
version
$Id: XPointerErrorHandler.java 447248 2006-09-18 05:25:21Z mrglavas $

Fields Summary
protected PrintWriter
fOut
Print writer.
Constructors Summary
public XPointerErrorHandler()
Constructs an error handler that prints error messages to System.err.

        this(new PrintWriter(System.err));
    
public XPointerErrorHandler(PrintWriter out)
Constructs an error handler that prints error messages to the specified PrintWriter

        fOut = out;
    
Methods Summary
public voiderror(java.lang.String domain, java.lang.String key, org.apache.xerces.xni.parser.XMLParseException ex)
Error.

        printError("Error", ex);
        //throw ex; 
    
public voidfatalError(java.lang.String domain, java.lang.String key, org.apache.xerces.xni.parser.XMLParseException ex)
Fatal error.

        printError("Fatal Error", ex);
        throw ex;
    
private voidprintError(java.lang.String type, org.apache.xerces.xni.parser.XMLParseException ex)
Prints the error message.


        fOut.print("[");
        fOut.print(type);
        fOut.print("] ");
        String systemId = ex.getExpandedSystemId();
        if (systemId != null) {
            int index = systemId.lastIndexOf('/");
            if (index != -1)
                systemId = systemId.substring(index + 1);
            fOut.print(systemId);
        }
        fOut.print(':");
        fOut.print(ex.getLineNumber());
        fOut.print(':");
        fOut.print(ex.getColumnNumber());
        fOut.print(": ");
        fOut.print(ex.getMessage());
        fOut.println();
        fOut.flush();

    
public voidwarning(java.lang.String domain, java.lang.String key, org.apache.xerces.xni.parser.XMLParseException ex)
Warning.

        printError("Warning", ex);