Package org.grails.encoder
Class EncodedAppenderWriter
java.lang.Object
java.io.Writer
org.grails.encoder.EncodedAppenderWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable,EncodedAppenderFactory,EncodedAppenderWriterFactory,EncoderAware
public class EncodedAppenderWriter
extends Writer
implements EncodedAppenderWriterFactory, EncodedAppenderFactory, EncoderAware
A java.io.Writer implementation that writes to a
EncodedAppender with
a certain encoder
This class isn't thread-safe.- Since:
- 2.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final EncodedAppenderprotected final Encoderprotected final EncodingStateRegistry -
Constructor Summary
ConstructorsConstructorDescriptionEncodedAppenderWriter(EncodedAppender encodedAppender, Encoder encoder, EncodingStateRegistry encodingStateRegistry) Default constructor -
Method Summary
Modifier and TypeMethodDescriptionappend(char c) append(CharSequence csq) append(CharSequence csq, int start, int end) voidclose()voidflush()Gets the EncodedAppender that is connected to the instance of this implementation.Gets the current encoder in use.getWriterForEncoder(Encoder encoder, EncodingStateRegistry encodingStateRegistry) Gets the EncodedAppenderWriter instance that is connected to this instance implementation with a certain encoder fixed.voidwrite(char[] cbuf, int off, int len) voidwrite(int c) voidMethods inherited from class java.io.Writer
nullWriter, write, write
-
Field Details
-
encodedAppender
-
encoder
-
encodingStateRegistry
-
-
Constructor Details
-
EncodedAppenderWriter
public EncodedAppenderWriter(EncodedAppender encodedAppender, Encoder encoder, EncodingStateRegistry encodingStateRegistry) Default constructor- Parameters:
encodedAppender- the EncodedAppender destinationencoder- the encoder to useencodingStateRegistry- theEncodingStateRegistryto use to lookup encoding state of CharSequence instances
-
-
Method Details
-
write
- Specified by:
writein classWriter- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Specified by:
flushin classWriter- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classWriter- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
append
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
append
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
append
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
getEncodedAppender
Description copied from interface:EncodedAppenderFactoryGets the EncodedAppender that is connected to the instance of this implementation.- Specified by:
getEncodedAppenderin interfaceEncodedAppenderFactory- Returns:
- the EncodedAppender
-
getEncoder
Description copied from interface:EncoderAwareGets the current encoder in use.- Specified by:
getEncoderin interfaceEncoderAware- Returns:
- the encoder
-
getWriterForEncoder
Description copied from interface:EncodedAppenderWriterFactoryGets the EncodedAppenderWriter instance that is connected to this instance implementation with a certain encoder fixed.- Specified by:
getWriterForEncoderin interfaceEncodedAppenderWriterFactory- Parameters:
encoder- the encoder to useencodingStateRegistry- the current EncodingStateRegistry to use- Returns:
- the java.io.Writer instance
-