final class CrossConverters
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private Agent |
agent_ |
private static java.math.BigDecimal |
bdMaxByteValue__ |
private static java.math.BigDecimal |
bdMaxDoubleValue__ |
private static java.math.BigDecimal |
bdMaxFloatValue__ |
private static java.math.BigDecimal |
bdMaxIntValue__ |
private static java.math.BigDecimal |
bdMaxLongValue__ |
private static java.math.BigDecimal |
bdMaxShortValue__ |
private static java.math.BigDecimal |
bdMinByteValue__ |
private static java.math.BigDecimal |
bdMinDoubleValue__ |
private static java.math.BigDecimal |
bdMinFloatValue__ |
private static java.math.BigDecimal |
bdMinIntValue__ |
private static java.math.BigDecimal |
bdMinLongValue__ |
private static java.math.BigDecimal |
bdMinShortValue__ |
private static java.math.BigDecimal |
bdOne__ |
private static java.math.BigDecimal |
bdZero__ |
static int |
UNKNOWN_LENGTH
Value used to signal unknown length of data.
|
Constructor and Description |
---|
CrossConverters(Agent agent) |
Modifier and Type | Method and Description |
---|---|
private static java.sql.Date |
date_valueOf(java.lang.String s,
java.util.Calendar cal)
Convert a string to a date in the specified calendar.
|
private static int |
digit(char ch)
Convert a character to a digit.
|
(package private) java.math.BigDecimal |
getBigDecimalFromString(java.lang.String source) |
(package private) boolean |
getBooleanFromDouble(double source) |
(package private) boolean |
getBooleanFromFloat(float source) |
(package private) boolean |
getBooleanFromInt(int source) |
(package private) boolean |
getBooleanFromLong(long source) |
(package private) boolean |
getBooleanFromShort(short source) |
(package private) boolean |
getBooleanFromString(java.lang.String source)
Get a boolean value from a CHAR column.
|
(package private) byte |
getByteFromBoolean(boolean source) |
(package private) byte |
getByteFromDouble(double source) |
(package private) byte |
getByteFromFloat(float source) |
(package private) byte |
getByteFromInt(int source) |
(package private) byte |
getByteFromLong(long source) |
(package private) byte |
getByteFromShort(short source) |
(package private) byte |
getByteFromString(java.lang.String source) |
(package private) java.sql.Date |
getDateFromString(java.lang.String source,
java.util.Calendar cal) |
(package private) double |
getDoubleFromBoolean(boolean source) |
(package private) double |
getDoubleFromString(java.lang.String source) |
(package private) float |
getFloatFromBoolean(boolean source) |
(package private) float |
getFloatFromDouble(double source) |
(package private) float |
getFloatFromString(java.lang.String source) |
static int |
getInputJdbcType(int jdbcType)
Convert the input targetJdbcType to the correct JdbcType used by CrossConverters.
|
(package private) int |
getIntFromBoolean(boolean source) |
(package private) int |
getIntFromDouble(double source) |
(package private) int |
getIntFromFloat(float source) |
(package private) int |
getIntFromLong(long source) |
(package private) int |
getIntFromString(java.lang.String source) |
(package private) long |
getLongFromBoolean(boolean source) |
(package private) long |
getLongFromDouble(double source) |
(package private) long |
getLongFromFloat(float source) |
(package private) long |
getLongFromString(java.lang.String source) |
(package private) short |
getShortFromBoolean(boolean source) |
(package private) short |
getShortFromDouble(double source) |
(package private) short |
getShortFromFloat(float source) |
(package private) short |
getShortFromInt(int source) |
(package private) short |
getShortFromLong(long source) |
(package private) short |
getShortFromString(java.lang.String source) |
(package private) java.lang.String |
getStringFromBytes(byte[] bytes) |
(package private) java.sql.Time |
getTimeFromString(java.lang.String source,
java.util.Calendar cal) |
(package private) java.sql.Timestamp |
getTimestampFromString(java.lang.String source,
java.util.Calendar cal) |
private static void |
initDatePortion(java.util.Calendar cal,
java.lang.String date)
Initialize the date components of a
java.util.Calendar from
a string on the format YYYY-MM-DD. |
private static void |
initTimePortion(java.util.Calendar cal,
java.lang.String time)
Initialize the time components of a
java.util.Calendar from a
string on the format HH:MM:SS. |
private static byte |
parseByte(java.lang.String s) |
private static int |
parseInt(java.lang.String s) |
private static long |
parseLong(java.lang.String s) |
private static short |
parseShort(java.lang.String s) |
(package private) boolean |
setBooleanFromObject(java.lang.Object source,
int sourceType) |
(package private) byte |
setByteFromObject(java.lang.Object source,
int sourceType) |
private byte[] |
setBytesFromStream(java.io.InputStream is,
int length) |
(package private) java.lang.Object |
setObject(int targetType,
java.math.BigDecimal source) |
(package private) java.lang.Object |
setObject(int targetType,
java.sql.Blob source) |
(package private) java.lang.Object |
setObject(int targetType,
boolean source) |
(package private) java.lang.Object |
setObject(int targetType,
byte source) |
(package private) java.lang.Object |
setObject(int targetType,
byte[] source) |
(package private) java.lang.Object |
setObject(int targetType,
java.sql.Clob source) |
(package private) java.lang.Object |
setObject(int targetType,
java.sql.Date source) |
(package private) java.lang.Object |
setObject(int targetType,
double source) |
(package private) java.lang.Object |
setObject(int targetType,
float source) |
(package private) java.lang.Object |
setObject(int targetType,
int source) |
(package private) java.lang.Object |
setObject(int targetType,
long source) |
(package private) java.lang.Object |
setObject(int targetType,
java.lang.Object source) |
(package private) java.lang.Object |
setObject(int targetType,
java.io.Reader source,
int length) |
(package private) java.lang.Object |
setObject(int targetType,
short source) |
(package private) java.lang.Object |
setObject(int targetDriverType,
java.lang.String source) |
(package private) java.lang.Object |
setObject(int targetType,
java.sql.Time source) |
(package private) java.lang.Object |
setObject(int targetType,
java.sql.Timestamp source) |
(package private) java.lang.Object |
setObjectFromBinaryStream(int targetType,
java.io.InputStream source,
int length) |
(package private) java.lang.Object |
setObjectFromCharacterStream(int targetType,
java.io.InputStream source,
java.nio.charset.Charset encoding,
int length) |
private java.lang.String |
setStringFromReader(java.io.Reader r,
int length) |
private java.lang.String |
setStringFromStream(java.io.InputStream is,
java.nio.charset.Charset encoding,
int length) |
private static void |
skipPadding(java.lang.String s,
int i,
int length) |
private static java.sql.Time |
time_valueOf(java.lang.String s,
java.util.Calendar cal)
Convert a string to a time in the specified calendar.
|
private static java.sql.Timestamp |
timestamp_valueOf(java.lang.String s,
java.util.Calendar cal)
Convert a string to a timestamp in the specified calendar.
|
public static final int UNKNOWN_LENGTH
private static final java.math.BigDecimal bdMaxByteValue__
private static final java.math.BigDecimal bdMinByteValue__
private static final java.math.BigDecimal bdMaxShortValue__
private static final java.math.BigDecimal bdMinShortValue__
private static final java.math.BigDecimal bdMaxIntValue__
private static final java.math.BigDecimal bdMinIntValue__
private static final java.math.BigDecimal bdMaxLongValue__
private static final java.math.BigDecimal bdMinLongValue__
private static final java.math.BigDecimal bdMaxFloatValue__
private static final java.math.BigDecimal bdMinFloatValue__
private static final java.math.BigDecimal bdMaxDoubleValue__
private static final java.math.BigDecimal bdMinDoubleValue__
private static final java.math.BigDecimal bdZero__
private static final java.math.BigDecimal bdOne__
private final Agent agent_
CrossConverters(Agent agent)
final java.lang.Object setObject(int targetType, boolean source) throws SqlException
SqlException
final java.lang.Object setObject(int targetType, byte source) throws SqlException
SqlException
final java.lang.Object setObject(int targetType, short source) throws SqlException
SqlException
final java.lang.Object setObject(int targetType, int source) throws SqlException
SqlException
final boolean setBooleanFromObject(java.lang.Object source, int sourceType) throws SqlException
SqlException
final byte setByteFromObject(java.lang.Object source, int sourceType) throws SqlException
SqlException
final java.lang.Object setObject(int targetType, long source) throws SqlException
SqlException
final java.lang.Object setObject(int targetType, float source) throws SqlException
SqlException
final java.lang.Object setObject(int targetType, double source) throws SqlException
SqlException
final java.lang.Object setObject(int targetType, java.math.BigDecimal source) throws SqlException
SqlException
final java.lang.Object setObject(int targetType, java.sql.Date source) throws SqlException
SqlException
final java.lang.Object setObject(int targetType, java.sql.Time source) throws SqlException
SqlException
final java.lang.Object setObject(int targetType, java.sql.Timestamp source) throws SqlException
SqlException
final java.lang.Object setObject(int targetDriverType, java.lang.String source) throws SqlException
SqlException
public static int getInputJdbcType(int jdbcType)
final java.lang.Object setObject(int targetType, byte[] source) throws SqlException
SqlException
final java.lang.Object setObject(int targetType, java.io.Reader source, int length) throws SqlException
SqlException
private java.lang.String setStringFromReader(java.io.Reader r, int length) throws SqlException
SqlException
final java.lang.Object setObjectFromCharacterStream(int targetType, java.io.InputStream source, java.nio.charset.Charset encoding, int length) throws SqlException
SqlException
private java.lang.String setStringFromStream(java.io.InputStream is, java.nio.charset.Charset encoding, int length) throws SqlException
SqlException
final java.lang.Object setObject(int targetType, java.sql.Blob source) throws SqlException
SqlException
final java.lang.Object setObjectFromBinaryStream(int targetType, java.io.InputStream source, int length) throws SqlException
SqlException
private byte[] setBytesFromStream(java.io.InputStream is, int length) throws SqlException
SqlException
final java.lang.Object setObject(int targetType, java.sql.Clob source) throws SqlException
SqlException
final java.lang.Object setObject(int targetType, java.lang.Object source) throws SqlException
SqlException
final boolean getBooleanFromShort(short source) throws SqlException
SqlException
final boolean getBooleanFromInt(int source) throws SqlException
SqlException
final boolean getBooleanFromLong(long source) throws SqlException
SqlException
final boolean getBooleanFromFloat(float source) throws SqlException
SqlException
final boolean getBooleanFromDouble(double source) throws SqlException
SqlException
final boolean getBooleanFromString(java.lang.String source)
Get a boolean value from a CHAR column. In order to match the embedded driver and JCC we return false iff the CHAR value is "0" or "false".
Leading and trailing whitespace is removed from the input string before it's compared to "0" and "false". No other normalization is performed. Specifically, no case conversion is performed, so the comparison is case sensitive, and everything that doesn't exactly match "0" or "false" will be considered true.
source
- the value of a CHAR columnfinal byte getByteFromShort(short source) throws SqlException
SqlException
final byte getByteFromInt(int source) throws SqlException
SqlException
final byte getByteFromLong(long source) throws SqlException
SqlException
final byte getByteFromFloat(float source) throws SqlException
SqlException
final byte getByteFromDouble(double source) throws SqlException
SqlException
final byte getByteFromBoolean(boolean source) throws SqlException
SqlException
final byte getByteFromString(java.lang.String source) throws SqlException
SqlException
final short getShortFromInt(int source) throws SqlException
SqlException
final short getShortFromLong(long source) throws SqlException
SqlException
final short getShortFromFloat(float source) throws SqlException
SqlException
final short getShortFromDouble(double source) throws SqlException
SqlException
final short getShortFromBoolean(boolean source) throws SqlException
SqlException
final short getShortFromString(java.lang.String source) throws SqlException
SqlException
final int getIntFromLong(long source) throws SqlException
SqlException
final int getIntFromFloat(float source) throws SqlException
SqlException
final int getIntFromDouble(double source) throws SqlException
SqlException
final int getIntFromBoolean(boolean source) throws SqlException
SqlException
final int getIntFromString(java.lang.String source) throws SqlException
SqlException
final long getLongFromFloat(float source) throws SqlException
SqlException
final long getLongFromDouble(double source) throws SqlException
SqlException
final long getLongFromBoolean(boolean source) throws SqlException
SqlException
final long getLongFromString(java.lang.String source) throws SqlException
SqlException
final float getFloatFromDouble(double source) throws SqlException
SqlException
final float getFloatFromBoolean(boolean source) throws SqlException
SqlException
final float getFloatFromString(java.lang.String source) throws SqlException
SqlException
final double getDoubleFromBoolean(boolean source) throws SqlException
SqlException
final double getDoubleFromString(java.lang.String source) throws SqlException
SqlException
final java.math.BigDecimal getBigDecimalFromString(java.lang.String source) throws SqlException
SqlException
final java.lang.String getStringFromBytes(byte[] bytes) throws SqlException
SqlException
final java.sql.Date getDateFromString(java.lang.String source, java.util.Calendar cal) throws SqlException
SqlException
final java.sql.Time getTimeFromString(java.lang.String source, java.util.Calendar cal) throws SqlException
SqlException
final java.sql.Timestamp getTimestampFromString(java.lang.String source, java.util.Calendar cal) throws SqlException
SqlException
private static java.sql.Date date_valueOf(java.lang.String s, java.util.Calendar cal)
Date.valueOf()
.s
- the string to parsecal
- the calendar (or null to use the default calendar)Date
value that represents the date in the
calendar cal
java.lang.IllegalArgumentException
- if the format of the string is invalidprivate static void initDatePortion(java.util.Calendar cal, java.lang.String date)
java.util.Calendar
from
a string on the format YYYY-MM-DD. All other components are left
untouched.cal
- the calendar whose date components to initializedate
- a string representing a datejava.lang.IllegalArgumentException
- if the date string is not on the
format YYYY-MM-DDprivate static int digit(char ch)
ch
- the characterjava.lang.IllegalArgumentException
- if ch
doesn't represent a digitprivate static java.sql.Time time_valueOf(java.lang.String s, java.util.Calendar cal)
java.sql.Time.valueOf()
.s
- the string to parsecal
- the calendar (or null to use the default calendar)java.sql.Time
value that represents the time in the
calendar cal
java.lang.IllegalArgumentException
- if the format of the string is invalidprivate static void initTimePortion(java.util.Calendar cal, java.lang.String time)
java.util.Calendar
from a
string on the format HH:MM:SS. All other components are left untouched.cal
- the calendar whose time components to initializetime
- a string representing a timejava.lang.IllegalArgumentException
- if the time string is not on the
format HH:MM:SSprivate static java.sql.Timestamp timestamp_valueOf(java.lang.String s, java.util.Calendar cal)
java.sql.Timestamp.valueOf()
.s
- the string to parsecal
- the calendar (or null to use the default calendar)java.sql.Timestamp
value that represents the timestamp
in the calendar cal
java.lang.IllegalArgumentException
- if the format of the string is invalidprivate static byte parseByte(java.lang.String s) throws java.lang.NumberFormatException
java.lang.NumberFormatException
private static short parseShort(java.lang.String s) throws java.lang.NumberFormatException
java.lang.NumberFormatException
private static int parseInt(java.lang.String s) throws java.lang.NumberFormatException
java.lang.NumberFormatException
private static long parseLong(java.lang.String s) throws java.lang.NumberFormatException
java.lang.NumberFormatException
private static void skipPadding(java.lang.String s, int i, int length) throws java.lang.NumberFormatException
java.lang.NumberFormatException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.