1 64 65 package com.jcorporate.expresso.core.misc; 66 67 import org.xml.sax.ErrorHandler ; 68 import org.xml.sax.SAXException ; 69 import org.xml.sax.SAXParseException ; 70 71 import java.util.Vector ; 72 73 74 public class ConfigErrorHandler 75 implements ErrorHandler { 76 private Vector warnings = new Vector (); 77 private Vector errors = new Vector (); 78 private boolean anyErrors = false; 79 private SAXParseException fatalException = null; 80 81 public boolean anyErrorsOrWarnings() { 82 return anyErrors; 83 } 84 85 public SAXParseException getFatalException() { 86 return fatalException; 87 } 88 89 public Vector getWarnings() { 90 return warnings; 91 } 92 93 public Vector getErrors() { 94 return errors; 95 } 96 97 117 public void warning(SAXParseException exception) 118 throws SAXException { 119 anyErrors = true; 120 warnings.addElement(exception); 121 } 122 123 148 public void error(SAXParseException exception) 149 throws SAXException { 150 anyErrors = true; 151 errors.addElement(exception); 152 } 153 154 174 public void fatalError(SAXParseException exception) 175 throws SAXException { 176 fatalException = exception; 177 anyErrors = true; 178 } 179 } | Popular Tags |