Examples of HierarchicalStreamWriter


Examples of com.dotcms.repackage.com.thoughtworks.xstream.io.HierarchicalStreamWriter

            if ( !f.exists() ){
              f.createNewFile();
           
           
            OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream( f ), "UTF-8");
            HierarchicalStreamWriter xmlWriter = new DotPrettyPrintWriter(writer);
            xstream.marshal(obj, xmlWriter);
            writer.close();

        } catch ( FileNotFoundException e ) {
            Logger.error( PublisherUtil.class, e.getMessage(), e );
View Full Code Here

Examples of com.thoughtworks.xstream.io.HierarchicalStreamWriter

        }
        return answer;
    }

    public void marshal(Exchange exchange, Object body, OutputStream stream) throws Exception {
        HierarchicalStreamWriter writer = createHierarchicalStreamWriter(exchange, body, stream);
        try {
            getXStream().marshal(body, writer);
        } finally {
            writer.close();
        }
    }
View Full Code Here

Examples of com.thoughtworks.xstream.io.HierarchicalStreamWriter

    public void setStaxConverter(StaxConverter staxConverter) {
        this.staxConverter = staxConverter;
   
   
    public void marshal(Exchange exchange, Object body, OutputStream stream) throws Exception {
        HierarchicalStreamWriter writer = createHierarchicalStreamWriter(exchange, body, stream);
        try {
            getXStream().marshal(body, writer);
        } finally {
            writer.close();
        }
    }
View Full Code Here

Examples of com.thoughtworks.xstream.io.HierarchicalStreamWriter

    public void setXstream(XStream xstream) {
        this.xstream = xstream;
    }

    public void marshal(Exchange exchange, Object body, OutputStream stream) throws Exception {
        HierarchicalStreamWriter writer = createHierarchicalStreamWriter(exchange, body, stream);
        try {
            getXStream(exchange.getContext().getClassResolver()).marshal(body, writer);
        } finally {
            writer.close();
        }
    }
View Full Code Here

Examples of com.thoughtworks.xstream.io.HierarchicalStreamWriter

     * of an exception.
     *
     * @throws XStreamException if the object cannot be serialized
     */
    public void toXML(final Object obj, final Writer out) {
        @SuppressWarnings("resource")
        final HierarchicalStreamWriter writer = hierarchicalStreamDriver.createWriter(out);
        try {
            marshal(obj, writer);
        } finally {
            writer.flush();
        }
    }
View Full Code Here

Examples of com.thoughtworks.xstream.io.HierarchicalStreamWriter

     * and in case of an exception.
     *
     * @throws XStreamException if the object cannot be serialized
     */
    public void toXML(final Object obj, final OutputStream out) {
        @SuppressWarnings("resource")
        final HierarchicalStreamWriter writer = hierarchicalStreamDriver.createWriter(out);
        try {
            marshal(obj, writer);
        } finally {
            writer.flush();
        }
    }
View Full Code Here

Examples of com.thoughtworks.xstream.io.HierarchicalStreamWriter

     * Marshalls the Object to a string using XML or JSON encoding
     */
    protected String marshall(Serializable object, String transformation)
            throws JMSException {
        StringWriter buffer = new StringWriter();
        HierarchicalStreamWriter out;
        if (transformation.toLowerCase().endsWith("json")) {
            out = new JettisonMappedXmlDriver(new Configuration(), false).createWriter(buffer);
        } else {
            out = new PrettyPrintWriter(buffer);
        }
View Full Code Here

Examples of com.thoughtworks.xstream.io.HierarchicalStreamWriter

    }

    protected String marshallAdvisory(final DataStructure ds, String transformation) {

        StringWriter buffer = new StringWriter();
        HierarchicalStreamWriter out;
        if (transformation.toLowerCase().endsWith("json")) {
            out = new JettisonMappedXmlDriver().createWriter(buffer);
        } else {
            out = new PrettyPrintWriter(buffer);
        }
View Full Code Here

Examples of com.thoughtworks.xstream.io.HierarchicalStreamWriter

     * encoding
     */
    protected String marshall(Session session, ObjectMessage objectMessage) throws JMSException {
        Serializable object = objectMessage.getObject();
        StringWriter buffer = new StringWriter();
        HierarchicalStreamWriter out;
        if (streamDriver != null) {
          out = streamDriver.createWriter(buffer);
        } else {
          out = new PrettyPrintWriter(buffer);
        }
View Full Code Here

Examples of com.thoughtworks.xstream.io.HierarchicalStreamWriter

   * Marshalls the Object to a string using XML or JSON encoding
   */
  protected String marshall(Serializable object, String transformation)
      throws JMSException {
    StringWriter buffer = new StringWriter();
    HierarchicalStreamWriter out;
    if (transformation.toLowerCase().endsWith("json")) {
      out = new JettisonMappedXmlDriver(new Configuration(), false).createWriter(buffer);
    } else {
      out = new PrettyPrintWriter(buffer);
    }
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.