Class TextRowDecoder
java.lang.Object
org.mariadb.jdbc.client.result.rowdecoder.TextRowDecoder
- All Implemented Interfaces:
RowDecoder
TEXT rows decoder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> T
decode
(Codec<T> codec, Calendar cal, StandardReadableByteBuf rowBuf, MutableInt fieldLength, ColumnDecoder[] metadataList, MutableInt fieldIndex, Context context) Decode data according to data type.boolean
decodeBoolean
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) Decode data according to boolean.byte
decodeByte
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) Decode data according to byte.decodeDate
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Calendar cal, Context context) Decode data according to Date.double
decodeDouble
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) Decode data according to double.float
decodeFloat
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) Decode data according to float.int
decodeInt
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) Decode data according to int.long
decodeLong
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) Decode data according to long.short
decodeShort
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) Decode data according to short.decodeString
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context) Decode data according to String.decodeTime
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Calendar cal, Context context) Decode data according to Time.decodeTimestamp
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Calendar cal, Context context) Decode data according to Timestamp.defaultDecode
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context) Decode data according to data type.int
setPosition
(int newIndex, MutableInt fieldIndex, int maxIndex, StandardReadableByteBuf rowBuf, byte[] nullBitmap, ColumnDecoder[] metadataList) Set length and pos indicator to asked index.boolean
wasNull
(byte[] nullBitmap, MutableInt fieldIndex, MutableInt fieldLength) Indicate if last decoded value was null
-
Constructor Details
-
TextRowDecoder
public TextRowDecoder()
-
-
Method Details
-
decode
public <T> T decode(Codec<T> codec, Calendar cal, StandardReadableByteBuf rowBuf, MutableInt fieldLength, ColumnDecoder[] metadataList, MutableInt fieldIndex, Context context) throws SQLException Description copied from interface:RowDecoder
Decode data according to data type.- Specified by:
decode
in 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:
SQLException
- if any decoding error occurs
-
defaultDecode
public Object defaultDecode(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context) throws SQLException Description copied from interface:RowDecoder
Decode data according to data type.- Specified by:
defaultDecode
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field lengthcontext
- connection context- Returns:
- data
- Throws:
SQLException
- if any decoding error occurs
-
decodeString
public String decodeString(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context) throws SQLException Description copied from interface:RowDecoder
Decode data according to String.- Specified by:
decodeString
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field lengthcontext
- connection Context- Returns:
- data
- Throws:
SQLException
- if data type cannot be decoded to String value
-
decodeByte
public byte decodeByte(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException Description copied from interface:RowDecoder
Decode data according to byte.- Specified by:
decodeByte
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
SQLException
- if data type cannot be decoded to byte value
-
decodeBoolean
public boolean decodeBoolean(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException Description copied from interface:RowDecoder
Decode data according to boolean.- Specified by:
decodeBoolean
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
SQLException
- if data type cannot be decoded to boolean value
-
decodeDate
public Date decodeDate(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Calendar cal, Context context) throws SQLException Description copied from interface:RowDecoder
Decode data according to Date.- Specified by:
decodeDate
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field lengthcal
- calendarcontext
- current context- Returns:
- data
- Throws:
SQLException
- if data type cannot be decoded to Date value
-
decodeTime
public Time decodeTime(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Calendar cal, Context context) throws SQLException Description copied from interface:RowDecoder
Decode data according to Time.- Specified by:
decodeTime
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field lengthcal
- calendarcontext
- connection context- Returns:
- data
- Throws:
SQLException
- if data type cannot be decoded to Time value
-
decodeTimestamp
public Timestamp decodeTimestamp(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Calendar cal, Context context) throws SQLException Description copied from interface:RowDecoder
Decode data according to Timestamp.- Specified by:
decodeTimestamp
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field lengthcal
- calendarcontext
- connection context- Returns:
- data
- Throws:
SQLException
- if data type cannot be decoded to Timestamp value
-
decodeShort
public short decodeShort(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException Description copied from interface:RowDecoder
Decode data according to short.- Specified by:
decodeShort
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
SQLException
- if data type cannot be decoded to short value
-
decodeInt
public int decodeInt(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException Description copied from interface:RowDecoder
Decode data according to int.- Specified by:
decodeInt
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
SQLException
- if data type cannot be decoded to int value
-
decodeLong
public long decodeLong(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException Description copied from interface:RowDecoder
Decode data according to long.- Specified by:
decodeLong
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
SQLException
- if data type cannot be decoded to long value
-
decodeFloat
public float decodeFloat(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException Description copied from interface:RowDecoder
Decode data according to float.- Specified by:
decodeFloat
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
SQLException
- if data type cannot be decoded to float value
-
decodeDouble
public double decodeDouble(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException Description copied from interface:RowDecoder
Decode data according to double.- Specified by:
decodeDouble
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
SQLException
- if data type cannot be decoded to double value
-
wasNull
Description copied from interface:RowDecoder
Indicate if last decoded value was null- Specified by:
wasNull
in 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:
setPosition
in 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
-