Examples of PrettyPrintXMLStreamWriter


Examples of org.apache.cxf.staxutils.PrettyPrintXMLStreamWriter

            && contentType.indexOf("xml") >= 0
            && stringWriter.getBuffer().length() > 0) {
           
            StringWriter swriter = new StringWriter();
            XMLStreamWriter xwriter = StaxUtils.createXMLStreamWriter(swriter);
            xwriter = new PrettyPrintXMLStreamWriter(xwriter, 2);
            StaxUtils.copy(new StreamSource(new StringReader(stringWriter.getBuffer().toString())), xwriter);
            xwriter.close();

            String result = swriter.toString();
            if (result.length() < limit || limit == -1) {
View Full Code Here

Examples of org.apache.cxf.staxutils.PrettyPrintXMLStreamWriter

        if (!dumpSchemas) {
            return;
        }
       
        XMLStreamWriter xwriter = StaxUtils.createXMLStreamWriter(System.err);
        xwriter = new PrettyPrintXMLStreamWriter(xwriter, 2);
        StaxUtils.copy(new DOMSource(document), xwriter);
        xwriter.close();
    }
View Full Code Here

Examples of org.apache.cxf.staxutils.PrettyPrintXMLStreamWriter

        if (isPrettyLogging() && (contentType != null && contentType.indexOf("xml") >= 0
            && contentType.toLowerCase().indexOf("multipart/related") < 0) && cos.size() > 0) {

            StringWriter swriter = new StringWriter();
            XMLStreamWriter xwriter = StaxUtils.createXMLStreamWriter(swriter);
            xwriter = new PrettyPrintXMLStreamWriter(xwriter, 2);
            InputStream in = cos.getInputStream();
            StaxUtils.copy(new StreamSource(in), xwriter);
            xwriter.close();
            in.close();
           
View Full Code Here

Examples of org.apache.cxf.staxutils.PrettyPrintXMLStreamWriter

            && contentType.indexOf("xml") >= 0
            && stringWriter.getBuffer().length() > 0) {

            StringWriter swriter = new StringWriter();
            XMLStreamWriter xwriter = StaxUtils.createXMLStreamWriter(swriter);
            xwriter = new PrettyPrintXMLStreamWriter(xwriter, 2);
            StaxUtils.copy(new StreamSource(new StringReader(stringWriter.getBuffer().toString())), xwriter);
            xwriter.close();
           
            String result = swriter.toString();
            if (result.length() < limit || limit == -1) {
View Full Code Here

Examples of org.apache.cxf.staxutils.PrettyPrintXMLStreamWriter

                }
            }
           
            javax.xml.stream.XMLOutputFactory fact = javax.xml.stream.XMLOutputFactory.newInstance();
            XMLStreamWriter writer =
                new PrettyPrintXMLStreamWriter(fact.createXMLStreamWriter(pw), 2, getIndentLevel(parent));
           
            if (namespace != null && !namespace.equals(jaxbNamespace)) {
                Map<String, String> outMap = new HashMap<String, String>();
                outMap.put("{" + jaxbNamespace + "}*", "{" + namespace + "}*");
                writer = new OutTransformWriter(writer,
                                                outMap,
                                                Collections.<String, String>emptyMap(),
                                                Collections.<String>emptyList(),
                                                false,
                                                "");
            }
            Map<String, String> nspref = new HashMap<String, String>();
            for (Object ent : wsdl.getNamespaces().entrySet()) {
                Map.Entry<?, ?> entry = (Map.Entry<?, ?>)ent;
                nspref.put((String)entry.getValue(), (String)entry.getKey());
            }
            JAXBUtils.setNamespaceMapper(nspref, u);
            u.marshal(mObj, writer);
            writer.flush();           
        } catch (Exception ex) {
            throw new WSDLException(WSDLException.PARSER_ERROR,
                                    "",
                                    ex);
        }
View Full Code Here

Examples of org.grails.web.xml.PrettyPrintXMLStreamWriter

        }
    }

    public void render(Writer out) throws ConverterException {
        stream = new StreamingMarkupWriter(out, encoding);
        writer = config.isPrettyPrint() ? new PrettyPrintXMLStreamWriter(stream): new XMLStreamWriter(stream);

        try {
            isRendering = true;
            writer.startDocument(encoding, "1.0");
            writer.startNode(getElementName(target));
View Full Code Here

Examples of org.metatype.sxc.util.PrettyPrintXMLStreamWriter

        XMLStreamWriter writer = null;
        try {
            final XMLOutputFactory xof = getXmOutputFactory();
            writer = xof.createXMLStreamWriter(streamResult.getOutputStream(), "UTF-8");
            writer = new PrettyPrintXMLStreamWriter(writer);
            final XoXMLStreamWriter w = new XoXMLStreamWriterImpl(writer);

            try {
                w.writeStartDocument("UTF-8", null);
View Full Code Here

Examples of org.metatype.sxc.util.PrettyPrintXMLStreamWriter

        XMLStreamWriter writer = null;
        try {
            final XMLOutputFactory xof = getXmOutputFactory();
            writer = xof.createXMLStreamWriter(streamResult.getOutputStream(), "UTF-8");
            writer = new PrettyPrintXMLStreamWriter(writer);
            final XoXMLStreamWriter w = new XoXMLStreamWriterImpl(writer);

            try {
                w.writeStartDocument("UTF-8", null);
View Full Code Here

Examples of org.metatype.sxc.util.PrettyPrintXMLStreamWriter

        XMLStreamWriter writer = null;
        try {
            final XMLOutputFactory xof = getXmOutputFactory();
            writer = xof.createXMLStreamWriter(streamResult.getOutputStream(), "UTF-8");
            writer = new PrettyPrintXMLStreamWriter(writer);
            XoXMLStreamWriter w = new XoXMLStreamWriterImpl(writer);

            try {
                w.writeStartDocument("UTF-8", null);
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.