Package org.jibx.runtime

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


         JDBCConfigurationPersister persiter = new JDBCConfigurationPersister();
         persiter.init(props);

         IBindingFactory bfact = BindingDirectory.getFactory(RepositoryServiceConfiguration.class);
         IMarshallingContext mctx = bfact.createMarshallingContext();
         OutputStream saveStream = new ByteArrayOutputStream();
         mctx.marshalDocument(repositoryService.getConfig(), "ISO-8859-1", null, saveStream);
         saveStream.close();

         persiter.write(new ByteArrayInputStream(((ByteArrayOutputStream)saveStream).toByteArray()));
View Full Code Here


        this.setBindingName(bindingName);
    }

    public void marshal(Exchange exchange, Object body, OutputStream stream) throws Exception {
        IBindingFactory bindingFactory = createBindingFactory(body.getClass(), bindingName);
        IMarshallingContext marshallingContext = bindingFactory.createMarshallingContext();
        marshallingContext.marshalDocument(body, null, null, stream);
    }

    public Object unmarshal(Exchange exchange, InputStream stream) throws Exception {
        ObjectHelper.notNull(getUnmarshallClass(), "unmarshallClass");
View Full Code Here

               throw new RepositoryException("Can't back up configuration on path " + sourceConfig.getAbsolutePath());
            saveStream = new FileOutputStream(sourceConfig);
         }

         IBindingFactory bfact = BindingDirectory.getFactory(RepositoryServiceConfiguration.class);
         IMarshallingContext mctx = bfact.createMarshallingContext();

         mctx.marshalDocument(this, "ISO-8859-1", null, saveStream);
         saveStream.close();

         // writing configuration in to the persister
View Full Code Here

            else
            {
               throw new RuntimeException(cause);
            }
         }
         IMarshallingContext mctx = bfact.createMarshallingContext();
     
         mctx.marshalDocument(newRepositoryServiceConfiguration, "ISO-8859-1", null, saveStream);
         saveStream.close();
     
         writer.writeStartElement("original-repository-config");
View Full Code Here

                                         final File file)
      throws JiBXException, IOException {
      final Writer writer = new FileWriter(file);
      final IBindingFactory factory =
         BindingDirectory.getFactory(Controller.class);
      final IMarshallingContext context = factory.createMarshallingContext();
      context.setIndent(INDENT);
      context.setOutput(writer);
      context.marshalDocument(controller, ENCODING, null);
   }
View Full Code Here

   public static void marshallService(final Service service, final File file)
      throws JiBXException, IOException {
      final Writer writer = new FileWriter(file);
      final IBindingFactory factory =
         BindingDirectory.getFactory(Service.class);
      final IMarshallingContext context = factory.createMarshallingContext();
      context.setIndent(INDENT);
      context.setOutput(writer);
      context.marshalDocument(service, ENCODING, null);
   }
View Full Code Here

   public static void marshallServices(final Services services, final File file)
      throws JiBXException, IOException {
      final Writer writer = new FileWriter(file);
      final IBindingFactory factory =
         BindingDirectory.getFactory(Services.class);
      final IMarshallingContext context = factory.createMarshallingContext();
      context.setIndent(INDENT);
      context.setOutput(writer);
      context.marshalDocument(services, ENCODING, null);
   }
View Full Code Here

            else
            {
               throw new RuntimeException(cause);
            }
         }
         IMarshallingContext mctx = bfact.createMarshallingContext();

         mctx.marshalDocument(newRepositoryServiceConfiguration, "ISO-8859-1", null, saveStream);
         saveStream.close();

         writer.writeStartElement("original-workspace-config");
View Full Code Here

            else
            {
               throw new RuntimeException(cause);
            }
         }
         IMarshallingContext mctx = bfact.createMarshallingContext();
     
         mctx.marshalDocument(newRepositoryServiceConfiguration, "ISO-8859-1", null, saveStream);
         saveStream.close();
     
         writer.writeStartElement("original-repository-config");
View Full Code Here

   {
      StringWriter sw = new StringWriter();
      try
      {
         IBindingFactory bfact = BindingDirectory.getFactory(RepositoryServiceConfiguration.class);
         IMarshallingContext mctx = bfact.createMarshallingContext();
         mctx.setIndent(2);
         mctx.marshalDocument(this, "UTF-8", null, sw);
      }
      catch (JiBXException e)
      {
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.