Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.mina.filter.codec.textline
Class TextLineCodecFactory

    java.lang.Object
      org.apache.mina.filter.codec.textline.TextLineCodecFactory

All Implemented Interfaces:
  ProtocolCodecFactory

    public class TextLineCodecFactory

extends 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.

Version:
  $Rev: 555855 $, $Date: 2007-07-13 05:19:00 +0200 (Fri, 13 Jul 2007) $
Author:
  The Apache Directory Project (mina-dev@directory.apache.org)

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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### 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 Detail

### getEncoder

    public ProtocolEncoder getEncoder()

  Description copied from interface: `ProtocolCodecFactory`
  Returns a new (or reusable) instance of `ProtocolEncoder` which encodes message objects into binary or protocol-specific data.

  Specified by:
    `getEncoder` in interface `ProtocolCodecFactory`

### getDecoder

    public ProtocolDecoder getDecoder()

  Description copied from interface: `ProtocolCodecFactory`
  Returns a new (or reusable) instance of `ProtocolDecoder` which decodes binary or protocol-specific data into message objects.

  Specified by:
    `getDecoder` in interface `ProtocolCodecFactory`

### getEncoderMaxLineLength

    public int getEncoderMaxLineLength()

  Returns the allowed maximum size of the encoded line. If the size of the encoded line exceeds this value, the encoder will throw a `IllegalArgumentException`. The default value is `Integer.MAX_VALUE`.

  This method does the same job with `TextLineEncoder.getMaxLineLength()`.

### setEncoderMaxLineLength

    public void setEncoderMaxLineLength(int maxLineLength)

  Sets the allowed maximum size of the encoded line. If the size of the encoded line exceeds this value, the encoder will throw a `IllegalArgumentException`. The default value is `Integer.MAX_VALUE`.

  This method does the same job with `TextLineEncoder.setMaxLineLength(int)`.

### getDecoderMaxLineLength

    public int getDecoderMaxLineLength()

  Returns the allowed maximum size of the line to be decoded. If the size of the line to be decoded exceeds this value, the decoder will throw a `BufferDataException`. The default value is `1024` (1KB).

  This method does the same job with `TextLineDecoder.getMaxLineLength()`.

### setDecoderMaxLineLength

    public void setDecoderMaxLineLength(int maxLineLength)

  Sets the allowed maximum size of the line to be decoded. If the size of the line to be decoded exceeds this value, the decoder will throw a `BufferDataException`. The default value is `1024` (1KB).

  This method does the same job with `TextLineDecoder.setMaxLineLength(int)`.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2008 Apache MINA Project. All Rights Reserved.