pl.psnc.dl.ege.validator
Class StandardErrorHandler

java.lang.Object
  extended by pl.psnc.dl.ege.validator.StandardErrorHandler
All Implemented Interfaces:
org.xml.sax.ErrorHandler

public class StandardErrorHandler
extends java.lang.Object
implements org.xml.sax.ErrorHandler

Catches errors received during XML validation process of SAX parser.
Each object contains one ValidationResult instance - where all received notifications are stored. Depending on received errors status of validation result is changed.
After validation, validation result instance can be retrieved in order to read status and contained messages.

Author:
mariuszs

Constructor Summary
StandardErrorHandler()
          Constructs error handler with validation result of SUCCESS status.
StandardErrorHandler(ValidationResult valResult)
          Constructs error handler with specified validation result instance.
 
Method Summary
 void error(org.xml.sax.SAXParseException exception)
           
 void fatalError(org.xml.sax.SAXParseException exception)
           
 ValidationResult getValidationResult()
          Returns contained validation result instance.
 void warning(org.xml.sax.SAXParseException exception)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardErrorHandler

public StandardErrorHandler()
Constructs error handler with validation result of SUCCESS status.


StandardErrorHandler

public StandardErrorHandler(ValidationResult valResult)
Constructs error handler with specified validation result instance. If referenced valResult parameter is 'null' a default instance is created.

Parameters:
valResult -
Method Detail

error

public void error(org.xml.sax.SAXParseException exception)
           throws org.xml.sax.SAXException
Specified by:
error in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException

fatalError

public void fatalError(org.xml.sax.SAXParseException exception)
                throws org.xml.sax.SAXException
Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException

warning

public void warning(org.xml.sax.SAXParseException exception)
             throws org.xml.sax.SAXException
Specified by:
warning in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException

getValidationResult

public ValidationResult getValidationResult()
Returns contained validation result instance.

Returns:


Copyright © 2010. All Rights Reserved.