org.apache.mina.filter.codec.textline

Class TextLineCodecFactory

Implemented Interfaces:
ProtocolCodecFactory

public class TextLineCodecFactory
extends java.lang.Object
implements ProtocolCodecFactory

A ProtocolCodecFactory that performs encoding and decoding between a text line data and a Java string object. This codec is useful especially when you work with a text-based protocols such as SMTP and IMAP.

Constructor Summary

TextLineCodecFactory()
Creates a new instance with the current default Charset.
TextLineCodecFactory(Charset charset)
Creates a new instance with the specified Charset.

Method Summary

ProtocolDecoder
getDecoder()
Returns a new (or reusable) instance of ProtocolDecoder which decodes binary or protocol-specific data into message objects.
int
getDecoderMaxLineLength()
Returns the allowed maximum size of the line to be decoded.
ProtocolEncoder
getEncoder()
Returns a new (or reusable) instance of ProtocolEncoder which encodes message objects into binary or protocol-specific data.
int
getEncoderMaxLineLength()
Returns the allowed maximum size of the encoded line.
void
setDecoderMaxLineLength(int maxLineLength)
Sets the allowed maximum size of the line to be decoded.
void
setEncoderMaxLineLength(int maxLineLength)
Sets the allowed maximum size of the encoded line.

Constructor Details

TextLineCodecFactory

public TextLineCodecFactory()
Creates a new instance with the current default Charset.

TextLineCodecFactory

public TextLineCodecFactory(Charset charset)
Creates a new instance with the specified Charset.

Method Details

getDecoder

public ProtocolDecoder getDecoder()
Returns a new (or reusable) instance of ProtocolDecoder which decodes binary or protocol-specific data into message objects.
Specified by:
getDecoder in interface ProtocolCodecFactory

getDecoderMaxLineLength

public int getDecoderMaxLineLength()

getEncoder

public ProtocolEncoder getEncoder()
Returns a new (or reusable) instance of ProtocolEncoder which encodes message objects into binary or protocol-specific data.
Specified by:
getEncoder in interface ProtocolCodecFactory

getEncoderMaxLineLength

public int getEncoderMaxLineLength()

setDecoderMaxLineLength

public void setDecoderMaxLineLength(int maxLineLength)

setEncoderMaxLineLength

public void setEncoderMaxLineLength(int maxLineLength)