org.tagnetic.core.jaxb.tagneticconfig.impl.runtime
Class ValidatingUnmarshaller

java.lang.Object
  extended byForkContentHandler
      extended byorg.tagnetic.core.jaxb.tagneticconfig.impl.runtime.ValidatingUnmarshaller
All Implemented Interfaces:
SAXUnmarshallerHandler

public class ValidatingUnmarshaller
extends ForkContentHandler
implements SAXUnmarshallerHandler

Filter implementation of SAXUnmarshallerHandler.

This component internally uses a VerifierFilter to validate SAX events that goes through this component. Discovered error information is just passed down to the next component.

This will enable the implementation to validate all sources of SAX events in the RI - XMLReader, DOMScanner SAX events will go the VerifierFilter and then to the SAXUnmarshaller...

See Also:
Serialized Form

Method Summary
static ValidatingUnmarshaller create(Grammar grammar, SAXUnmarshallerHandler _core, Locator locator)
          Creates a new instance of ValidatingUnmarshaller.
 java.lang.Object getResult()
           
 void handleEvent(ValidationEvent event, boolean canRecover)
          Reports an error to the user, and asks if s/he wants to recover.
 void startElement(java.lang.String nsUri, java.lang.String local, java.lang.String qname, org.xml.sax.Attributes atts)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static ValidatingUnmarshaller create(Grammar grammar,
                                            SAXUnmarshallerHandler _core,
                                            Locator locator)
Creates a new instance of ValidatingUnmarshaller.


getResult

public java.lang.Object getResult()
                           throws JAXBException,
                                  java.lang.IllegalStateException
Throws:
JAXBException
java.lang.IllegalStateException

handleEvent

public void handleEvent(ValidationEvent event,
                        boolean canRecover)
                 throws org.xml.sax.SAXException
Description copied from interface: SAXUnmarshallerHandler
Reports an error to the user, and asks if s/he wants to recover. If the canRecover flag is false, regardless of the client instruction, an exception will be thrown. Only if the flag is true and the user wants to recover from an error, the method returns normally. The thrown exception will be catched by the unmarshaller.

Specified by:
handleEvent in interface SAXUnmarshallerHandler
Throws:
org.xml.sax.SAXException

startElement

public void startElement(java.lang.String nsUri,
                         java.lang.String local,
                         java.lang.String qname,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException


Copyright © 2005 tagnetic.org. All Rights Reserved.