Package org.jibx.runtime

Examples of org.jibx.runtime.IUnmarshallingContext.unmarshalDocument()


            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


        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.");
View Full Code Here

        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

        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

     */
    private Container toContainer(final String xml) throws Exception {
        ByteArrayInputStream is = new ByteArrayInputStream(xml.getBytes());
        IBindingFactory bfact = BindingDirectory.getFactory(Container.class);
        IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
        return (Container) uctx.unmarshalDocument(is, null);
    }

    /**
     * Get windowId of <code>UIPortlet</code>
     *
 
View Full Code Here

  @Override
  protected Object unmarshalInputStream(InputStream inputStream) throws XmlMappingException, IOException {
    try {
      IUnmarshallingContext unmarshallingContext = createUnmarshallingContext();
      return unmarshallingContext.unmarshalDocument(inputStream, null);
    }
    catch (JiBXException ex) {
      throw convertJibxException(ex, false);
    }
  }
View Full Code Here

  @Override
  protected Object unmarshalReader(Reader reader) throws XmlMappingException, IOException {
    try {
      IUnmarshallingContext unmarshallingContext = createUnmarshallingContext();
      return unmarshallingContext.unmarshalDocument(reader);
    }
    catch (JiBXException ex) {
      throw convertJibxException(ex, false);
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.