FileDocCategorySizeDatePackage
DefaultValidationErrorHandler.javaAPI DocApache Xerces 3.0.12336Fri Sep 14 20:33:52 BST 2007org.apache.xerces.jaxp

DefaultValidationErrorHandler

public class DefaultValidationErrorHandler extends DefaultHandler
version
$Id: DefaultValidationErrorHandler.java 447237 2006-09-18 05:03:10Z mrglavas $

Fields Summary
private static int
ERROR_COUNT_LIMIT
private int
errorCount
Constructors Summary
Methods Summary
public voiderror(org.xml.sax.SAXParseException e)


    // XXX Fix message i18n
          
        if (errorCount >= ERROR_COUNT_LIMIT) {
            // Ignore all errors after reaching the limit
            return;
        } else if (errorCount == 0) {
            // Print a warning before the first error
            System.err.println("Warning: validation was turned on but an org.xml.sax.ErrorHandler was not");
            System.err.println("set, which is probably not what is desired.  Parser will use a default");
            System.err.println("ErrorHandler to print the first " +
                               ERROR_COUNT_LIMIT +               " errors.  Please call");
            System.err.println("the 'setErrorHandler' method to fix this.");
        }

        String systemId = e.getSystemId();
        if (systemId == null) {
            systemId = "null";
        }
        String message = "Error: URI=" + systemId +
            " Line=" + e.getLineNumber() +
            ": " + e.getMessage();
        System.err.println(message);
        errorCount++;