Examples of marshalDocument()


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

           
      // marshal object back out to file (with nice indentation, as UTF-8)
      IMarshallingContext mctx = bfact.createMarshallingContext();
      mctx.setIndent(2);
      FileOutputStream out = new FileOutputStream(args[1]);
      mctx.marshalDocument(customer, "UTF-8", null, out);
     
    } catch (FileNotFoundException e) {
      e.printStackTrace();
            System.exit(1);
    } catch (JiBXException e) {
View Full Code Here

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

            XMLStreamWriter noCloseWriter = new NoCloseXMLStreamWriter(((ElementWriter) writer)
                    .getXMLStreamWriter());
            mctx.setXmlWriter(new StAXWriter(bfact.getNamespaces(), noCloseWriter));

            mctx.marshalDocument(object);
        }
        catch (JiBXException e)
        {
            throw new XFireRuntimeException("Could not write Jibx type.", e);
        }
View Full Code Here

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

      }
    }
    IMarshallingContext ctx = bfact.createMarshallingContext();
    StringWriter sw = new StringWriter();
    ctx.setOutput(sw);
    ctx.marshalDocument(sld);
  }

  @Test
  public void testCrosses() throws JiBXException {
    IBindingFactory bfact = BindingDirectory.getFactory(StyledLayerDescriptorInfo.class);
View Full Code Here

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

    try {
      bfact = BindingDirectory.getFactory(StyledLayerDescriptorInfo.class);
      IMarshallingContext mctx = bfact.createMarshallingContext();
      StringWriter writer = new StringWriter();
      mctx.setOutput(writer);
      mctx.marshalDocument(obj);
      if (log.isDebugEnabled()) {
        log.debug(writer.toString());
      }
    } catch (JiBXException e) {
      throw new SldException("Validation error", e);
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();
   }

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

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

      try
      {
         IBindingFactory bfact = BindingDirectory.getFactory(RepositoryServiceConfiguration.class);
         IMarshallingContext mctx = bfact.createMarshallingContext();
         mctx.setIndent(2);
         mctx.marshalDocument(this, "UTF-8", null, sw);
      }
      catch (Exception e)
      {
         LOG.warn("Cannot convert the configuration to XML format", e);
         return null;
View Full Code Here

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

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

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

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

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

   static public XMLObject getXMLObject(InputStream is) throws Exception
   {
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.