Package org.mariadb.jdbc.codec
Class RowDecoder
- java.lang.Object
-
- org.mariadb.jdbc.codec.RowDecoder
-
- Direct Known Subclasses:
BinaryRowDecoder
,TextRowDecoder
public abstract class RowDecoder extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected int
columnCount
protected ColumnDefinitionPacket[]
columns
private Configuration
conf
protected int
index
protected int
length
private java.util.Map<java.lang.String,java.lang.Integer>
mapper
protected static int
NULL_LENGTH
protected ReadableByteBuf
readBuf
-
Constructor Summary
Constructors Constructor Description RowDecoder(int columnCount, ColumnDefinitionPacket[] columns, Configuration conf)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private void
checkIndexAndSetPosition(int index)
abstract <T> T
decode(Codec<T> codec, java.util.Calendar calendar)
abstract boolean
decodeBoolean()
abstract byte
decodeByte()
abstract double
decodeDouble()
abstract float
decodeFloat()
abstract int
decodeInt()
abstract long
decodeLong()
abstract short
decodeShort()
boolean
getBooleanValue(int index)
byte
getByteValue(int index)
double
getDoubleValue(int index)
float
getFloatValue(int index)
int
getIndex(java.lang.String label)
int
getIntValue(int index)
long
getLongValue(int index)
short
getShortValue(int index)
<T> T
getValue(int index, java.lang.Class<T> type, java.util.Calendar calendar)
<T> T
getValue(int index, Codec<T> codec, java.util.Calendar cal)
Get value.<T> T
getValue(java.lang.String label, Codec<T> codec, java.util.Calendar cal)
abstract void
setPosition(int position)
void
setRow(byte[] buf)
abstract boolean
wasNull()
-
-
-
Field Detail
-
NULL_LENGTH
protected static final int NULL_LENGTH
- See Also:
- Constant Field Values
-
conf
private final Configuration conf
-
readBuf
protected final ReadableByteBuf readBuf
-
columns
protected final ColumnDefinitionPacket[] columns
-
length
protected int length
-
index
protected int index
-
columnCount
protected final int columnCount
-
mapper
private java.util.Map<java.lang.String,java.lang.Integer> mapper
-
-
Constructor Detail
-
RowDecoder
public RowDecoder(int columnCount, ColumnDefinitionPacket[] columns, Configuration conf)
-
-
Method Detail
-
setRow
public void setRow(byte[] buf)
-
setPosition
public abstract void setPosition(int position)
-
decode
public abstract <T> T decode(Codec<T> codec, java.util.Calendar calendar) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
decodeByte
public abstract byte decodeByte() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
decodeBoolean
public abstract boolean decodeBoolean() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
decodeShort
public abstract short decodeShort() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
decodeInt
public abstract int decodeInt() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
decodeLong
public abstract long decodeLong() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
decodeFloat
public abstract float decodeFloat() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
decodeDouble
public abstract double decodeDouble() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
getValue
public <T> T getValue(int index, java.lang.Class<T> type, java.util.Calendar calendar) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
wasNull
public abstract boolean wasNull()
-
checkIndexAndSetPosition
private void checkIndexAndSetPosition(int index) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
getValue
public <T> T getValue(int index, Codec<T> codec, java.util.Calendar cal) throws java.sql.SQLException
Get value.- Parameters:
index
- REAL index (0 = first)codec
- codec- Returns:
- value
- Throws:
java.sql.SQLException
- if cannot decode value
-
getByteValue
public byte getByteValue(int index) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
getBooleanValue
public boolean getBooleanValue(int index) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
getShortValue
public short getShortValue(int index) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
getIntValue
public int getIntValue(int index) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
getLongValue
public long getLongValue(int index) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
getFloatValue
public float getFloatValue(int index) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
getDoubleValue
public double getDoubleValue(int index) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
getValue
public <T> T getValue(java.lang.String label, Codec<T> codec, java.util.Calendar cal) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
getIndex
public int getIndex(java.lang.String label) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
-