FileDocCategorySizeDatePackage
DefaultValidationErrorHandler.javaAPI DocJava SE 6 API2131Tue Jun 10 00:22:48 BST 2008com.sun.org.apache.xerces.internal.jaxp

DefaultValidationErrorHandler

public class DefaultValidationErrorHandler extends DefaultHandler
version
$Id: DefaultValidationErrorHandler.java,v 1.2.6.1 2005/09/05 09:37:36 sunithareddy Exp $

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++;