Package org.bifrost.xmlio.impl

Examples of org.bifrost.xmlio.impl.ReaderContentHandler


    {

      SAXParserFactory factory = SAXParserFactory.newInstance();
      factory.setValidating(true);
      factory.setNamespaceAware(true);
      ReaderContentHandler handler = new ReaderContentHandler(targetPackage);

      try
      {
        SAXParser parser = factory.newSAXParser();
        parser.parse(inputStream, handler);
      }
      catch (ParserConfigurationException pce)
      {
        try
        {
          factory.setValidating(false);
          factory.setNamespaceAware(false);
          SAXParser parser = factory.newSAXParser();
          parser.parse(inputStream, handler);
        }
        catch(Exception e)
        {
          throw new XmlException(EX_PARSING + e.toString());
        }
      }
      catch (SAXException se)
      {
        if (se.getException() instanceof XmlException)
          throw (XmlException)(se.getException());
        throw new XmlException(EX_PARSING + se.toString());
      }
      catch (IOException ioe) {
        throw new XmlException(EX_PARSING + ioe.toString());
      }
      rootObject = handler.getResult();
      handler = null;
      result = true;
    } // end try to read xml
    finally
    {
View Full Code Here

TOP

Related Classes of org.bifrost.xmlio.impl.ReaderContentHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.