Groovy Documentation

org.codehaus.groovy.grails.support.encoding
[Java] Class AbstractEncodedAppender

java.lang.Object
  org.codehaus.groovy.grails.support.encoding.AbstractEncodedAppender
All Implemented Interfaces:
EncodedAppender

public abstract class AbstractEncodedAppender
extends java.lang.Object

Abstract base class for implementations of EncodedAppender interface

Authors:
Lari Hotari
Since:
2.3


Method Summary
void append(Encoder encoder, char character)

void append(Encoder encoder, EncodingState encodingState, char[] b, int off, int len)

void append(Encoder encoder, EncodingState encodingState, java.lang.CharSequence str, int off, int len)

void append(Encoder encoder, StreamEncodeable streamEncodeable)

protected void appendCharSequence(EncodingState encodingState, java.lang.CharSequence str, int start, int end)

Append a portion of a CharSequence to the buffer and attach the encodingState information to it

void appendEncoded(Encoder encoder, EncodingState encodingState, char[] b, int off, int len)

void appendEncoded(Encoder encoder, EncodingState encodingState, java.lang.CharSequence str, int off, int len)

protected void encodeAndWrite(Encoder encoder, EncodingState newEncodingState, java.lang.CharSequence input)

Encode and write input to buffer using a non-streaming encoder

void flush()

protected boolean shouldEncode(Encoder encoderToApply, EncodingState encodingState)

Check if the encoder should be used to a input with certain encodingState

protected void write(EncodingState encodingState, char[] b, int off, int len)

Append a portion of a char array to the buffer and attach the encodingState information to it

protected void write(EncodingState encodingState, java.lang.String str, int off, int len)

Append a portion of a string to the buffer and attach the encodingState information to it

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Method Detail

append

public void append(Encoder encoder, char character)


append

public void append(Encoder encoder, EncodingState encodingState, char[] b, int off, int len)


append

public void append(Encoder encoder, EncodingState encodingState, java.lang.CharSequence str, int off, int len)


append

public void append(Encoder encoder, StreamEncodeable streamEncodeable)


appendCharSequence

protected void appendCharSequence(EncodingState encodingState, java.lang.CharSequence str, int start, int end)
Append a portion of a CharSequence to the buffer and attach the encodingState information to it
throws:
IOException Signals that an I/O exception has occurred.
Parameters:
encodingState - the new encoding state of the CharSequence portion
str - a CharSequence
start - the start index, inclusive
end - the end index, exclusive


appendEncoded

public void appendEncoded(Encoder encoder, EncodingState encodingState, char[] b, int off, int len)


appendEncoded

public void appendEncoded(Encoder encoder, EncodingState encodingState, java.lang.CharSequence str, int off, int len)


encodeAndWrite

protected void encodeAndWrite(Encoder encoder, EncodingState newEncodingState, java.lang.CharSequence input)
Encode and write input to buffer using a non-streaming encoder
throws:
IOException Signals that an I/O exception has occurred.
Parameters:
encoder - the encoder to use
newEncodingState - the new encoding state after encoder has been applied
input - the input CharSequence


flush

public void flush()


shouldEncode

protected boolean shouldEncode(Encoder encoderToApply, EncodingState encodingState)
Check if the encoder should be used to a input with certain encodingState
Parameters:
encoderToApply - the encoder to apply
encodingState - the current encoding state
Returns:
true, if should encode


write

protected void write(EncodingState encodingState, char[] b, int off, int len)
Append a portion of a char array to the buffer and attach the encodingState information to it
throws:
IOException Signals that an I/O exception has occurred.
Parameters:
encodingState - the new encoding state of the char array
b - a char array
off - Offset from which to start encoding characters
len - Number of characters to encode


write

protected void write(EncodingState encodingState, java.lang.String str, int off, int len)
Append a portion of a string to the buffer and attach the encodingState information to it
throws:
IOException Signals that an I/O exception has occurred.
Parameters:
encodingState - the new encoding state of the string
str - A String
off - Offset from which to start encoding characters
len - Number of characters to encode


 

Groovy Documentation