Package com.thoughtworks.xstream.io

Examples of com.thoughtworks.xstream.io.HierarchicalStreamWriter


   *          the underlying writer that will perform the writes.
   * @return the writer
   * @see com.thoughtworks.xstream.io.HierarchicalStreamDriver#createWriter(java.io.Writer)
   */
  public HierarchicalStreamWriter createWriter(Writer writer) {
    HierarchicalStreamWriter parentWriter = parent.createWriter(writer);
    return new StackWriterWrapper(parentWriter, writerStack, namespaces);
  }
View Full Code Here


   *          the underlying output stream that will perform the writes.
   * @return the writer
   * @see com.thoughtworks.xstream.io.HierarchicalStreamDriver#createWriter(java.io.Writer)
   */
  public HierarchicalStreamWriter createWriter(OutputStream outputStream) {
    HierarchicalStreamWriter parentWriter = parent.createWriter(outputStream);
    return new StackWriterWrapper(parentWriter, writerStack, namespaces);
  }
View Full Code Here

   * @return the writer
   * @see com.thoughtworks.xstream.io.HierarchicalStreamDriver#createWriter(java.
   *      io.Writer)
   */
  public HierarchicalStreamWriter createWriter(Writer writer) {
    HierarchicalStreamWriter parentWriter = parent.createWriter(writer);
    return new StackWriterWrapper(parentWriter, writerStack, namespaces);
  }
View Full Code Here

   * @return the writer
   * @see com.thoughtworks.xstream.io.HierarchicalStreamDriver#createWriter(java.
   *      io.Writer)
   */
  public HierarchicalStreamWriter createWriter(OutputStream outputStream) {
    HierarchicalStreamWriter parentWriter = parent.createWriter(outputStream);
    return new StackWriterWrapper(parentWriter, writerStack, namespaces);
  }
View Full Code Here

    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

     * 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(Locale.ENGLISH).endsWith("json")) {
            out = new JettisonMappedXmlDriver(new Configuration(), false).createWriter(buffer);
        } else {
            out = new PrettyPrintWriter(buffer);
        }
View Full Code Here

    }

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

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

  // Marshalling

  @Override
  protected void marshalDomNode(Object graph, Node node) throws XmlMappingException {
    HierarchicalStreamWriter streamWriter;
    if (node instanceof Document) {
      streamWriter = new DomWriter((Document) node, this.nameCoder);
    }
    else if (node instanceof Element) {
      streamWriter = new DomWriter((Element) node, node.getOwnerDocument(), this.nameCoder);
View Full Code Here

   *          the underlying writer that will perform the writes.
   * @return the writer
   * @see com.thoughtworks.xstream.io.HierarchicalStreamDriver#createWriter(java.io.Writer)
   */
  public HierarchicalStreamWriter createWriter(Writer writer) {
    HierarchicalStreamWriter parentWriter = parent.createWriter(writer);
    return new StackWriterWrapper(parentWriter, writerStack, namespaces);
  }
View Full Code Here

   *          the underlying output stream that will perform the writes.
   * @return the writer
   * @see com.thoughtworks.xstream.io.HierarchicalStreamDriver#createWriter(java.io.Writer)
   */
  public HierarchicalStreamWriter createWriter(OutputStream outputStream) {
    HierarchicalStreamWriter parentWriter = parent.createWriter(outputStream);
    return new StackWriterWrapper(parentWriter, writerStack, namespaces);
  }
View Full Code Here

TOP

Related Classes of com.thoughtworks.xstream.io.HierarchicalStreamWriter

Copyright © 2018 www.massapicom. 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.