Package javax.xml.bind

Examples of javax.xml.bind.Marshaller.marshal()


        StringWriter xmlReq = new StringWriter();
        Marshaller marshaller = getJaxbContext().createMarshaller();
        marshaller.setProperty( "jaxb.formatted.output",
                                true );
        marshaller.marshal( cmd,
                            xmlReq );

        System.out.println( xmlReq.toString() );

        byte[] xmlResp = (byte[]) template.requestBody( "direct:test-with-session",
View Full Code Here


        StringWriter xmlReq = new StringWriter();
        Marshaller marshaller = getJaxbContext().createMarshaller();
        marshaller.setProperty( "jaxb.formatted.output",
                                true );
        marshaller.marshal( cmd,
                            xmlReq );

        System.out.println( xmlReq.toString() );

        byte[] xmlResp = (byte[]) template.requestBody( "direct:test-with-session",
View Full Code Here

   {
      try
      {
         Marshaller marshaller = getMarshaller(type, annotations, mediaType);
         marshaller = decorateMarshaller(type, annotations, mediaType, marshaller);
         marshaller.marshal(t, outputStream);
      }
      catch (JAXBException e)
      {
         Response response = Response.serverError().build();
         throw new WebApplicationException(e, response);
View Full Code Here

  private String toXml(Action action) throws RepositoryException {
    Object o;
    try {
      Marshaller marshaller = jaxbContext.createMarshaller();
      StringWriter writer = new StringWriter();
      marshaller.marshal(action, writer);
      return writer.toString();
    } catch (JAXBException e) {
      throw new RepositoryException("Error serializing action", e);
    }
  }
View Full Code Here

        Marshaller marshaller = getJaxbContext().createMarshaller();
        marshaller.setProperty( "jaxb.formatted.output",
                                true );
        StringWriter xml = new StringWriter();
        marshaller.marshal( cmd,
                            xml );

        System.out.println( xml.toString() );

        byte[] response = (byte[]) template.requestBody( "direct:test-with-session",
View Full Code Here

    return unmarshaller.unmarshal(xmlStreamReader);
  }

  public static void marshal(JAXBContext jaxbContext, Object item, XMLStreamWriter xmlWriter) throws JAXBException {
    Marshaller marshaller = jaxbContext.createMarshaller();
    marshaller.marshal(item, xmlWriter);
  }

  public static class ElementInfo {
    public final String namespace;
    public final String elementName;
View Full Code Here

   {
      try {
         Marshaller marshaller = JAXBContext.newInstance(type)
                  .createMarshaller();
         marshaller.setProperty("jaxb.formatted.output", true);
         marshaller.marshal(object, outputStream);

      }
      catch (Exception e) {
         throw new RuntimeException(e);
      }
View Full Code Here

     */
    public void encode(Writer w) throws JAXBException {
        // Marshall the ViewProperties class into XML
        Marshaller marshaller = jaxbContext.createMarshaller();
        marshaller.setProperty("jaxb.formatted.output", true);
        marshaller.marshal(this, w);
    }

    /**
     * Listener for changes in the collection of view properties
     */
 
View Full Code Here

     */
    public void encode(OutputStream os) throws JAXBException {
        /* Write out to the stream */
        Marshaller marshaller = jaxbContext.createMarshaller();
        marshaller.setProperty("jaxb.formatted.output", true);
        marshaller.marshal(this, os);
    }

    public static DeployedModel decode(InputStream in) throws JAXBException {
        /* Read in from stream */
        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
View Full Code Here

        this.attributes = list.toArray(new Attribute[] {});
           
        /* Write out to the stream */
        Marshaller marshaller = jaxbContext.createMarshaller();
        marshaller.setProperty("jaxb.formatted.output", true);
        marshaller.marshal(this, w);
    }

    /**
     * Writes the ModuleInfo class to an output stream.
     * <p>
 
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.