Package org.milyn.io

Examples of org.milyn.io.NullWriter


        Smooks smooks = new Smooks(getClass().getResourceAsStream(config));
        ExecutionContext execContext = smooks.createExecutionContext();
        StreamSource source = new StreamSource(getClass().getResourceAsStream(sourceFile));

        execContext.setEventListener(eventListener);
        smooks.filterSource(execContext, source, new StreamResult(new NullWriter()));
    }
View Full Code Here


        // Claim ownership of the writer for this fragment element...
        Writer writer = element.getWriter(this);

        if(!keepChildren) {
            // Swap in a NullWriter instance for the whole fragment...
            element.setWriter(new NullWriter(), this);
            // Stash the real writer instance on the element so we can reset it at the end...
            element.setCache(this, writer);
        } else {
            // Just don't write this element, but write the child elements...
        }
View Full Code Here

                if(templateBefore != null) {
                    applyTemplate(templateBefore, element, executionContext);
                } else if(executionContext.isDefaultSerializationOn()) {
                    // If Default Serialization is on, we want to block output to the
                    // output stream...
                    element.setWriter(new NullWriter(currentWriter), this);
                }
            } else if (getAction() != Action.REPLACE && getAction() != Action.BIND_TO) {
                // write the start of the element...
                if (executionContext.getDeliveryConfig().isDefaultSerializationOn()) {
                    targetWriter.visitBefore(element, executionContext);
View Full Code Here

        //System.out.println(writer.toString());
    }

    private void runTransform(String config) throws IOException, SAXException, InterruptedException {
        Smooks smooks = new Smooks(getClass().getResourceAsStream(config));
        NullWriter writer = new NullWriter();

        // warm ups...
        runTransform(smooks, writer);
        runTransform(smooks, writer);
View Full Code Here

    }


    protected Writer getWriter(Result result, ExecutionContext executionContext) {
        if (!(result instanceof StreamResult)) {
            return new NullWriter();
        }

        StreamResult streamResult = (StreamResult) result;
        if (streamResult.getWriter() != null) {
            return streamResult.getWriter();
View Full Code Here

        return new NullReader();
    }

    protected Writer getWriter(Result result, ExecutionContext executionContext) {
        if(!(result instanceof StreamResult)) {
            return new NullWriter();
        }

        StreamResult streamResult = (StreamResult) result;
        if(streamResult.getWriter() != null) {
            return streamResult.getWriter();
View Full Code Here

TOP

Related Classes of org.milyn.io.NullWriter

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.