< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/ErrorHandlerAdaptor.java

Print this page




  14  *
  15  * Unless required by applicable law or agreed to in writing, software
  16  * distributed under the License is distributed on an "AS IS" BASIS,
  17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18  * See the License for the specific language governing permissions and
  19  * limitations under the License.
  20  */
  21 
  22 package com.sun.org.apache.xerces.internal.jaxp.validation;
  23 
  24 import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
  25 import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException;
  26 import org.xml.sax.ErrorHandler;
  27 import org.xml.sax.SAXException;
  28 
  29 /**
  30  * Receives errors through Xerces {@link XMLErrorHandler}
  31  * and pass them down to SAX {@link ErrorHandler}.
  32  *
  33  * @author
  34  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
  35  */
  36 public abstract class ErrorHandlerAdaptor implements XMLErrorHandler
  37 {
  38     /** set to true if there was any error. */
  39     private boolean hadError = false;
  40 
  41     /**
  42      * returns if there was an error since the last invocation of
  43      * the resetError method.
  44      */
  45     public boolean hadError() { return hadError; }
  46     /** resets the error flag. */
  47     public void reset() { hadError = false; }
  48 
  49     /**
  50      * Implemented by the derived class to return the actual
  51      * {@link ErrorHandler} to which errors are sent.
  52      *
  53      * @return always return non-null valid object.
  54      */




  14  *
  15  * Unless required by applicable law or agreed to in writing, software
  16  * distributed under the License is distributed on an "AS IS" BASIS,
  17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18  * See the License for the specific language governing permissions and
  19  * limitations under the License.
  20  */
  21 
  22 package com.sun.org.apache.xerces.internal.jaxp.validation;
  23 
  24 import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
  25 import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException;
  26 import org.xml.sax.ErrorHandler;
  27 import org.xml.sax.SAXException;
  28 
  29 /**
  30  * Receives errors through Xerces {@link XMLErrorHandler}
  31  * and pass them down to SAX {@link ErrorHandler}.
  32  *
  33  * @author
  34  *     Kohsuke Kawaguchi
  35  */
  36 public abstract class ErrorHandlerAdaptor implements XMLErrorHandler
  37 {
  38     /** set to true if there was any error. */
  39     private boolean hadError = false;
  40 
  41     /**
  42      * returns if there was an error since the last invocation of
  43      * the resetError method.
  44      */
  45     public boolean hadError() { return hadError; }
  46     /** resets the error flag. */
  47     public void reset() { hadError = false; }
  48 
  49     /**
  50      * Implemented by the derived class to return the actual
  51      * {@link ErrorHandler} to which errors are sent.
  52      *
  53      * @return always return non-null valid object.
  54      */


< prev index next >