Examples of SAXWriter


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

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

  @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

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

  @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

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

    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

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

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

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

    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

Examples of org.dcm4che3.io.SAXWriter

        TransformerHandler th = getTransformerHandler();
        Transformer t = th.getTransformer();
        t.setOutputProperty(OutputKeys.INDENT, indent ? "yes" : "no");
        t.setOutputProperty(OutputKeys.VERSION, xmlVersion);
        th.setResult(new StreamResult(System.out));
        SAXWriter saxWriter = new SAXWriter(th);
        saxWriter.setIncludeKeyword(includeKeyword);
        saxWriter.setIncludeNamespaceDeclaration(includeNamespaceDeclaration);
        dis.setDicomInputHandler(saxWriter);
        dis.readDataset(-1, -1);
    }
View Full Code Here

Examples of org.dcm4che3.io.SAXWriter

    private void writeAsXML(Attributes attrs, OutputStream out) throws Exception {
        TransformerHandler th = getTransformerHandler();
        th.getTransformer().setOutputProperty(OutputKeys.INDENT,
                xmlIndent ? "yes" : "no");
        th.setResult(new StreamResult(out));
        SAXWriter saxWriter = new SAXWriter(th);
        saxWriter.setIncludeKeyword(xmlIncludeKeyword);
        saxWriter.setIncludeNamespaceDeclaration(xmlIncludeNamespaceDeclaration);
        saxWriter.write(attrs);
    }
View Full Code Here

Examples of org.dom4j.io.SAXWriter

            }, saxFactory);
       
            ValidatorErrorHandler validatorErrorHandler = new ValidatorErrorHandler();
            Verifier verifier = new Verifier(docDeclaration, validatorErrorHandler);

            SAXWriter writer = new SAXWriter((ContentHandler) verifier);
            writer.setErrorHandler(validatorErrorHandler);

            writer.write(doc);
            if (verifier.isValid()) {
                return true;
            } else {
                Log.error(doc.getName() + " is invalid.");
                return false;
View Full Code Here

Examples of org.dom4j.io.SAXWriter

    @SuppressWarnings("rawtypes")
    @Override
    protected void process(ParsedDatum datum, Document doc, TupleEntryCollector collector,
                    FlowProcess process) throws Exception {
        SimpleBodyContentHandler bodyContentHandler = new SimpleBodyContentHandler();
        SAXWriter writer = new SAXWriter(bodyContentHandler);
        writer.write(doc);

        float pageScore = getScore(bodyContentHandler.toString());
       
        // Get the outlinks.
        Outlink[] outlinks = getOutlinks(doc);
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.