Package org.grails.encoder

Examples of org.grails.encoder.StreamingEncoderWriter


                return new EncodedAppenderWriter(encodedAppender, encoder, encodingStateRegistry);
            }
        }
        if (target != null) {
            if (encoder instanceof StreamingEncoder) {
                return new StreamingEncoderWriter(target, (StreamingEncoder)encoder, encodingStateRegistry);
            } else {
                return new CodecPrintWriter(target, encoder, encodingStateRegistry);
            }
        } else {
            return null;
View Full Code Here


            if (value.getClass() == String.class || value.getClass() == StringBuilder.class || value.getClass() == StringBuffer.class) {
                encodeToWriter((CharSequence)value, writer);
            } else if(value instanceof StreamingEncoderWritable) {
                ((StreamingEncoderWritable)value).encodeTo(writer, javascriptEncoderStateless);
            } else if (value instanceof Writable) {
                ((Writable)value).writeTo(new StreamingEncoderWriter(writer, javascriptEncoder, null));
            }
            else{
                encodeToWriter(value.toString(), writer);
            }
            writer.write("\"");
View Full Code Here

    private Writer createEncodingWriter(Writer out, Encoder encoder, EncodingStateRegistry encodingStateRegistry, String codecWriterName) {
        Writer encodingWriter;
        if (out instanceof EncodedAppenderWriterFactory) {
            encodingWriter=((EncodedAppenderWriterFactory)out).getWriterForEncoder(encoder, encodingStateRegistry);
        } else if (encoder instanceof StreamingEncoder) {
            encodingWriter=new StreamingEncoderWriter(out, (StreamingEncoder)encoder, encodingStateRegistry);
        } else {
            encodingWriter=new CodecPrintWriter(out, encoder, encodingStateRegistry);
        }
        return encodingWriter;
    }
View Full Code Here

            if (codecForTaglibs != null) {
                Encoder encoder = WithCodecHelper.lookupEncoder(webRequest.getAttributes().getGrailsApplication(), codecForTaglibs);
                if (out instanceof EncodedAppenderWriterFactory) {
                    out = ((EncodedAppenderWriterFactory)out).getWriterForEncoder(encoder, webRequest.getEncodingStateRegistry());
                } else if (encoder instanceof StreamingEncoder) {
                    out=new StreamingEncoderWriter(out, (StreamingEncoder)encoder, webRequest.getEncodingStateRegistry());
                } else {
                    out = new CodecPrintWriter(out, encoder, webRequest.getEncodingStateRegistry());
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.grails.encoder.StreamingEncoderWriter

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.