Add javadocs to methods that user may override and make the others final
This commit is contained in:
parent
660729bd56
commit
a8af577423
@ -212,13 +212,21 @@ public class DelimiterBasedFrameDecoder extends ByteToMessageDecoder {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
|
||||
protected final void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
|
||||
Object decoded = decode(ctx, in);
|
||||
if (decoded != null) {
|
||||
out.add(decoded);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a frame out of the {@link ByteBuf} and return it.
|
||||
*
|
||||
* @param ctx the {@link ChannelHandlerContext} which this {@link ByteToMessageDecoder} belongs to
|
||||
* @param buffer the {@link ByteBuf} from which to read data
|
||||
* @return frame the {@link ByteBuf} which represent the frame or {@code null} if no frame could
|
||||
* be created.
|
||||
*/
|
||||
protected Object decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
|
||||
if (lineBasedDecoder != null) {
|
||||
return lineBasedDecoder.decode(ctx, buffer);
|
||||
|
@ -54,13 +54,21 @@ public class FixedLengthFrameDecoder extends ByteToMessageDecoder {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
|
||||
protected final void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
|
||||
Object decoded = decode(ctx, in);
|
||||
if (decoded != null) {
|
||||
out.add(decoded);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a frame out of the {@link ByteBuf} and return it.
|
||||
*
|
||||
* @param ctx the {@link ChannelHandlerContext} which this {@link ByteToMessageDecoder} belongs to
|
||||
* @param in the {@link ByteBuf} from which to read data
|
||||
* @return frame the {@link ByteBuf} which represent the frame or {@code null} if no frame could
|
||||
* be created.
|
||||
*/
|
||||
protected Object decode(
|
||||
@SuppressWarnings("UnusedParameters") ChannelHandlerContext ctx, ByteBuf in) throws Exception {
|
||||
if (in.readableBytes() < frameLength) {
|
||||
|
@ -348,13 +348,21 @@ public class LengthFieldBasedFrameDecoder extends ByteToMessageDecoder {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
|
||||
protected final void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
|
||||
Object decoded = decode(ctx, in);
|
||||
if (decoded != null) {
|
||||
out.add(decoded);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a frame out of the {@link ByteBuf} and return it.
|
||||
*
|
||||
* @param ctx the {@link ChannelHandlerContext} which this {@link ByteToMessageDecoder} belongs to
|
||||
* @param in the {@link ByteBuf} from which to read data
|
||||
* @return frame the {@link ByteBuf} which represent the frame or {@code null} if no frame could
|
||||
* be created.
|
||||
*/
|
||||
protected Object decode(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
|
||||
if (discardingTooLongFrame) {
|
||||
long bytesToDiscard = this.bytesToDiscard;
|
||||
|
@ -70,13 +70,21 @@ public class LineBasedFrameDecoder extends ByteToMessageDecoder {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
|
||||
protected final void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
|
||||
Object decoded = decode(ctx, in);
|
||||
if (decoded != null) {
|
||||
out.add(decoded);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a frame out of the {@link ByteBuf} and return it.
|
||||
*
|
||||
* @param ctx the {@link ChannelHandlerContext} which this {@link ByteToMessageDecoder} belongs to
|
||||
* @param buffer the {@link ByteBuf} from which to read data
|
||||
* @return frame the {@link ByteBuf} which represent the frame or {@code null} if no frame could
|
||||
* be created.
|
||||
*/
|
||||
protected Object decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
|
||||
final int eol = findEndOfLine(buffer);
|
||||
if (!discarding) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user