Package org.jibx.runtime

Examples of org.jibx.runtime.IUnmarshallingContext


            throws JiBXException {

        IBindingFactory identificationBindingFactory =
                BindingDirectory.getFactory(aClass);

        IUnmarshallingContext unmarshallingContext =
                identificationBindingFactory.createUnmarshallingContext();

        Object unmarshalled = unmarshallingContext.unmarshalDocument(reader,
                null);
        return unmarshalled;
    }
View Full Code Here


        // validate XML
        SAX_BUILDER.build(new StringReader(input));

        // unmarshal XML
        final IBindingFactory bfact = BindingDirectory.getFactory(expectedClass);
        final IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
        return uctx.unmarshalDocument(new StringReader(input));
    }
View Full Code Here

    // javadoc inherited
    public ReportingConfig parse(InputStream inputStream) {
        try {
            IBindingFactory bfact = BindingDirectory.getFactory(
                ReportingConfig.class);
            IUnmarshallingContext uctx = bfact.createUnmarshallingContext();

            return (ReportingConfig) uctx.unmarshalDocument(inputStream, null);
        } catch (JiBXException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

         */
        public TestAnonymousMarshallerElement parse(InputStream inputStream) {
            try {
                IBindingFactory bfact = BindingDirectory
                        .getFactory(TestAnonymousMarshallerElement.class);
                IUnmarshallingContext uctx = bfact.createUnmarshallingContext();

                return (TestAnonymousMarshallerElement) uctx.unmarshalDocument(
                        inputStream, null);
            } catch (JiBXException e) {
                throw new RuntimeException(e);
            }
        }
View Full Code Here

         */
        public TestDefaultMarshallerElement parse(InputStream inputStream) {
            try {
                IBindingFactory bfact = BindingDirectory
                        .getFactory(TestDefaultMarshallerElement.class);
                IUnmarshallingContext uctx = bfact.createUnmarshallingContext();

                return (TestDefaultMarshallerElement) uctx.unmarshalDocument(
                        inputStream, null);
            } catch (JiBXException e) {
                throw new RuntimeException(e);
            }
        }
View Full Code Here

            throws JiBXException, IOException {

        Object readObject = null;

        IBindingFactory bfact = BindingDirectory.getFactory(expectedClass);
        IUnmarshallingContext uctx = bfact.createUnmarshallingContext();

        ContentStyle contentStyle = content.getContentStyle();
        if (contentStyle == ContentStyle.BINARY) {
            readObject = uctx.unmarshalDocument(content.getInputStream(), name,
                    null); // null encoding means auto-detect
        } else if (contentStyle == ContentStyle.TEXT) {
            readObject = uctx.unmarshalDocument(content.getReader(), name);
        } else {
            throw new IllegalStateException("No content available.");
        }

        return readObject;
View Full Code Here

    }
  }
 
  public Object unmarshall(InputStream in, String encoding) {
    try {
      IUnmarshallingContext unmctx = bindingFactory.createUnmarshallingContext();
      return unmctx.unmarshalDocument(in, encoding);
    }
    catch(JiBXException ex) {
      throw new JibxAccessException(ex.getMessage(), ex);
    }
    finally {
View Full Code Here

    // javadoc inherited
    public SendRequest readSendRequest(InputStream in) {
        try {
            IBindingFactory factory = BindingDirectory.getFactory(DefaultSendRequest.class);
            IUnmarshallingContext context = factory.createUnmarshallingContext();
            return (SendRequest) context.unmarshalDocument(in, null);

        } catch (JiBXException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

    // javadoc inherited
    public Failures readFailures(InputStream in) {
        try {
            IBindingFactory factory = BindingDirectory.getFactory(DefaultFailures.class);
            IUnmarshallingContext context = factory.createUnmarshallingContext();
            return (Failures) context.unmarshalDocument(in, null);

        } catch (JiBXException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

    public T getObject() throws JiBXException, IOException {
        if ((this.object == null) && (this.xmlRepresentation != null)) {
            // Try to unmarshal the wrapped XML representation
            IBindingFactory jibxBFact = JibxRepresentation.getBindingFactory(
                    this.bindingName, this.bindingClass);
            IUnmarshallingContext uctx = jibxBFact.createUnmarshallingContext();
            return (T) uctx.unmarshalDocument(
                    this.xmlRepresentation.getStream(), null);
        }

        return this.object;
    }
View Full Code Here

TOP

Related Classes of org.jibx.runtime.IUnmarshallingContext

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.