public class ValueMetaBase extends Object implements ValueMetaInterface
DEFAULT_INTEGER_LENGTH, SORT_TYPE_ASCENDING, SORT_TYPE_DESCENDING, SORT_TYPE_NOT_SORTED, sortTypeCodes, STORAGE_TYPE_BINARY_STRING, STORAGE_TYPE_INDEXED, STORAGE_TYPE_NORMAL, storageTypeCodes, TRIM_TYPE_BOTH, TRIM_TYPE_LEFT, TRIM_TYPE_NONE, TRIM_TYPE_RIGHT, TYPE_BIGNUMBER, TYPE_BINARY, TYPE_BOOLEAN, TYPE_DATE, TYPE_INET, TYPE_INTEGER, TYPE_NONE, TYPE_NUMBER, TYPE_SERIALIZABLE, TYPE_STRING, TYPE_TIMESTAMP, typeCodes| Constructor and Description |
|---|
ValueMetaBase() |
ValueMetaBase(DataInputStream inputStream)
Deprecated.
in favor of a combination of
ValueMetaFactory.createValueMeta() and the loadMetaData() method. |
ValueMetaBase(Node node) |
ValueMetaBase(String name) |
ValueMetaBase(String name,
int type) |
ValueMetaBase(String name,
int type,
Comparator<Object> comparator) |
ValueMetaBase(String name,
int type,
int storageType)
Deprecated.
use
ValueMetaBase(String, int) and setStorageType(int) instead |
ValueMetaBase(String name,
int type,
int length,
int precision) |
ValueMetaBase(String name,
int type,
int length,
int precision,
Comparator<Object> comparator) |
| Modifier and Type | Method and Description |
|---|---|
ValueMetaBase |
clone() |
Object |
cloneValueData(Object object)
Clones the data.
|
int |
compare(Object data1,
Object data2)
Compare 2 values of the same data type
|
int |
compare(Object data1,
ValueMetaInterface meta2,
Object data2)
Compare 2 values of the same data type
|
protected void |
compareStorageAndActualFormat() |
protected Boolean |
convertBigNumberToBoolean(BigDecimal number) |
protected Date |
convertBigNumberToDate(BigDecimal number) |
protected String |
convertBigNumberToString(BigDecimal number) |
Object |
convertBinaryStringToNativeType(byte[] binary)
Convert the binary data to the actual data type.
- byte[] --> Long (Integer) - byte[] --> Double (Number) - byte[] --> BigDecimal (BigNumber) - byte[] --> Date (Date) - byte[] --> Boolean (Boolean) - byte[] --> byte[] (Binary) |
protected String |
convertBinaryStringToString(byte[] binary)
Converts a byte[] stored in a binary string storage type into a String;
|
protected BigDecimal |
convertBooleanToBigNumber(Boolean bool) |
protected Long |
convertBooleanToInteger(Boolean bool) |
protected Double |
convertBooleanToNumber(Boolean bool) |
protected String |
convertBooleanToString(Boolean bool) |
Object |
convertData(ValueMetaInterface meta2,
Object data2)
Convert the specified data to the data type specified in this object.
|
Object |
convertDataCompatible(ValueMetaInterface meta2,
Object data2)
Convert the specified data to the data type specified in this object.
|
Object |
convertDataFromString(String pol,
ValueMetaInterface convertMeta,
String nullIf,
String ifNull,
int trim_type)
Convert the specified string to the data type specified in this object.
|
Object |
convertDataUsingConversionMetaData(Object data)
Convert an object to the data type specified in the conversion metadata
|
protected BigDecimal |
convertDateToBigNumber(Date date) |
protected String |
convertDateToCompatibleString(Date date) |
protected Long |
convertDateToInteger(Date date) |
protected Double |
convertDateToNumber(Date date) |
protected String |
convertDateToString(Date date) |
protected Boolean |
convertIntegerToBoolean(Long number) |
protected String |
convertIntegerToCompatibleString(Long integer) |
protected Date |
convertIntegerToDate(Long number) |
protected String |
convertIntegerToString(Long integer) |
Object |
convertNormalStorageTypeToBinaryString(Object object)
Convert a normal storage type to a binary string object.
|
protected Boolean |
convertNumberToBoolean(Double number) |
protected String |
convertNumberToCompatibleString(Double number) |
protected Date |
convertNumberToDate(Double number) |
protected String |
convertNumberToString(Double number) |
protected BigDecimal |
convertStringToBigNumber(String string) |
protected byte[] |
convertStringToBinaryString(String string) |
static Boolean |
convertStringToBoolean(String string) |
protected Date |
convertStringToDate(String string) |
protected Long |
convertStringToInteger(String string) |
protected Double |
convertStringToNumber(String string) |
Object |
convertToBinaryStringStorageType(Object object)
Converts the specified data object to the binary string storage type.
|
Object |
convertToNormalStorageType(Object object)
Converts the specified data object to the normal storage type.
|
Value |
createOriginalValue(Object data)
Create an old-style value for backward compatibility reasons
|
protected void |
determineSingleByteEncoding() |
void |
drawValue(PrimitiveGCInterface gc,
Object value)
This method draws the value using the supplied graphical context.
|
static String[] |
getAllTypes()
Get an array of String describing the possible types a Value can have.
|
BigDecimal |
getBigNumber(Object object)
Convert the supplied data to a BigNumber
|
byte[] |
getBinary(Object object)
Convert the supplied data to binary data
|
byte[] |
getBinaryString(Object object)
convert the supplied data to a binary string representation (for writing text)
|
Boolean |
getBoolean(Object object)
Convert the supplied data to a Boolean
|
Locale |
getCollatorLocale()
Get the current Locale of the collator
|
int |
getCollatorStrength()
Returns the strength of the collator.
|
String |
getComments()
Gets the comments.
|
String |
getCompatibleString(Object object)
Convert the supplied data to a String compatible with version 2.5.
|
String |
getConversionMask()
Deprecated.
|
ValueMetaInterface |
getConversionMetadata()
This conversion metadata can be attached to a String object to see where it came from and with which mask it was
generated, the encoding, the local languages used, padding, etc.
|
String |
getCurrencySymbol()
Gets the currency symbol.
|
String |
getDatabaseColumnTypeDefinition(DatabaseInterface databaseInterface,
String tk,
String pk,
boolean use_autoinc,
boolean add_fieldname,
boolean add_cr)
Ask for suggestions as to how this plugin data type should be represented in the specified database interface
|
String |
getDataXML(Object object)
Returns an XML representation of the row data.
|
Date |
getDate(Object object)
Convert the supplied data to a Date
|
SimpleDateFormat |
getDateFormat()
Gets the date format.
|
Locale |
getDateFormatLocale()
Returns the locale from the date format.
|
TimeZone |
getDateFormatTimeZone() |
DecimalFormat |
getDecimalFormat()
Gets the decimal format.
|
DecimalFormat |
getDecimalFormat(boolean useBigDecimal)
Gets the decimal format.
|
String |
getDecimalSymbol()
Gets the decimal symbol.
|
String |
getFormatMask()
Gets a formatting mask using this value's meta information.
|
String |
getGroupingSymbol()
Gets the grouping symbol.
|
Object[] |
getIndex()
Gets the index.
|
Long |
getInteger(Object object)
Convert the supplied data to an Integer
|
int |
getLength()
Gets the length.
|
ValueMetaInterface |
getMetadataPreview(DatabaseMeta databaseMeta,
ResultSet rs)
This is a similar method to getValueFromSQLType, but it uses a
ResultSet from a call to DatabaseMetaData#getColumns(String, String, String, String)
The ResultSet must be positioned correctly on the row to read.
|
String |
getMetaXML()
Returns an XML representation of the row metadata.
|
String |
getName()
Gets the name.
|
Object |
getNativeDataType(Object object)
This method gives you the native Java data type corresponding to the value meta-data.
|
Class<?> |
getNativeDataTypeClass()
Return the Java class that represents the "native" storage type of this ValueMeta
|
Double |
getNumber(Object object)
Convert the supplied data to a Number
|
long |
getNumberOfBinaryStringConversions()
Returns the number of binary string to native data type conversions done with this object conversions
|
String |
getOrigin()
Gets the origin.
|
protected void |
getOriginalColumnMetadata(ValueMetaInterface v,
ResultSetMetaData rm,
int index,
boolean ignoreLength) |
int |
getOriginalColumnType()
store original JDBC RecordSetMetaData for later use
|
String |
getOriginalColumnTypeName()
Gets the original column type name.
|
int |
getOriginalNullable()
Gets the original nullable.
|
int |
getOriginalPrecision()
Gets the original precision.
|
int |
getOriginalScale()
Gets the original scale.
|
boolean |
getOriginalSigned()
Gets the original signed.
|
int |
getPrecision()
Gets the precision.
|
protected int |
getQuotesBeforeSymbol(String df,
String symbols) |
ValueMetaInterface |
getStorageMetadata()
Returns the storage Meta data that is needed for internal conversion from BinaryString or String to the specified
type.
|
int |
getStorageType()
Gets the storage type.
|
static int |
getStorageType(String desc)
Convert the String description of a storage type to an integer type.
|
static String |
getStorageTypeCode(int storageType) |
String |
getStorageTypeDesc()
Return the storage type of a value in a textual form: "normal", "binary-string", "indexes"
|
String |
getString(Object object)
Convert the supplied data to a String
|
String |
getStringEncoding()
Gets the string encoding.
|
int |
getTrimType()
Gets the trim type.
|
static int |
getTrimTypeByCode(String tt) |
static int |
getTrimTypeByDesc(String tt) |
static String |
getTrimTypeCode(int i) |
static String[] |
getTrimTypeCodes() |
static String |
getTrimTypeDesc(int i) |
static String[] |
getTrimTypeDescriptions() |
int |
getType()
Gets the type.
|
static int |
getType(String desc)
Convert the String description of a type to an integer type.
|
String |
getTypeDesc()
Return the type of a value in a textual form: "String", "Number", "Integer", "Boolean", "Date", ...
|
static String |
getTypeDesc(int type)
TODO: change Desc to Code all over the place.
|
static String[] |
getTypes()
get an array of String describing the possible types a Value can have.
|
Object |
getValue(Node node)
Convert a data XML node to an Object that corresponds to the metadata.
|
Object |
getValueData(Value value)
Extracts the primitive data from an old style Value object
|
Object |
getValueFromResultSet(DatabaseInterface databaseInterface,
ResultSet resultSet,
int index)
Get a value from a result set column based on the current value metadata
|
ValueMetaInterface |
getValueFromSQLType(DatabaseMeta databaseMeta,
String name,
ResultSetMetaData rm,
int index,
boolean ignoreLength,
boolean lazyConversion)
Investigate JDBC result set metadata at the specified index.
|
int |
hashCode(Object object)
Calculate the hashcode of the specified data object
|
boolean |
isBigNumber()
Checks whether or not the value is a Big Number
|
boolean |
isBigNumberFormatting() |
boolean |
isBinary()
Checks whether or not this value is of type Binary
|
boolean |
isBoolean()
Checks whether or not this value is a boolean
|
boolean |
isCaseInsensitive()
Returns a true of the value object is case insensitive, false if it is case sensitive,
|
boolean |
isCollatorDisabled()
Returns a true of the value object is case insensitive, false if it is case sensitive,
|
boolean |
isDate()
Checks whether or not this value is a Date
|
boolean |
isDateFormatLenient()
Returns true of the date format is leniant, false if it is strict.
|
boolean |
isIgnoreWhitespace()
Is Ignore Whitespace
Only applicable for TYPE_STRING comparisons
|
boolean |
isInteger()
Checks whether or not this value is an Integer
|
boolean |
isLargeTextField()
Returns true if this is a large text field (CLOB, TEXT) with arbitrary length.
|
boolean |
isLenientStringToNumber() |
boolean |
isNull(Object data)
Determine if an object is null.
|
boolean |
isNumber()
Checks whether or not the value is a Number
|
boolean |
isNumeric()
Checks whether or not this Value is Numeric A Value is numeric if it is either of type Number or Integer
|
static boolean |
isNumeric(int t)
Checks whether or not the specified type is either Integer or Number
|
boolean |
isOriginalAutoIncrement()
Checks if is original auto increment.
|
int |
isOriginalNullable()
Checks if is original nullable.
|
boolean |
isOriginalSigned()
Checks if is original signed.
|
boolean |
isOutputPaddingEnabled()
Returns true if output padding is enabled (padding to specified length).
|
boolean |
isSerializableType()
Checks whether or not this value is of type Serializable
|
boolean |
isSingleByteEncoding() |
boolean |
isSortedAscending() |
boolean |
isSortedDescending()
Returns whether or not the value should be sorted in descending order.
|
boolean |
isStorageBinaryString()
Checks if is storage binary string.
|
boolean |
isStorageIndexed()
Checks if is storage indexed.
|
boolean |
isStorageNormal()
Checks if is storage normal.
|
boolean |
isString()
Checks whether or not the value is a String.
|
protected BigDecimal |
readBigNumber(DataInputStream inputStream) |
protected byte[] |
readBinary(DataInputStream inputStream) |
protected byte[] |
readBinaryString(DataInputStream inputStream) |
protected Boolean |
readBoolean(DataInputStream inputStream) |
Object |
readData(DataInputStream inputStream)
De-serialize data from an inputstream.
|
protected Date |
readDate(DataInputStream inputStream) |
protected Long |
readInteger(DataInputStream inputStream) |
void |
readMetaData(DataInputStream inputStream)
Load the attributes of this particular value meta object from the input stream.
|
protected Double |
readNumber(DataInputStream inputStream) |
protected Integer |
readSmallInteger(DataInputStream inputStream) |
protected String |
readString(DataInputStream inputStream) |
boolean |
requiresRealClone()
Returns true if the data type requires a real copy.
|
void |
setBigNumberFormatting(boolean bigNumberFormatting) |
void |
setCaseInsensitive(boolean caseInsensitive)
Sets whether or not the value object is case sensitive.
|
void |
setCollatorDisabled(boolean collatorDisabled)
Sets whether or not the value object should be sorted according to a locale using a collator
|
void |
setCollatorLocale(Locale locale)
Sets the Locale of the collator
|
void |
setCollatorStrength(int collatorStrength)
Sets the strength of the collator.
|
void |
setComments(String comments)
Sets the comments for the object implementing the interface.
|
void |
setConversionMask(String conversionMask)
Sets the conversion mask.
|
void |
setConversionMetadata(ValueMetaInterface conversionMetadata)
Attach conversion metadata to a String object to see where it came from and with which mask it was generated, the
encoding, the local languages used, padding, etc.
|
void |
setCurrencySymbol(String currencySymbol)
Sets the currency symbol.
|
void |
setDateFormatLenient(boolean dateFormatLenient)
Set to true if the date formatting (parsing) is to be set to lenient.
|
void |
setDateFormatLocale(Locale dateFormatLocale)
Sets the locale of the date format.
|
void |
setDateFormatTimeZone(TimeZone dateFormatTimeZone) |
void |
setDecimalSymbol(String decimalSymbol)
Sets the decimal symbol.
|
protected void |
setDefaultConversionMask() |
void |
setGroupingSymbol(String groupingSymbol)
Sets the grouping symbol.
|
void |
setIgnoreWhitespace(boolean ignoreWhitespace)
Set Ignore Whitespace
Only applicable for TYPE_STRING comparisons
|
void |
setIndex(Object[] index)
Sets the index.
|
void |
setLargeTextField(boolean largeTextField)
Set to true if the this is to be a large text field (CLOB, TEXT) with arbitrary length.
|
void |
setLength(int length)
Sets the length.
|
void |
setLength(int length,
int precision)
Sets the length.
|
void |
setLenientStringToNumber(boolean lenientStringToNumber) |
void |
setName(String name)
Sets the name.
|
void |
setNumberOfBinaryStringConversions(long numberOfBinaryStringConversions)
Returns the number of binary string to native data type done with this object conversions to set.
|
void |
setOrigin(String origin)
Sets the origin.
|
void |
setOriginalAutoIncrement(boolean originalAutoIncrement)
Sets the original auto increment.
|
void |
setOriginalColumnType(int originalColumnType)
Sets the original column type.
|
void |
setOriginalColumnTypeName(String originalColumnTypeName)
Sets the original column type name.
|
void |
setOriginalNullable(int originalNullable)
Sets the original nullable.
|
void |
setOriginalPrecision(int originalPrecision)
Sets the original precision.
|
void |
setOriginalScale(int originalScale)
Sets the original scale.
|
void |
setOriginalSigned(boolean originalSigned)
Sets the original signed.
|
void |
setOutputPaddingEnabled(boolean outputPaddingEnabled)
Set to true if output padding is to be enabled (padding to specified length).
|
void |
setPrecision(int precision)
Sets the precision.
|
void |
setPreparedStatementValue(DatabaseMeta databaseMeta,
PreparedStatement preparedStatement,
int index,
Object data)
Set a value on a JDBC prepared statement on the specified position
|
void |
setSortedDescending(boolean sortedDescending)
Sets whether or not the value should be set in a descending order.
|
void |
setStorageMetadata(ValueMetaInterface storageMetadata)
Sets the storage meta data.
|
void |
setStorageType(int storageType)
Sets the storage type.
|
void |
setStringEncoding(String encoding)
Sets the string encoding.
|
void |
setTrimType(int trimType)
Sets the trim type.
|
void |
setType(int type)
Deprecated.
|
String |
toString() |
String |
toStringMeta()
a String text representation of this Value, optionally padded to the specified length
|
protected String |
trim(String string) |
protected void |
writeBigNumber(DataOutputStream outputStream,
BigDecimal number) |
protected void |
writeBinary(DataOutputStream outputStream,
byte[] binary) |
protected void |
writeBinaryString(DataOutputStream outputStream,
byte[] binaryString) |
protected void |
writeBoolean(DataOutputStream outputStream,
Boolean bool) |
void |
writeData(DataOutputStream outputStream,
Object object)
Serialize the content of the specified data object to the outputStream.
|
protected void |
writeDate(DataOutputStream outputStream,
Date date) |
protected void |
writeInteger(DataOutputStream outputStream,
Integer number) |
protected void |
writeInteger(DataOutputStream outputStream,
Long number) |
void |
writeMeta(DataOutputStream outputStream)
Write the content of this class (metadata) to the specified output stream.
|
protected void |
writeNumber(DataOutputStream outputStream,
Double number) |
protected void |
writeString(DataOutputStream outputStream,
String string) |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetTypeCode, getTypeDescriptionpublic static final String DEFAULT_INTEGER_PARSE_MASK
public static final String DEFAULT_NUMBER_PARSE_MASK
public static final String DEFAULT_BIGNUMBER_PARSE_MASK
public static final String DEFAULT_DATE_PARSE_MASK
public static final String DEFAULT_TIMESTAMP_PARSE_MASK
public static final String DEFAULT_INTEGER_FORMAT_MASK
public static final String DEFAULT_NUMBER_FORMAT_MASK
public static final String DEFAULT_BIG_NUMBER_FORMAT_MASK
public static final String DEFAULT_DATE_FORMAT_MASK
public static final String DEFAULT_TIMESTAMP_FORMAT_MASK
protected static Class<?> PKG
public static final String XML_META_TAG
public static final String XML_DATA_TAG
public static final String COMPATIBLE_DATE_FORMAT_PATTERN
protected String name
protected int length
protected int precision
protected int type
protected int trimType
protected int storageType
protected String origin
protected String comments
protected Object[] index
protected String conversionMask
protected String stringEncoding
protected String decimalSymbol
protected String groupingSymbol
protected String currencySymbol
protected int collatorStrength
protected boolean caseInsensitive
protected boolean collatorDisabled
protected boolean sortedDescending
protected boolean outputPaddingEnabled
protected boolean largeTextField
protected Locale collatorLocale
protected Collator collator
protected Locale dateFormatLocale
protected TimeZone dateFormatTimeZone
protected boolean dateFormatLenient
protected boolean lenientStringToNumber
protected boolean ignoreTimezone
protected boolean emptyStringAndNullAreDifferent
protected SimpleDateFormat dateFormat
protected boolean dateFormatChanged
protected DecimalFormat decimalFormat
protected boolean decimalFormatChanged
protected ValueMetaInterface storageMetadata
protected boolean identicalFormat
protected ValueMetaInterface conversionMetadata
protected long numberOfBinaryStringConversions
protected boolean bigNumberFormatting
protected int originalColumnType
protected String originalColumnTypeName
protected int originalPrecision
protected int originalScale
protected boolean originalAutoIncrement
protected int originalNullable
protected boolean originalSigned
protected boolean ignoreWhitespace
protected final Comparator<Object> comparator
public static final String[] trimTypeCode
public static final String[] trimTypeDesc
public static final String[] SINGLE_BYTE_ENCODINGS
protected static SimpleDateFormat compatibleDateFormat
public ValueMetaBase()
public ValueMetaBase(String name)
public ValueMetaBase(String name, int type)
public ValueMetaBase(String name, int type, Comparator<Object> comparator)
public ValueMetaBase(String name, int type, int length, int precision)
public ValueMetaBase(String name, int type, int length, int precision, Comparator<Object> comparator)
public ValueMetaBase(Node node) throws KettleException
KettleException@Deprecated public ValueMetaBase(DataInputStream inputStream) throws KettleFileException, KettleEOFException
ValueMetaFactory.createValueMeta() and the loadMetaData() method.inputStream - KettleFileExceptionKettleEOFException@Deprecated public ValueMetaBase(String name, int type, int storageType)
ValueMetaBase(String, int) and setStorageType(int) insteadname - type - storageType - protected void setDefaultConversionMask()
protected void determineSingleByteEncoding()
public ValueMetaBase clone()
clone in interface ValueMetaInterfaceclone in class Objectpublic String getComments()
ValueMetaInterfacegetComments in interface ValueMetaInterfacepublic void setComments(String comments)
ValueMetaInterfacesetComments in interface ValueMetaInterfacecomments - the comments to setpublic Object[] getIndex()
ValueMetaInterfacegetIndex in interface ValueMetaInterfacepublic void setIndex(Object[] index)
ValueMetaInterfacesetIndex in interface ValueMetaInterfaceindex - the index to setpublic int getLength()
ValueMetaInterfacegetLength in interface ValueMetaInterfacepublic void setLength(int length)
ValueMetaInterfacesetLength in interface ValueMetaInterfacelength - the length to setpublic void setLength(int length,
int precision)
ValueMetaInterfacesetLength in interface ValueMetaInterfacelength - the length to setprecision - the precisionpublic String getName()
ValueMetaInterfacegetName in interface ValueMetaInterfacepublic void setName(String name)
ValueMetaInterfacesetName in interface ValueMetaInterfacename - the name to setpublic String getOrigin()
ValueMetaInterfacegetOrigin in interface ValueMetaInterfacepublic void setOrigin(String origin)
ValueMetaInterfacesetOrigin in interface ValueMetaInterfaceorigin - the origin to setpublic int getPrecision()
ValueMetaInterfacegetPrecision in interface ValueMetaInterfacepublic void setPrecision(int precision)
ValueMetaInterfacesetPrecision in interface ValueMetaInterfaceprecision - the precision to setpublic int getStorageType()
ValueMetaInterfacegetStorageType in interface ValueMetaInterfacepublic void setStorageType(int storageType)
ValueMetaInterfacesetStorageType in interface ValueMetaInterfacestorageType - the storageType to setpublic boolean isStorageNormal()
ValueMetaInterfaceisStorageNormal in interface ValueMetaInterfacepublic boolean isStorageIndexed()
ValueMetaInterfaceisStorageIndexed in interface ValueMetaInterfacepublic boolean isStorageBinaryString()
ValueMetaInterfaceisStorageBinaryString in interface ValueMetaInterfacepublic int getType()
ValueMetaInterfacegetType in interface ValueMetaInterface@Deprecated public void setType(int type)
ValueMetaInterfacesetType in interface ValueMetaInterfacetype - the type to set@Deprecated public String getConversionMask()
ValueMetaInterfacegetConversionMask in interface ValueMetaInterfacepublic void setConversionMask(String conversionMask)
ValueMetaInterfacesetConversionMask in interface ValueMetaInterfaceconversionMask - the conversionMask to setpublic String getStringEncoding()
ValueMetaInterfacegetStringEncoding in interface ValueMetaInterfacepublic void setStringEncoding(String encoding)
ValueMetaInterfacesetStringEncoding in interface ValueMetaInterfaceencoding - the encoding to setpublic String getDecimalSymbol()
ValueMetaInterfacegetDecimalSymbol in interface ValueMetaInterfacepublic void setDecimalSymbol(String decimalSymbol)
ValueMetaInterfacesetDecimalSymbol in interface ValueMetaInterfacedecimalSymbol - the decimalSymbol to setpublic String getGroupingSymbol()
ValueMetaInterfacegetGroupingSymbol in interface ValueMetaInterfacepublic void setGroupingSymbol(String groupingSymbol)
ValueMetaInterfacesetGroupingSymbol in interface ValueMetaInterfacegroupingSymbol - the groupingSymbol to setpublic String getCurrencySymbol()
ValueMetaInterfacegetCurrencySymbol in interface ValueMetaInterfacepublic void setCurrencySymbol(String currencySymbol)
ValueMetaInterfacesetCurrencySymbol in interface ValueMetaInterfacecurrencySymbol - the currencySymbol to setpublic boolean isCaseInsensitive()
ValueMetaInterfaceisCaseInsensitive in interface ValueMetaInterfacepublic void setCaseInsensitive(boolean caseInsensitive)
ValueMetaInterfacesetCaseInsensitive in interface ValueMetaInterfacecaseInsensitive - the caseInsensitive to setpublic boolean isCollatorDisabled()
ValueMetaInterfaceisCollatorDisabled in interface ValueMetaInterfacepublic void setCollatorDisabled(boolean collatorDisabled)
ValueMetaInterfacesetCollatorDisabled in interface ValueMetaInterfacecollatorDisabled - the collatorDisabled to setpublic Locale getCollatorLocale()
ValueMetaInterfacegetCollatorLocale in interface ValueMetaInterfacepublic void setCollatorLocale(Locale locale)
ValueMetaInterfacesetCollatorLocale in interface ValueMetaInterfacepublic int getCollatorStrength()
ValueMetaInterfacegetCollatorStrength in interface ValueMetaInterfacepublic void setCollatorStrength(int collatorStrength)
throws IllegalArgumentException
ValueMetaInterfacesetCollatorStrength in interface ValueMetaInterfacecollatorStrength - the collatorStrength to setIllegalArgumentExceptionpublic boolean isSortedDescending()
ValueMetaInterfaceisSortedDescending in interface ValueMetaInterfacepublic void setSortedDescending(boolean sortedDescending)
ValueMetaInterfacesetSortedDescending in interface ValueMetaInterfacesortedDescending - the sortedDescending to setpublic boolean isOutputPaddingEnabled()
ValueMetaInterfaceisOutputPaddingEnabled in interface ValueMetaInterfacepublic void setOutputPaddingEnabled(boolean outputPaddingEnabled)
ValueMetaInterfacesetOutputPaddingEnabled in interface ValueMetaInterfaceoutputPaddingEnabled - Set to true if output padding is to be enabled (padding to specified length)public boolean isLargeTextField()
ValueMetaInterfaceisLargeTextField in interface ValueMetaInterfacepublic void setLargeTextField(boolean largeTextField)
ValueMetaInterfacesetLargeTextField in interface ValueMetaInterfacelargeTextField - Set to true if this is to be a large text field (CLOB, TEXT) with arbitrary length.public boolean isDateFormatLenient()
ValueMetaInterfaceValueMetaInterface.setDateFormatLenient(boolean)isDateFormatLenient in interface ValueMetaInterfacepublic void setDateFormatLenient(boolean dateFormatLenient)
ValueMetaInterface15 - (December = 12) = 3 = March.Set to false for stricter formatting validation.
setDateFormatLenient in interface ValueMetaInterfacedateFormatLenient - the dateFormatLenient to setpublic Locale getDateFormatLocale()
ValueMetaInterfacegetDateFormatLocale in interface ValueMetaInterfacepublic void setDateFormatLocale(Locale dateFormatLocale)
ValueMetaInterfacesetDateFormatLocale in interface ValueMetaInterfacedateFormatLocale - the dateFormatLocale to setprotected Date convertStringToDate(String string) throws KettleValueException
KettleValueExceptionprotected BigDecimal convertDateToBigNumber(Date date)
protected Date convertBigNumberToDate(BigDecimal number)
protected String convertNumberToString(Double number) throws KettleValueException
KettleValueExceptionprotected String convertNumberToCompatibleString(Double number) throws KettleValueException
KettleValueExceptionprotected Double convertStringToNumber(String string) throws KettleValueException
KettleValueExceptionpublic SimpleDateFormat getDateFormat()
ValueMetaInterfacegetDateFormat in interface ValueMetaInterfacepublic DecimalFormat getDecimalFormat()
ValueMetaInterfacegetDecimalFormat in interface ValueMetaInterfacepublic DecimalFormat getDecimalFormat(boolean useBigDecimal)
ValueMetaInterfacegetDecimalFormat in interface ValueMetaInterfaceuseBigDecimal - the use big decimalpublic String getFormatMask()
ValueMetaInterfacegetFormatMask in interface ValueMetaInterfaceprotected String convertIntegerToString(Long integer) throws KettleValueException
KettleValueExceptionprotected String convertIntegerToCompatibleString(Long integer) throws KettleValueException
KettleValueExceptionprotected Long convertStringToInteger(String string) throws KettleValueException
KettleValueExceptionprotected String convertBigNumberToString(BigDecimal number) throws KettleValueException
KettleValueExceptionprotected BigDecimal convertStringToBigNumber(String string) throws KettleValueException
KettleValueExceptionprotected BigDecimal convertBooleanToBigNumber(Boolean bool)
protected Boolean convertBigNumberToBoolean(BigDecimal number)
protected String convertBinaryStringToString(byte[] binary) throws KettleValueException
binary - the binary stringKettleValueExceptionpublic Object convertToNormalStorageType(Object object) throws KettleValueException
convertToNormalStorageType in interface ValueMetaInterfaceobject - the data object to convertKettleValueException - In case there is a data conversion error.public Object convertToBinaryStringStorageType(Object object) throws KettleValueException
convertToBinaryStringStorageType in interface ValueMetaInterfaceobject - the data object to convertKettleValueException - In case there is a data conversion error.public Object convertBinaryStringToNativeType(byte[] binary) throws KettleValueException
convertBinaryStringToNativeType in interface ValueMetaInterfacebinary - KettleValueExceptionpublic Object convertNormalStorageTypeToBinaryString(Object object) throws KettleValueException
ValueMetaInterfaceconvertNormalStorageTypeToBinaryString in interface ValueMetaInterfaceobject - The object expressed in a normal storage typeKettleValueException - in case there is a data conversion errorprotected byte[] convertStringToBinaryString(String string) throws KettleValueException
KettleValueExceptionpublic Object cloneValueData(Object object) throws KettleValueException
cloneValueData in interface ValueMetaInterfaceobject - the objectKettleValueException - the kettle value exceptionpublic String getCompatibleString(Object object) throws KettleValueException
ValueMetaInterfacegetCompatibleString in interface ValueMetaInterfaceKettleValueExceptionpublic String getString(Object object) throws KettleValueException
ValueMetaInterfacegetString in interface ValueMetaInterfaceKettleValueExceptionpublic Double getNumber(Object object) throws KettleValueException
ValueMetaInterfacegetNumber in interface ValueMetaInterfaceKettleValueExceptionpublic Long getInteger(Object object) throws KettleValueException
ValueMetaInterfacegetInteger in interface ValueMetaInterfaceKettleValueExceptionpublic BigDecimal getBigNumber(Object object) throws KettleValueException
ValueMetaInterfacegetBigNumber in interface ValueMetaInterfaceKettleValueExceptionpublic Boolean getBoolean(Object object) throws KettleValueException
ValueMetaInterfacegetBoolean in interface ValueMetaInterfaceKettleValueExceptionpublic Date getDate(Object object) throws KettleValueException
ValueMetaInterfacegetDate in interface ValueMetaInterfaceKettleValueExceptionpublic byte[] getBinary(Object object) throws KettleValueException
ValueMetaInterfacegetBinary in interface ValueMetaInterfaceKettleValueExceptionpublic byte[] getBinaryString(Object object) throws KettleValueException
ValueMetaInterfacegetBinaryString in interface ValueMetaInterfaceKettleValueExceptionpublic boolean isString()
isString in interface ValueMetaInterfacepublic boolean isDate()
isDate in interface ValueMetaInterfacepublic boolean isBigNumber()
isBigNumber in interface ValueMetaInterfacepublic boolean isNumber()
isNumber in interface ValueMetaInterfacepublic boolean isBoolean()
isBoolean in interface ValueMetaInterfacepublic boolean isSerializableType()
isSerializableType in interface ValueMetaInterfacepublic boolean isBinary()
isBinary in interface ValueMetaInterfacepublic boolean isInteger()
isInteger in interface ValueMetaInterfacepublic boolean isNumeric()
isNumeric in interface ValueMetaInterfacepublic static final boolean isNumeric(int t)
t - the type to checkpublic boolean isSortedAscending()
public String getTypeDesc()
getTypeDesc in interface ValueMetaInterfacepublic String getStorageTypeDesc()
public String toStringMeta()
toStringMeta in interface ValueMetaInterfacepublic void writeData(DataOutputStream outputStream, Object object) throws KettleFileException
ValueMetaInterfacewriteData in interface ValueMetaInterfaceoutputStream - the outputstream to write toobject - the data object to serializeKettleFileException - in case a I/O error occurspublic Object readData(DataInputStream inputStream) throws KettleFileException, KettleEOFException, SocketTimeoutException
ValueMetaInterfacereadData in interface ValueMetaInterfaceinputStream - the input stream to read fromKettleFileException - in case a I/O error occursKettleEOFException - When we have read all the data there is to readSocketTimeoutException - In case there is a timeout (when set on a socket) during readingprotected void writeString(DataOutputStream outputStream, String string) throws IOException
IOExceptionprotected void writeBinaryString(DataOutputStream outputStream, byte[] binaryString) throws IOException
IOExceptionprotected String readString(DataInputStream inputStream) throws IOException
IOExceptionprotected byte[] readBinaryString(DataInputStream inputStream) throws IOException
IOExceptionprotected void writeBigNumber(DataOutputStream outputStream, BigDecimal number) throws IOException
IOExceptionprotected BigDecimal readBigNumber(DataInputStream inputStream) throws IOException
IOExceptionprotected void writeDate(DataOutputStream outputStream, Date date) throws IOException
IOExceptionprotected Date readDate(DataInputStream inputStream) throws IOException
IOExceptionprotected void writeBoolean(DataOutputStream outputStream, Boolean bool) throws IOException
IOExceptionprotected Boolean readBoolean(DataInputStream inputStream) throws IOException
IOExceptionprotected void writeNumber(DataOutputStream outputStream, Double number) throws IOException
IOExceptionprotected Double readNumber(DataInputStream inputStream) throws IOException
IOExceptionprotected void writeInteger(DataOutputStream outputStream, Long number) throws IOException
IOExceptionprotected Long readInteger(DataInputStream inputStream) throws IOException
IOExceptionprotected void writeInteger(DataOutputStream outputStream, Integer number) throws IOException
IOExceptionprotected Integer readSmallInteger(DataInputStream inputStream) throws IOException
IOExceptionprotected void writeBinary(DataOutputStream outputStream, byte[] binary) throws IOException
IOExceptionprotected byte[] readBinary(DataInputStream inputStream) throws IOException
IOExceptionpublic void writeMeta(DataOutputStream outputStream) throws KettleFileException
ValueMetaInterfacewriteMeta in interface ValueMetaInterfaceoutputStream - the outputstream to write toKettleFileException - in case a I/O error occurspublic void readMetaData(DataInputStream inputStream) throws KettleFileException, KettleEOFException
readMetaData in interface ValueMetaInterfaceinputStream - the input stream to read fromKettleFileException - In case there was a IO problemKettleEOFException - If we reached the end of the streampublic String getMetaXML() throws IOException
ValueMetaInterfacegetMetaXML in interface ValueMetaInterfaceIOException - Thrown in case there is an (Base64/GZip) decoding problempublic String getDataXML(Object object) throws IOException
ValueMetaInterfacegetDataXML in interface ValueMetaInterfaceobject - The data to serialize as XMLIOException - Thrown in case there is an (Base64/GZip) decoding problempublic Object getValue(Node node) throws KettleException
getValue in interface ValueMetaInterfacenode - the node to retrieve the data value fromIOException - thrown in case there is a problem with the XML to object conversionKettleException - thrown in case there is a problem with the XML to object conversionpublic static final String[] getTypes()
public static final String[] getAllTypes()
public static final String getTypeDesc(int type)
type - the typepublic static final int getType(String desc)
desc - The description of the type to convertpublic static final int getStorageType(String desc)
desc - The description of the storage type to convertpublic static final String getStorageTypeCode(int storageType)
public boolean isNull(Object data) throws KettleValueException
isNull in interface ValueMetaInterfacedata - the object to testKettleValueException - in case there is a conversion error (only thrown in case of lazy conversion)public int compare(Object data1, Object data2) throws KettleValueException
compare in interface ValueMetaInterfacedata1 - the first valuedata2 - the second valueKettleValueException - In case we get conversion errorspublic int compare(Object data1, ValueMetaInterface meta2, Object data2) throws KettleValueException
compare in interface ValueMetaInterfacedata1 - the first valuemeta2 - the second value's metadatadata2 - the second valueKettleValueException - In case we get conversion errorspublic Object convertData(ValueMetaInterface meta2, Object data2) throws KettleValueException
convertData in interface ValueMetaInterfacemeta2 - the metadata of the object to be converteddata2 - the data of the object to be convertedKettleValueException - in case there is a data conversion errorpublic Object convertDataCompatible(ValueMetaInterface meta2, Object data2) throws KettleValueException
convertDataCompatible in interface ValueMetaInterfacemeta2 - the metadata of the object to be converteddata2 - the data of the object to be convertedKettleValueException - in case there is a data conversion errorpublic Object convertDataUsingConversionMetaData(Object data) throws KettleValueException
convertDataUsingConversionMetaData in interface ValueMetaInterfacedata - The dataKettleValueException - in case there is a conversion error.public Object convertDataFromString(String pol, ValueMetaInterface convertMeta, String nullIf, String ifNull, int trim_type) throws KettleValueException
convertDataFromString in interface ValueMetaInterfacepol - the string to be convertedconvertMeta - the metadata of the object (only string type) to be convertednullIf - set the object to null if pos equals nullif (IgnoreCase)ifNull - set the object to ifNull when pol is empty or nulltrim_type - the trim type to be used (ValueMetaInterface.TRIM_TYPE_XXX)KettleValueException - in case there is a data conversion errorpublic int hashCode(Object object) throws KettleValueException
hashCode in interface ValueMetaInterfaceobject - the data value to calculate a hashcode forKettleValueExceptionpublic Value createOriginalValue(Object data) throws KettleValueException
createOriginalValue in interface ValueMetaInterfacedata - the data to store in the valueKettleValueException - case there is a data conversion problempublic Object getValueData(Value value) throws KettleValueException
getValueData in interface ValueMetaInterfacevalue - the old style Value objectKettleValueException - case there is a data conversion problempublic ValueMetaInterface getStorageMetadata()
ValueMetaInterfacegetStorageMetadata in interface ValueMetaInterfacepublic void setStorageMetadata(ValueMetaInterface storageMetadata)
ValueMetaInterfacesetStorageMetadata in interface ValueMetaInterfacestorageMetadata - the storageMetadata to setprotected void compareStorageAndActualFormat()
public int getTrimType()
ValueMetaInterfacegetTrimType in interface ValueMetaInterfacepublic void setTrimType(int trimType)
ValueMetaInterfacesetTrimType in interface ValueMetaInterfacetrimType - the trimType to setpublic static final int getTrimTypeByCode(String tt)
public static final int getTrimTypeByDesc(String tt)
public static final String getTrimTypeCode(int i)
public static final String getTrimTypeDesc(int i)
public ValueMetaInterface getConversionMetadata()
ValueMetaInterfacegetConversionMetadata in interface ValueMetaInterfacepublic void setConversionMetadata(ValueMetaInterface conversionMetadata)
ValueMetaInterfacesetConversionMetadata in interface ValueMetaInterfaceconversionMetadata - the conversionMetadata to setpublic boolean isSingleByteEncoding()
isSingleByteEncoding in interface ValueMetaInterfacepublic long getNumberOfBinaryStringConversions()
ValueMetaInterfacegetNumberOfBinaryStringConversions in interface ValueMetaInterfacepublic void setNumberOfBinaryStringConversions(long numberOfBinaryStringConversions)
ValueMetaInterfacesetNumberOfBinaryStringConversions in interface ValueMetaInterfacenumberOfBinaryStringConversions - the number of binary string to native data type done with this object conversions to setpublic boolean isOriginalAutoIncrement()
ValueMetaInterfaceisOriginalAutoIncrement in interface ValueMetaInterfacepublic void setOriginalAutoIncrement(boolean originalAutoIncrement)
ValueMetaInterfacesetOriginalAutoIncrement in interface ValueMetaInterfaceoriginalAutoIncrement - the new original auto incrementpublic int getOriginalColumnType()
ValueMetaInterfacegetOriginalColumnType in interface ValueMetaInterfaceResultSetMetaDatapublic void setOriginalColumnType(int originalColumnType)
ValueMetaInterfacesetOriginalColumnType in interface ValueMetaInterfaceoriginalColumnType - the new original column typepublic String getOriginalColumnTypeName()
ValueMetaInterfacegetOriginalColumnTypeName in interface ValueMetaInterfacepublic void setOriginalColumnTypeName(String originalColumnTypeName)
ValueMetaInterfacesetOriginalColumnTypeName in interface ValueMetaInterfaceoriginalColumnTypeName - the new original column type namepublic int isOriginalNullable()
ValueMetaInterfaceisOriginalNullable in interface ValueMetaInterfacepublic void setOriginalNullable(int originalNullable)
ValueMetaInterfacesetOriginalNullable in interface ValueMetaInterfaceoriginalNullable - the new original nullablepublic int getOriginalPrecision()
ValueMetaInterfacegetOriginalPrecision in interface ValueMetaInterfacepublic void setOriginalPrecision(int originalPrecision)
ValueMetaInterfacesetOriginalPrecision in interface ValueMetaInterfaceoriginalPrecision - the new original precisionpublic int getOriginalScale()
ValueMetaInterfacegetOriginalScale in interface ValueMetaInterfacepublic int getOriginalNullable()
ValueMetaInterfacegetOriginalNullable in interface ValueMetaInterfacepublic boolean getOriginalSigned()
ValueMetaInterfacegetOriginalSigned in interface ValueMetaInterfacepublic void setOriginalScale(int originalScale)
ValueMetaInterfacesetOriginalScale in interface ValueMetaInterfaceoriginalScale - the new original scalepublic boolean isOriginalSigned()
ValueMetaInterfaceisOriginalSigned in interface ValueMetaInterfacepublic void setOriginalSigned(boolean originalSigned)
ValueMetaInterfacesetOriginalSigned in interface ValueMetaInterfaceoriginalSigned - the new original signedpublic boolean isBigNumberFormatting()
public void setBigNumberFormatting(boolean bigNumberFormatting)
bigNumberFormatting - the bigNumberFormatting flag to set : true if BigNumbers of formatted as wellpublic static String[] getTrimTypeCodes()
public static String[] getTrimTypeDescriptions()
public boolean requiresRealClone()
ValueMetaInterfacerequiresRealClone in interface ValueMetaInterfacepublic boolean isLenientStringToNumber()
isLenientStringToNumber in interface ValueMetaInterfacepublic void setLenientStringToNumber(boolean lenientStringToNumber)
setLenientStringToNumber in interface ValueMetaInterfacelenientStringToNumber - the lenientStringToNumber to setpublic TimeZone getDateFormatTimeZone()
getDateFormatTimeZone in interface ValueMetaInterfacepublic void setDateFormatTimeZone(TimeZone dateFormatTimeZone)
setDateFormatTimeZone in interface ValueMetaInterfacedateFormatTimeZone - the date format time zone to setpublic boolean isIgnoreWhitespace()
ValueMetaInterfaceisIgnoreWhitespace in interface ValueMetaInterfacepublic void setIgnoreWhitespace(boolean ignoreWhitespace)
ValueMetaInterfacesetIgnoreWhitespace in interface ValueMetaInterfaceignoreWhitespace - true if whitespace should be ignored during string comparisonpublic void drawValue(PrimitiveGCInterface gc, Object value) throws KettleValueException
ValueMetaInterfacedrawValue in interface ValueMetaInterfacegc - The graphical context to draw on.KettleValueExceptionpublic ValueMetaInterface getValueFromSQLType(DatabaseMeta databaseMeta, String name, ResultSetMetaData rm, int index, boolean ignoreLength, boolean lazyConversion) throws KettleDatabaseException
ValueMetaInterfacegetValueFromSQLType in interface ValueMetaInterfacedatabaseMeta - the database metadata to reference capabilities and so on.name - The name of the new valuerm - The result metadata to investigateindex - The index to look at (1-based)ignoreLength - Don't look at the lengthlazyConversion - use lazy conversionKettleDatabaseException - In case something went wrong.protected void getOriginalColumnMetadata(ValueMetaInterface v, ResultSetMetaData rm, int index, boolean ignoreLength) throws SQLException
SQLExceptionpublic ValueMetaInterface getMetadataPreview(DatabaseMeta databaseMeta, ResultSet rs) throws KettleDatabaseException
ValueMetaInterfaceNote that the ValueMeta returned by this RowMeta may not contain actual values. This is a lightweight call using only JDBC metadata and does not make use of SQL statements.
getMetadataPreview in interface ValueMetaInterfacedatabaseMeta - the database metadata to reference capabilities and so on.rs - A ResultSet from getColumns, positioned correctly on a column to read.KettleDatabaseExceptionpublic Object getValueFromResultSet(DatabaseInterface databaseInterface, ResultSet resultSet, int index) throws KettleDatabaseException
getValueFromResultSet in interface ValueMetaInterfacedatabaseInterface - the database metadata to useresultSet - The JDBC result set to read fromindex - The column index (1-based)KettleDatabaseException - in case something goes wrong.public void setPreparedStatementValue(DatabaseMeta databaseMeta, PreparedStatement preparedStatement, int index, Object data) throws KettleDatabaseException
ValueMetaInterfacesetPreparedStatementValue in interface ValueMetaInterfacedatabaseMeta - the database metadata to referencepreparedStatement - The prepared statementindex - the column index (1-based)data - the value to setKettleDatabaseException - in case something goes wrongpublic Object getNativeDataType(Object object) throws KettleValueException
ValueMetaInterfacegetNativeDataType in interface ValueMetaInterfaceobject - The input dataKettleValueException - in case there is an unexpected data conversion error.public String getDatabaseColumnTypeDefinition(DatabaseInterface databaseInterface, String tk, String pk, boolean use_autoinc, boolean add_fieldname, boolean add_cr)
ValueMetaInterfacegetDatabaseColumnTypeDefinition in interface ValueMetaInterfacedatabaseInterface - The database type/dialect to get the column type definition fortk - Is this a technical key field?pk - Is this a primary key field?use_autoinc - Use auto-increment?add_fieldname - add the fieldname to the column type definition?add_cr - add a cariage return to the string?public Class<?> getNativeDataTypeClass() throws KettleValueException
ValueMetaInterfacegetNativeDataTypeClass in interface ValueMetaInterfaceKettleValueExceptionCopyright © 2020 Hitachi Vantara. All rights reserved.