Package org.jibx.runtime

Examples of org.jibx.runtime.IBindingFactory.createMarshallingContext()


            getTargetBindingName(), getTargetClass());

        MarshallingContext ctx = (MarshallingContext) iMarshallingContext;

        MarshallingContext delegateContext =
            (MarshallingContext) factory.createMarshallingContext();
        try {
            delegateContext.setFromContext(ctx);
        } catch(java.io.IOException e) {
            throw new JiBXException("Could not set from another context", e);
        }
View Full Code Here


    // javadoc inherited
    public void write(ReportingConfig config, OutputStream stream) {
        try {
            IBindingFactory bfact = BindingDirectory
                .getFactory(ReportingConfig.class);
            IMarshallingContext mctx = bfact.createMarshallingContext();
            mctx.setIndent(4, null, ' ');
            mctx.marshalDocument(config, "UTF-8", null, stream);
        } catch (JiBXException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

    private IMarshallingContext getMarshallingContext()
            throws JiBXException {
        IBindingFactory bfact =
                BindingDirectory.getFactory(RuntimeProjectConfiguration.class);

        IMarshallingContext uctx = bfact.createMarshallingContext();
        return uctx;
    }
}

/*
 
View Full Code Here

         */
        public void write(DatasourceConfiguration config, OutputStream stream) {
            try {
                IBindingFactory bfact = BindingDirectory
                    .getFactory(TestAnonymousMarshallerElement.class);
                IMarshallingContext mctx = bfact.createMarshallingContext();
                mctx.setIndent(4, null, ' ');
                mctx.marshalDocument(config, "UTF-8", null, stream);
            } catch (JiBXException e) {
                throw new RuntimeException(e);
            }
View Full Code Here

         */
        public void write(DatasourceConfiguration config, OutputStream stream) {
            try {
                IBindingFactory bfact = BindingDirectory
                    .getFactory(TestDefaultMarshallerElement.class);
                IMarshallingContext mctx = bfact.createMarshallingContext();
                mctx.setIndent(4, null, ' ');
                mctx.marshalDocument(config, "UTF-8", null, stream);
            } catch (JiBXException e) {
                throw new RuntimeException(e);
            }
View Full Code Here

    OutputStreamWriter out = null;
    try {
      ByteArrayOutputStream bout = new ByteArrayOutputStream(5000);
      out = new OutputStreamWriter(bout, options.getEncoding());
      IBindingFactory bf = BindingDirectory.getFactory(JibxBinding.class);
      IMarshallingContext mctx = bf.createMarshallingContext();
      mctx.setIndent(1, null, '\t');
      mctx.marshalDocument(root, options.getEncoding(), null, out);
      return bout.toByteArray();

    } finally {
View Full Code Here

    // javadoc inherited
    public void write(SendRequest sendRequest, OutputStream out) {
        try {
            IBindingFactory factory = BindingDirectory.getFactory(DefaultSendRequest.class);
            IMarshallingContext context = factory.createMarshallingContext();

            // @todo any indentation, etc?
            context.marshalDocument(sendRequest, "UTF-8", null, out);
        } catch (JiBXException e) {
            throw new RuntimeException(e);
View Full Code Here

    // javadoc inherited
    public void write(Failures failures, OutputStream out) {
        try {
            IBindingFactory factory = BindingDirectory.getFactory(DefaultFailures.class);
            IMarshallingContext context = factory.createMarshallingContext();

            // @todo any indentation, etc?
            context.marshalDocument(failures, "UTF-8", null, out);
        } catch (JiBXException e) {
            throw new RuntimeException(e);
View Full Code Here

    public void setSchema(Schema s) {
    }

    private IMarshallingContext getMarshallingContext(Object object) throws JiBXException {
        IBindingFactory factory = BindingDirectory.getFactory(object.getClass());
        return factory.createMarshallingContext();
    }
}
View Full Code Here

    @Override
    public void write(Writer writer) throws IOException {
        try {
            IBindingFactory jibxBFact = JibxRepresentation.getBindingFactory(
                    this.bindingName, this.bindingClass);
            IMarshallingContext mctx = jibxBFact.createMarshallingContext();
            mctx.setOutput(writer);
            ((IMarshallable) getObject()).marshal(mctx);
        } catch (JiBXException e) {
            throw new IOException(e.getMessage());
        }
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.