Class TextRowDecoder
- java.lang.Object
-
- org.mariadb.jdbc.client.result.rowdecoder.TextRowDecoder
-
- All Implemented Interfaces:
RowDecoder
public class TextRowDecoder extends java.lang.Object implements RowDecoder
TEXT rows decoder
-
-
Constructor Summary
Constructors Constructor Description TextRowDecoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tdecode(Codec<T> codec, java.util.Calendar cal, StandardReadableByteBuf rowBuf, MutableInt fieldLength, ColumnDecoder[] metadataList, MutableInt fieldIndex, Context context)Decode data according to data type.booleandecodeBoolean(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength)Decode data according to boolean.bytedecodeByte(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength)Decode data according to byte.java.sql.DatedecodeDate(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, java.util.Calendar cal, Context context)Decode data according to Date.doubledecodeDouble(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength)Decode data according to double.floatdecodeFloat(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength)Decode data according to float.intdecodeInt(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength)Decode data according to int.longdecodeLong(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength)Decode data according to long.shortdecodeShort(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength)Decode data according to short.java.lang.StringdecodeString(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context)Decode data according to String.java.sql.TimedecodeTime(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, java.util.Calendar cal, Context context)Decode data according to Time.java.sql.TimestampdecodeTimestamp(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, java.util.Calendar cal, Context context)Decode data according to Timestamp.java.lang.ObjectdefaultDecode(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context)Decode data according to data type.intsetPosition(int newIndex, MutableInt fieldIndex, int maxIndex, StandardReadableByteBuf rowBuf, byte[] nullBitmap, ColumnDecoder[] metadataList)Set length and pos indicator to asked index.booleanwasNull(byte[] nullBitmap, MutableInt fieldIndex, MutableInt fieldLength)Indicate if last decoded value was null
-
-
-
Method Detail
-
decode
public <T> T decode(Codec<T> codec, java.util.Calendar cal, StandardReadableByteBuf rowBuf, MutableInt fieldLength, ColumnDecoder[] metadataList, MutableInt fieldIndex, Context context) throws java.sql.SQLException
Description copied from interface:RowDecoderDecode data according to data type.- Specified by:
decodein interfaceRowDecoder- Type Parameters:
T- Codec default return type- Parameters:
codec- current codeccal- calendarrowBuf- row bufferfieldLength- field lengthmetadataList- metadatasfieldIndex- field indexcontext- connection context- Returns:
- default object according to metadata
- Throws:
java.sql.SQLException- if any decoding error occurs
-
defaultDecode
public java.lang.Object defaultDecode(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context) throws java.sql.SQLException
Description copied from interface:RowDecoderDecode data according to data type.- Specified by:
defaultDecodein interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field lengthcontext- connection context- Returns:
- data
- Throws:
java.sql.SQLException- if any decoding error occurs
-
decodeString
public java.lang.String decodeString(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context) throws java.sql.SQLException
Description copied from interface:RowDecoderDecode data according to String.- Specified by:
decodeStringin interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field lengthcontext- connection Context- Returns:
- data
- Throws:
java.sql.SQLException- if data type cannot be decoded to String value
-
decodeByte
public byte decodeByte(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws java.sql.SQLException
Description copied from interface:RowDecoderDecode data according to byte.- Specified by:
decodeBytein interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field length- Returns:
- data
- Throws:
java.sql.SQLException- if data type cannot be decoded to byte value
-
decodeBoolean
public boolean decodeBoolean(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws java.sql.SQLException
Description copied from interface:RowDecoderDecode data according to boolean.- Specified by:
decodeBooleanin interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field length- Returns:
- data
- Throws:
java.sql.SQLException- if data type cannot be decoded to boolean value
-
decodeDate
public java.sql.Date decodeDate(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, java.util.Calendar cal, Context context) throws java.sql.SQLException
Description copied from interface:RowDecoderDecode data according to Date.- Specified by:
decodeDatein interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field lengthcal- calendarcontext- current context- Returns:
- data
- Throws:
java.sql.SQLException- if data type cannot be decoded to Date value
-
decodeTime
public java.sql.Time decodeTime(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, java.util.Calendar cal, Context context) throws java.sql.SQLException
Description copied from interface:RowDecoderDecode data according to Time.- Specified by:
decodeTimein interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field lengthcal- calendarcontext- connection context- Returns:
- data
- Throws:
java.sql.SQLException- if data type cannot be decoded to Time value
-
decodeTimestamp
public java.sql.Timestamp decodeTimestamp(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, java.util.Calendar cal, Context context) throws java.sql.SQLException
Description copied from interface:RowDecoderDecode data according to Timestamp.- Specified by:
decodeTimestampin interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field lengthcal- calendarcontext- connection context- Returns:
- data
- Throws:
java.sql.SQLException- if data type cannot be decoded to Timestamp value
-
decodeShort
public short decodeShort(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws java.sql.SQLException
Description copied from interface:RowDecoderDecode data according to short.- Specified by:
decodeShortin interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field length- Returns:
- data
- Throws:
java.sql.SQLException- if data type cannot be decoded to short value
-
decodeInt
public int decodeInt(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws java.sql.SQLException
Description copied from interface:RowDecoderDecode data according to int.- Specified by:
decodeIntin interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field length- Returns:
- data
- Throws:
java.sql.SQLException- if data type cannot be decoded to int value
-
decodeLong
public long decodeLong(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws java.sql.SQLException
Description copied from interface:RowDecoderDecode data according to long.- Specified by:
decodeLongin interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field length- Returns:
- data
- Throws:
java.sql.SQLException- if data type cannot be decoded to long value
-
decodeFloat
public float decodeFloat(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws java.sql.SQLException
Description copied from interface:RowDecoderDecode data according to float.- Specified by:
decodeFloatin interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field length- Returns:
- data
- Throws:
java.sql.SQLException- if data type cannot be decoded to float value
-
decodeDouble
public double decodeDouble(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws java.sql.SQLException
Description copied from interface:RowDecoderDecode data according to double.- Specified by:
decodeDoublein interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field length- Returns:
- data
- Throws:
java.sql.SQLException- if data type cannot be decoded to double value
-
wasNull
public boolean wasNull(byte[] nullBitmap, MutableInt fieldIndex, MutableInt fieldLength)Description copied from interface:RowDecoderIndicate if last decoded value was null- Specified by:
wasNullin interfaceRowDecoder- Parameters:
nullBitmap- null bitmapfieldIndex- field indexfieldLength- field length- Returns:
- true if last value was null
-
setPosition
public int setPosition(int newIndex, MutableInt fieldIndex, int maxIndex, StandardReadableByteBuf rowBuf, byte[] nullBitmap, ColumnDecoder[] metadataList)Set length and pos indicator to asked index.- Specified by:
setPositionin interfaceRowDecoder- Parameters:
newIndex- index (1 is first).fieldIndex- current field indexmaxIndex- maximum indexrowBuf- row buffernullBitmap- null bitmapmetadataList- metadata list- Returns:
- new index to read data
-
-