org.netbeans.modules.xml.xam.spi
Class XsdBasedValidator.Handler

java.lang.Object
  extended by org.netbeans.modules.xml.xam.spi.XsdBasedValidator.Handler
All Implemented Interfaces:
org.xml.sax.ErrorHandler
Enclosing class:
XsdBasedValidator

protected class XsdBasedValidator.Handler
extends java.lang.Object
implements org.xml.sax.ErrorHandler

Handler to receive parse events.


Constructor Summary
XsdBasedValidator.Handler(Model model)
          Constructor to create a SAX Error Handler.
 
Method Summary
 void addResultsFromHandlers(java.util.Collection<XsdBasedValidator.Handler> handlers)
          Adds resultItems from the handler collection to the resultItems of the current handler.
 void error(org.xml.sax.SAXParseException exception)
           
 void fatalError(org.xml.sax.SAXParseException exception)
           
 java.util.Collection<Validator.ResultItem> getResultItems()
          Return validation results.
 void logValidationErrors(Validator.ResultType resultType, org.xml.sax.SAXParseException sax)
           
 void logValidationErrors(Validator.ResultType resultType, java.lang.String errorDescription)
           
 void logValidationErrors(Validator.ResultType resultType, java.lang.String errorDescription, int lineNumber, int columnNumber)
           
 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

XsdBasedValidator.Handler

public XsdBasedValidator.Handler(Model model)
Constructor to create a SAX Error Handler.

Parameters:
model - Model which is being validated.
Method Detail

getResultItems

public java.util.Collection<Validator.ResultItem> getResultItems()
Return validation results.

Returns:
Return results.

addResultsFromHandlers

public void addResultsFromHandlers(java.util.Collection<XsdBasedValidator.Handler> handlers)
Adds resultItems from the handler collection to the resultItems of the current handler. One user of this will be the schema validator (which will use a handler instance for each model) and will pass in the list of handlers it has created.

Parameters:
handlers - Handlers from which resultItems have to be collected.

error

public void error(org.xml.sax.SAXParseException exception)
           throws org.xml.sax.SAXException
Specified by:
error in interface org.xml.sax.ErrorHandler
Parameters:
exception -
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
Parameters:
exception -
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
Parameters:
exception -
Throws:
org.xml.sax.SAXException

logValidationErrors

public void logValidationErrors(Validator.ResultType resultType,
                                org.xml.sax.SAXParseException sax)

logValidationErrors

public void logValidationErrors(Validator.ResultType resultType,
                                java.lang.String errorDescription,
                                int lineNumber,
                                int columnNumber)
Parameters:
resultType -
errorDescription -
lineNumber -
columnNumber -

logValidationErrors

public void logValidationErrors(Validator.ResultType resultType,
                                java.lang.String errorDescription)
Parameters:
resultType -
errorDescription -