Examples of IMarshallingContext


Examples of org.jibx.runtime.IMarshallingContext

   public void toXML(Writer w)
   {
      try
      {
         IBindingFactory bfact = BindingDirectory.getFactory(Configuration.class);
         IMarshallingContext mctx = bfact.createMarshallingContext();
         mctx.setIndent(2);
         mctx.marshalDocument(this, "UTF-8", null, w);
      }
      catch (Exception e)
      {
         LOG.warn("Couldn't dump the runtime configuration in XML Format", e);
      }
View Full Code Here

Examples of org.jibx.runtime.IMarshallingContext

   }

   public byte[] toByteArray(String encoding) throws Exception
   {
      IBindingFactory bfact = XMLObject.getBindingFactoryInPriviledgedMode(XMLObject.class);
      IMarshallingContext mctx = bfact.createMarshallingContext();
      mctx.setIndent(2);
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      mctx.marshalDocument(this, encoding, null, os);
      return os.toByteArray();
   }
View Full Code Here

Examples of org.jibx.runtime.IMarshallingContext

   }

   public byte[] toByteArray(String encoding) throws Exception
   {
      IBindingFactory bfact = getBindingFactoryInPriviledgedMode(XMLObject.class);
      IMarshallingContext mctx = bfact.createMarshallingContext();
      mctx.setIndent(2);
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      mctx.marshalDocument(this, encoding, null, os);
      return os.toByteArray();
   }
View Full Code Here

Examples of org.jibx.runtime.IMarshallingContext

               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
         if (configurationPersister != null)
         {
View Full Code Here

Examples of org.jibx.runtime.IMarshallingContext

                  + PrivilegedFileHelper.getAbsolutePath(sourceConfig));
            saveStream = PrivilegedFileHelper.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
         if (configurationPersister != null)
         {
View Full Code Here

Examples of org.jibx.runtime.IMarshallingContext

   }

   public byte[] toByteArray(String encoding) throws Exception
   {
      IBindingFactory bfact = BindingDirectory.getFactory(XMLObject.class);
      IMarshallingContext mctx = bfact.createMarshallingContext();
      mctx.setIndent(2);
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      mctx.marshalDocument(this, encoding, null, os);
      return os.toByteArray();
   }
View Full Code Here

Examples of org.jibx.runtime.IMarshallingContext

   }

   public byte[] toByteArray(String encoding) throws Exception
   {
      IBindingFactory bfact = BindingDirectory.getFactory(XMLObject.class);
      IMarshallingContext mctx = bfact.createMarshallingContext();
      mctx.setIndent(2);
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      mctx.marshalDocument(this, encoding, null, os);
      return os.toByteArray();
   }
View Full Code Here

Examples of org.jibx.runtime.IMarshallingContext

   public void toXML(Writer w)
   {
      try
      {
         IBindingFactory bfact = BindingDirectory.getFactory(Configuration.class);
         IMarshallingContext mctx = bfact.createMarshallingContext();
         mctx.setIndent(2);
         mctx.marshalDocument(this, "UTF-8", null, w);
      }
      catch (Exception e)
      {
         log.warn("Couldn't dump the runtime configuration in XML Format", e);
      }
View Full Code Here

Examples of org.jibx.runtime.IMarshallingContext

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

Examples of org.jibx.runtime.IMarshallingContext

    public void marshall(Object object, Writer writer)
            throws JiBXException {
        IBindingFactory identificationBindingFactory =
                BindingDirectory.getFactory(object.getClass());

        IMarshallingContext marshallingContext =
                identificationBindingFactory.createMarshallingContext();

        marshallingContext.setIndent(4);
        marshallingContext.marshalDocument(object, "UTF-8", null, writer);
    }
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.