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 intcolumnCountprotected ColumnDefinitionPacket[]columnsprivate Configurationconfprotected intindexprotected intlengthprivate java.util.Map<java.lang.String,java.lang.Integer>mapperprotected static intNULL_LENGTHprotected ReadableByteBufreadBuf
-
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 voidcheckIndexAndSetPosition(int index)abstract <T> Tdecode(Codec<T> codec, java.util.Calendar calendar)abstract booleandecodeBoolean()abstract bytedecodeByte()abstract doubledecodeDouble()abstract floatdecodeFloat()abstract intdecodeInt()abstract longdecodeLong()abstract shortdecodeShort()booleangetBooleanValue(int index)bytegetByteValue(int index)doublegetDoubleValue(int index)floatgetFloatValue(int index)intgetIndex(java.lang.String label)intgetIntValue(int index)longgetLongValue(int index)shortgetShortValue(int index)<T> TgetValue(int index, java.lang.Class<T> type, java.util.Calendar calendar)<T> TgetValue(int index, Codec<T> codec, java.util.Calendar cal)Get value.<T> TgetValue(java.lang.String label, Codec<T> codec, java.util.Calendar cal)abstract voidsetPosition(int position)voidsetRow(byte[] buf)abstract booleanwasNull()
-
-
-
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.SQLExceptionGet 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
-
-