Examples of marshalDocument()


Examples of org.jibx.runtime.IMarshallingContext.marshalDocument()

   {
      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();
   }

   public static XMLCollection getXMLCollection(InputStream is) throws Exception
   {
View Full Code Here

Examples of org.jibx.runtime.IMarshallingContext.marshalDocument()

   {
      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();
   }

   public static XMLObject getXMLObject(InputStream is) throws Exception
   {
View Full Code Here

Examples of org.jibx.runtime.IMarshallingContext.marshalDocument()

         }

         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.marshalDocument()

         }

         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.marshalDocument()

   {
      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();
   }

   static public XMLCollection getXMLCollection(InputStream is) throws Exception
   {
View Full Code Here

Examples of org.jibx.runtime.IMarshallingContext.marshalDocument()

   {
      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();
   }

   static public XMLObject getXMLObject(InputStream is) throws Exception
   {
View Full Code Here

Examples of org.jibx.runtime.IMarshallingContext.marshalDocument()

      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.marshalDocument()

        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.marshalDocument()

        IMarshallingContext marshallingContext =
                identificationBindingFactory.createMarshallingContext();

        marshallingContext.setIndent(4);
        marshallingContext.marshalDocument(object, "UTF-8", null, writer);
    }

    public String marshall(Object object)
            throws JiBXException {
View Full Code Here

Examples of org.jibx.runtime.IMarshallingContext.marshalDocument()

        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();

        // validate XML
        SAX_BUILDER.build(new StringReader(xmlContent));
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.