Examples of createMarshallingContext()


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

   }

   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.IBindingFactory.createMarshallingContext()

               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

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

                  + 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
View Full Code Here

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

   }

   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.IBindingFactory.createMarshallingContext()

   }

   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.IBindingFactory.createMarshallingContext()

   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)
      {
View Full Code Here

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

    // 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.IBindingFactory.createMarshallingContext()

            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

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

        MarshallingContext ctx = (MarshallingContext) iMarshallingContext;
        preprocessMarshallingContext(ctx);

        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

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

            throws JiBXException, IOException, JDOMException {

        // marshal XML
        final IBindingFactory bfact =
            BindingDirectory.getFactory(object.getClass());
        final IMarshallingContext mctx = bfact.createMarshallingContext();
        mctx.setIndent(4);
        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
        mctx.marshalDocument(object, "UTF-8", null, baos);
        baos.close();
        final String xmlContent = baos.toString();
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.