Package com.thoughtworks.xstream.io.xml

Examples of com.thoughtworks.xstream.io.xml.SaxWriter


        // cache the document
        String docid = collection.getAbsolutePath() + File.separatorChar + docName;
        DocumentTableLoader.putDocumentIfAbsent(docid, doc);

        SaxWriter writer = new SaxWriter();
        ContentHandler builder = new DocumentTableBuilder(doc);
        writer.setContentHandler(builder);

        xstream.marshal(value, writer);
        writer.flush();

        try {
            collection.putDocument(new Transaction(), docName, doc);
        } catch (DbException e) {
            throw new IllegalStateException(e);
View Full Code Here


  @Override
  protected void marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler)
      throws XmlMappingException {

    SaxWriter saxWriter = new SaxWriter();
    saxWriter.setContentHandler(contentHandler);
    marshal(graph, saxWriter);
  }
View Full Code Here

  @Override
  protected void marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler)
      throws XmlMappingException {

    SaxWriter saxWriter = new SaxWriter(this.nameCoder);
    saxWriter.setContentHandler(contentHandler);
    doMarshal(graph, saxWriter, null);
  }
View Full Code Here

    public void encode(Object object, ContentHandler handler) throws Exception {
        // prepare xml encoding
        XStream xstream = buildXStream();

        // bind with the content handler
        SaxWriter writer = new SaxWriter();
        writer.setContentHandler(handler);

        // write out xml
        xstream.marshal(object, writer);
    }
View Full Code Here

    private SaxWriter xstreamReader;
   
    @Initialize
    public void intialize() {
        xstreamReader = new SaxWriter(includeEnclosingDocument);
    }
View Full Code Here

    public void encode(Object object, ContentHandler handler) throws Exception {
        // prepare xml encoding
        XStream xstream = buildXStream();

        // bind with the content handler
        SaxWriter writer = new SaxWriter();
        writer.setContentHandler(handler);

        // write out xml
        xstream.marshal(object, writer);
    }
View Full Code Here

TOP

Related Classes of com.thoughtworks.xstream.io.xml.SaxWriter

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.