Examples of StreamSerializer


Examples of com.sun.xml.txw2.output.StreamSerializer

     * so that test harness can pick up artifacts.
     */
    private void generateWsgenReport(Class<?> endpointClass, AbstractSEIModelImpl rtModel, File wsdlFile, Map<String,File> schemaFiles) {
        try {
            ReportOutput.Report report = TXW.create(ReportOutput.Report.class,
                new StreamSerializer(new BufferedOutputStream(new FileOutputStream(options.wsgenReport))));

            report.wsdl(wsdlFile.getAbsolutePath());
            ReportOutput.writeQName(rtModel.getServiceQName(), report.service());
            ReportOutput.writeQName(rtModel.getPortName(), report.port());
            ReportOutput.writeQName(rtModel.getPortTypeName(), report.portType());
View Full Code Here

Examples of com.sun.xml.txw2.output.StreamSerializer

                if (decl.getTargetNamespace().equals(""))
                    hasComponentInNoNamespace = true;
            }

            OutputStream os = new FileOutputStream(episodeFile);
            Bindings bindings = TXW.create(Bindings.class, new StreamSerializer(os, "UTF-8"));
            if(hasComponentInNoNamespace) // otherwise jaxb binding NS should be the default namespace
                bindings._namespace(Const.JAXB_NSURI,"jaxb");
            else
                bindings._namespace(Const.JAXB_NSURI,"");
            bindings.version("2.1");
View Full Code Here

Examples of com.sun.xml.txw2.output.StreamSerializer

     * so that test harness can pick up artifacts.
     */
    private void generateWsgenReport(Class<?> endpointClass, AbstractSEIModelImpl rtModel, File wsdlFile, Map<String, File> schemaFiles) {
        try {
            ReportOutput.Report report = TXW.create(ReportOutput.Report.class,
                    new StreamSerializer(new BufferedOutputStream(new FileOutputStream(options.wsgenReport))));

            report.wsdl(wsdlFile.getAbsolutePath());
            ReportOutput.writeQName(rtModel.getServiceQName(), report.service());
            ReportOutput.writeQName(rtModel.getPortName(), report.port());
            ReportOutput.writeQName(rtModel.getPortTypeName(), report.portType());
View Full Code Here

Examples of org.zanata.xml.StreamSerializer

            // writing any output. This should enable RESTEasy to return an
            // error instead of simply aborting the output stream.
            if (iter.hasNext())
                iter.peek();

            StreamSerializer stream = new StreamSerializer(output);
            stream.writeXMLDeclaration();
            stream.write(new DocType("tmx", "http://www.lisa.org/tmx/tmx14.dtd"));
            stream.writeNewLine();

            Element tmx = new Element("tmx");
            tmx.addAttribute(new Attribute("version", "1.4"));
            startElem(stream, tmx);

            indent(stream);
            writeElem(stream, exportStrategy.buildHeader());

            indent(stream);
            Element body = new Element("body");
            startElem(stream, body);

            while (iter.hasNext()) {
                T tu = iter.next();
                writeIfComplete(stream, tu);
                ++tuCount;
            }
            indent(stream);
            endElem(stream, body);
            endElem(stream, tmx);
            stream.flush();
        } finally {
            close();
            log.info("streaming output stopped for: {}, TU count={}", jobName,
                    tuCount);
        }
View Full Code Here

Examples of org.zanata.xml.StreamSerializer

public class StreamSerializerTest {

    @Test
    public void sanityTest() throws IOException {
        OutputStream out = new ByteArrayOutputStream();
        StreamSerializer serializer = new StreamSerializer(out);

        serializer.writeXMLDeclaration();
        Element rootElement = new Element("root");
        rootElement.addAttribute(new Attribute("rootAttr", "rootAttrVal"));
        serializer.writeStartTag(rootElement);

        Element sub1 = new Element("sub");
        sub1.addAttribute(new Attribute("subAttr", "subAttrVal"));
        serializer.write(sub1);

        Element sub2 = new Element("sub");
        sub2.addAttribute(new Attribute("xml:lang", XMLConstants.XML_NS_URI,
                "en"));
        serializer.write(sub2);

        serializer.writeEndTag(rootElement);
        serializer.flush();
        String output = out.toString();

        assertThat(output,
                startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"));
        String expected =
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.