|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mailster.mina.TextLineConsumer
public class TextLineConsumer
---
Mailster (C) 2007-2009 De Oliveira Edouard
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
See Mailster
Web Site
---
TextLineConsumer.java - This class consumes a IoBuffer extracting a
\r\n terminated line and forwards decoded lines to a IoFilterCodec codec
for further decoding.
| Field Summary | |
|---|---|
private IoFilterCodec |
codec
|
private org.apache.mina.core.buffer.IoBuffer |
delimBuf
|
private int |
maxLineLength
|
private int |
minLineLength
|
| Constructor Summary | |
|---|---|
TextLineConsumer(java.nio.charset.Charset charset,
IoFilterCodec codec)
Creates a new instance with the specified charset the LineDelimiter.DEFAULT delimiter and the specified
IoFilterCodec. |
|
TextLineConsumer(java.nio.charset.Charset charset,
org.apache.mina.filter.codec.textline.LineDelimiter delimiter,
IoFilterCodec codec)
Creates a new instance with the specified charset the specified delimiter and the specified IoFilterCodec. |
|
TextLineConsumer(IoFilterCodec codec)
Creates a new instance with the current default Charset,
the LineDelimiter.DEFAULT delimiter and the specified
IoFilterCodec. |
|
| Method Summary | |
|---|---|
boolean |
consume(org.apache.mina.core.filterchain.IoFilter.NextFilter nextFilter,
org.apache.mina.core.buffer.IoBuffer in)
Consumes data and sends it to the IoFilterCodec#unwrap(NextFilter, IoBuffer) method. |
IoFilterCodec |
getCodec()
Returns the associated codec. |
int |
getMaxLineLength()
Returns the allowed maximum size of the line to be decoded. |
int |
getMinLineLength()
Returns the allowed minimum size of the line to be decoded. |
void |
setMaxLineLength(int maxLineLength)
Sets the allowed maximum size of the line to be decoded. |
void |
setMinLineLength(int minLineLength)
Sets the allowed minimum size of the line to be decoded. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private org.apache.mina.core.buffer.IoBuffer delimBuf
private int maxLineLength
private int minLineLength
private IoFilterCodec codec
| Constructor Detail |
|---|
public TextLineConsumer(IoFilterCodec codec)
Charset,
the LineDelimiter.DEFAULT delimiter and the specified
IoFilterCodec.
public TextLineConsumer(java.nio.charset.Charset charset,
IoFilterCodec codec)
LineDelimiter.DEFAULT delimiter and the specified
IoFilterCodec.
public TextLineConsumer(java.nio.charset.Charset charset,
org.apache.mina.filter.codec.textline.LineDelimiter delimiter,
IoFilterCodec codec)
IoFilterCodec. Delimiter
LineDelimiter.AUTO is not allowed.
| Method Detail |
|---|
public IoFilterCodec getCodec()
getCodec in interface DataConsumerpublic int getMinLineLength()
public void setMinLineLength(int minLineLength)
#consume(NextFilter, IoBuffer)
will return false immediately. The default value is 0.
public int getMaxLineLength()
public void setMaxLineLength(int maxLineLength)
BufferDataException. The default
value is 1024 (1KB).
public boolean consume(org.apache.mina.core.filterchain.IoFilter.NextFilter nextFilter,
org.apache.mina.core.buffer.IoBuffer in)
throws java.lang.Exception
DataConsumerIoFilterCodec#unwrap(NextFilter, IoBuffer) method.
consume in interface DataConsumerjava.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||