Package org.exolab.castor.xml

Examples of org.exolab.castor.xml.UnmarshalHandler$ElementInfo


                                                                 .openStream()));

        Unmarshaller unmarshaller = new Unmarshaller(ExtendedGrammar.class);
        unmarshaller.setMapping(mapping);

        UnmarshalHandler unmarshalHandler = unmarshaller.createHandler();
        SourceUtil.toSAX(this.manager, this.grammarSource, null,
                         Unmarshaller.getContentHandler(unmarshalHandler));

        ExtendedGrammar grammar = (ExtendedGrammar)unmarshalHandler.getObject();

        if (grammar==null)
          throw new ProcessingException("Error while reading the grammar from "+src);

        setExtendedGrammar(grammar);
View Full Code Here


  @Override
  protected final Object unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource)
      throws XmlMappingException, IOException {

    UnmarshalHandler unmarshalHandler = createUnmarshaller().createHandler();
    try {
      ContentHandler contentHandler = Unmarshaller.getContentHandler(unmarshalHandler);
      xmlReader.setContentHandler(contentHandler);
      xmlReader.parse(inputSource);
      return unmarshalHandler.getObject();
    }
    catch (SAXException ex) {
      throw new UnmarshallingFailureException("SAX reader exception", ex);
    }
  }
View Full Code Here

                                                                 .openStream()));

        Unmarshaller unmarshaller = new Unmarshaller(ExtendedGrammar.class);
        unmarshaller.setMapping(mapping);

        UnmarshalHandler unmarshalHandler = unmarshaller.createHandler();
        SourceUtil.toSAX(this.manager, this.grammarSource, null,
                         Unmarshaller.getContentHandler(unmarshalHandler));

        ExtendedGrammar grammar = (ExtendedGrammar)unmarshalHandler.getObject();

        if (grammar==null)
          throw new ProcessingException("Error while reading the grammar from "+src);

        setExtendedGrammar(grammar);
View Full Code Here

     */
    public org.apache.axiom.om.OMElement getStockQuote(org.apache.axiom.om.OMElement param0) {
        StAXSource staxSource =
                new StAXSource(param0.getXMLStreamReader());
        Unmarshaller unmarshaller = new Unmarshaller(GetStockQuote.class);
        UnmarshalHandler unmarshalHandler = unmarshaller.createHandler();
        GetStockQuote stockQuote;
        try {
            ContentHandler contentHandler = Unmarshaller.getContentHandler(unmarshalHandler);
            TransformerFactory.newInstance().newTransformer().transform(staxSource, new SAXResult(contentHandler));
            stockQuote = (GetStockQuote) unmarshalHandler.getObject();
        } catch (SAXException e) {
            throw new RuntimeException(e);
        } catch (TransformerException e) {
            throw new RuntimeException(e);
        }
View Full Code Here


        StAXSource staxSource =
                new StAXSource(response.getXMLStreamReader());
        Unmarshaller unmarshaller = new Unmarshaller(GetStockQuoteResponse.class);
        UnmarshalHandler unmarshalHandler = unmarshaller.createHandler();
        GetStockQuoteResponse stockQuoteResponse;
        try {
            ContentHandler contentHandler = Unmarshaller.getContentHandler(unmarshalHandler);
            TransformerFactory.newInstance().newTransformer().transform(staxSource, new SAXResult(contentHandler));
            stockQuoteResponse = (GetStockQuoteResponse) unmarshalHandler.getObject();
        } catch (SAXException e) {
            throw new RuntimeException(e);
        } catch (TransformerException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

     */
    public org.apache.axiom.om.OMElement getStockQuote(org.apache.axiom.om.OMElement param0) throws AxisFault {
        StAXSource staxSource =
                new StAXSource(param0.getXMLStreamReader());
        Unmarshaller unmarshaller = new Unmarshaller(GetStockQuote.class);
        UnmarshalHandler unmarshalHandler = unmarshaller.createHandler();
        GetStockQuote stockQuote;
        try {
            ContentHandler contentHandler = Unmarshaller.getContentHandler(unmarshalHandler);
            TransformerFactory.newInstance().newTransformer().transform(staxSource, new SAXResult(contentHandler));
            stockQuote = (GetStockQuote) unmarshalHandler.getObject();
        } catch (SAXException e) {
            throw new RuntimeException(e);
        } catch (TransformerException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

    }

    parameters = database.getDatabaseChoice().getDataSource().getParam();
   
    Unmarshaller unmarshaller = new Unmarshaller(dataSource);
    UnmarshalHandler handler = unmarshaller.createHandler();
   
    try {
      handler.startDocument();
      handler.startElement("data-source", null);

      for (int i = 0; i < parameters.length; i++) {
         param = (Param) parameters[i];
         handler.startElement(param.getName(), null);
         handler.characters(param.getValue().toCharArray(), 0, param.getValue().length());
         handler.endElement(param.getName());
      }

      handler.endElement("data-source");
      handler.endDocument();
    } catch (SAXException e) {
      _log.error ("Unable to parse <data-source> element.", e);
      throw new MappingException ("Unable to parse <data-source> element.", e);
    }
   
View Full Code Here

     */
    public org.apache.axiom.om.OMElement getStockQuote(org.apache.axiom.om.OMElement param0) {
        StAXSource staxSource =
                new StAXSource(param0.getXMLStreamReader());
        Unmarshaller unmarshaller = new Unmarshaller(GetStockQuote.class);
        UnmarshalHandler unmarshalHandler = unmarshaller.createHandler();
        GetStockQuote stockQuote;
        try {
            ContentHandler contentHandler = Unmarshaller.getContentHandler(unmarshalHandler);
            TransformerFactory.newInstance().newTransformer().transform(staxSource, new SAXResult(contentHandler));
            stockQuote = (GetStockQuote) unmarshalHandler.getObject();
        } catch (SAXException e) {
            throw new RuntimeException(e);
        } catch (TransformerException e) {
            throw new RuntimeException(e);
        }
View Full Code Here


        StAXSource staxSource =
                new StAXSource(response.getXMLStreamReader());
        Unmarshaller unmarshaller = new Unmarshaller(GetStockQuoteResponse.class);
        UnmarshalHandler unmarshalHandler = unmarshaller.createHandler();
        GetStockQuoteResponse stockQuoteResponse;
        try {
            ContentHandler contentHandler = Unmarshaller.getContentHandler(unmarshalHandler);
            TransformerFactory.newInstance().newTransformer().transform(staxSource, new SAXResult(contentHandler));
            stockQuoteResponse = (GetStockQuoteResponse) unmarshalHandler.getObject();
        } catch (SAXException e) {
            throw new RuntimeException(e);
        } catch (TransformerException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

                                                                 .openStream()));

        Unmarshaller unmarshaller = new Unmarshaller(ExtendedGrammar.class);
        unmarshaller.setMapping(mapping);

        UnmarshalHandler unmarshalHandler = unmarshaller.createHandler();
        SourceUtil.toSAX(this.manager, this.grammarSource, null,
                         Unmarshaller.getContentHandler(unmarshalHandler));

        ExtendedGrammar grammar = (ExtendedGrammar)unmarshalHandler.getObject();

        if (grammar==null)
          throw new ProcessingException("Error while reading the grammar from "+src);

        setExtendedGrammar(grammar);
View Full Code Here

TOP

Related Classes of org.exolab.castor.xml.UnmarshalHandler$ElementInfo

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.