Package org.pentaho.di.core.row.value
Class ValueMetaBase
java.lang.Object
org.pentaho.di.core.row.value.ValueMetaBase
- All Implemented Interfaces:
Cloneable
,ValueMetaInterface
- Direct Known Subclasses:
ValueMeta
,ValueMetaBigNumber
,ValueMetaBinary
,ValueMetaBoolean
,ValueMetaDate
,ValueMetaInteger
,ValueMetaNone
,ValueMetaNumber
,ValueMetaSerializable
,ValueMetaString
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected boolean
protected Collator
protected boolean
protected Locale
protected int
protected String
protected final Comparator<Object>
static final String
protected static SimpleDateFormat
protected String
protected ValueMetaInterface
protected String
protected SimpleDateFormat
protected boolean
protected boolean
protected Locale
protected TimeZone
protected DecimalFormat
protected boolean
protected String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected boolean
protected String
protected boolean
protected boolean
protected boolean
protected Object[]
protected boolean
protected int
protected boolean
protected String
protected long
protected String
protected boolean
protected int
protected String
protected int
protected int
protected int
protected boolean
protected boolean
protected static Class<?>
protected int
static final String[]
protected boolean
protected ValueMetaInterface
protected int
protected String
protected int
static final String[]
The trim type codesstatic final String[]
The trim descriptionprotected int
static final String
static final String
Fields inherited from interface org.pentaho.di.core.row.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 Summary
ConstructorDescriptionValueMetaBase
(DataInputStream inputStream) Deprecated.ValueMetaBase
(String name) ValueMetaBase
(String name, int type) ValueMetaBase
(String name, int type, int storageType) Deprecated.useValueMetaBase(String, int)
andsetStorageType(int)
insteadValueMetaBase
(String name, int type, int length, int precision) ValueMetaBase
(String name, int type, int length, int precision, Comparator<Object> comparator) ValueMetaBase
(String name, int type, Comparator<Object> comparator) ValueMetaBase
(Node node) -
Method Summary
Modifier and TypeMethodDescriptionclone()
cloneValueData
(Object object) Clones the data.int
Compare 2 values of the same data typeint
compare
(Object data1, ValueMetaInterface meta2, Object data2) Compare 2 values of the same data typeprotected void
protected Boolean
convertBigNumberToBoolean
(BigDecimal number) protected Date
convertBigNumberToDate
(BigDecimal number) protected String
convertBigNumberToString
(BigDecimal number) 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
protected Long
protected Double
protected String
convertData
(ValueMetaInterface meta2, Object data2) Convert the specified data to the data type specified in this object.convertDataCompatible
(ValueMetaInterface meta2, Object data2) Convert the specified data to the data type specified in this 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.Convert an object to the data type specified in the conversion metadataprotected BigDecimal
convertDateToBigNumber
(Date date) protected String
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) Convert a normal storage type to a binary string object.protected Boolean
convertNumberToBoolean
(Double number) protected String
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) Converts the specified data object to the binary string storage type.convertToNormalStorageType
(Object object) Converts the specified data object to the normal storage type.createOriginalValue
(Object data) Create an old-style value for backward compatibility reasonsprotected void
void
drawValue
(PrimitiveGCInterface gc, Object value) This method draws the value using the supplied graphical context.static final String[]
Get an array of String describing the possible types a Value can have.getBigNumber
(Object object) Convert the supplied data to a BigNumberbyte[]
Convert the supplied data to binary databyte[]
getBinaryString
(Object object) convert the supplied data to a binary string representation (for writing text)getBoolean
(Object object) Convert the supplied data to a BooleanGet the current Locale of the collatorint
Returns the strength of the collator.Gets the comments.getCompatibleString
(Object object) Convert the supplied data to a String compatible with version 2.5.Deprecated.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.Gets the currency symbol.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 interfacegetDataXML
(Object object) Returns an XML representation of the row data.Convert the supplied data to a DateGets the date format.Returns the locale from the date format.Gets the decimal format.getDecimalFormat
(boolean useBigDecimal) Gets the decimal format.Gets the decimal symbol.Gets a formatting mask using this value's meta information.Gets the grouping symbol.Object[]
getIndex()
Gets the index.getInteger
(Object object) Convert the supplied data to an Integerint
Gets the length.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.Returns an XML representation of the row metadata.getName()
Gets the name.getNativeDataType
(Object object) This method gives you the native Java data type corresponding to the value meta-data.Class<?>
Return the Java class that represents the "native" storage type of this ValueMetaConvert the supplied data to a Numberlong
Returns the number of binary string to native data type conversions done with this object conversionsGets the origin.protected void
getOriginalColumnMetadata
(ValueMetaInterface v, ResultSetMetaData rm, int index, boolean ignoreLength) int
store original JDBC RecordSetMetaData for later useGets the original column type name.int
Gets the original nullable.int
Gets the original precision.int
Gets the original scale.boolean
Gets the original signed.int
Gets the precision.protected int
getQuotesBeforeSymbol
(String df, String symbols) Returns the storage Meta data that is needed for internal conversion from BinaryString or String to the specified type.int
Gets the storage type.static final int
getStorageType
(String desc) Convert the String description of a storage type to an integer type.static final String
getStorageTypeCode
(int storageType) Return the storage type of a value in a textual form: "normal", "binary-string", "indexes"Convert the supplied data to a StringGets the string encoding.int
Gets the trim type.static final int
static final int
static final String
getTrimTypeCode
(int i) static String[]
static final String
getTrimTypeDesc
(int i) static String[]
int
getType()
Gets the type.static final int
Convert the String description of a type to an integer type.Return the type of a value in a textual form: "String", "Number", "Integer", "Boolean", "Date", ...static final String
getTypeDesc
(int type) TODO: change Desc to Code all over the place.static final String[]
getTypes()
get an array of String describing the possible types a Value can have.Convert a data XML node to an Object that corresponds to the metadata.getValueData
(Value value) Extracts the primitive data from an old style Value objectgetValueFromResultSet
(DatabaseInterface databaseInterface, ResultSet resultSet, int index) Get a value from a result set column based on the current value metadatagetValueFromSQLType
(DatabaseMeta databaseMeta, String name, ResultSetMetaData rm, int index, boolean ignoreLength, boolean lazyConversion) Investigate JDBC result set metadata at the specified index.int
Calculate the hashcode of the specified data objectboolean
Checks whether or not the value is a Big Numberboolean
boolean
isBinary()
Checks whether or not this value is of type Binaryboolean
Checks whether or not this value is a booleanboolean
Returns a true of the value object is case insensitive, false if it is case sensitive,boolean
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 Dateboolean
Returns true of the date format is lenient, false if it is strict.boolean
Is Ignore Whitespace Only applicable for TYPE_STRING comparisonsboolean
Checks whether or not this value is an Integerboolean
Returns true if this is a large text field (CLOB, TEXT) with arbitrary length.boolean
boolean
Determine if an object is null.boolean
isNumber()
Checks whether or not the value is a Numberboolean
Checks whether or not this Value is Numeric A Value is numeric if it is either of type Number or Integerstatic final boolean
isNumeric
(int t) Checks whether or not the specified type is either Integer or Numberboolean
Checks if is original auto increment.int
Checks if is original nullable.boolean
Checks if is original signed.boolean
Returns true if output padding is enabled (padding to specified length).boolean
Checks whether or not this value is of type Serializableboolean
boolean
boolean
Returns whether or not the value should be sorted in descending order.boolean
Checks if is storage binary string.boolean
Checks if is storage indexed.boolean
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) 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
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 collatorvoid
setCollatorLocale
(Locale locale) Sets the Locale of the collatorvoid
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
void
setGroupingSymbol
(String groupingSymbol) Sets the grouping symbol.void
setIgnoreWhitespace
(boolean ignoreWhitespace) Set Ignore Whitespace Only applicable for TYPE_STRING comparisonsvoid
Sets the index.void
setLargeTextField
(boolean largeTextField) Set to true if 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
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
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 positionvoid
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.toString()
a String text representation of this Value, optionally padded to the specified lengthprotected 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)
-
Field Details
-
DEFAULT_INTEGER_PARSE_MASK
-
DEFAULT_NUMBER_PARSE_MASK
-
DEFAULT_BIGNUMBER_PARSE_MASK
-
DEFAULT_DATE_PARSE_MASK
-
DEFAULT_TIMESTAMP_PARSE_MASK
-
DEFAULT_INTEGER_FORMAT_MASK
-
DEFAULT_NUMBER_FORMAT_MASK
-
DEFAULT_BIG_NUMBER_FORMAT_MASK
-
DEFAULT_DATE_FORMAT_MASK
-
DEFAULT_TIMESTAMP_FORMAT_MASK
-
PKG
-
XML_META_TAG
- See Also:
-
XML_DATA_TAG
- See Also:
-
COMPATIBLE_DATE_FORMAT_PATTERN
- See Also:
-
name
-
length
protected int length -
precision
protected int precision -
type
protected int type -
trimType
protected int trimType -
storageType
protected int storageType -
origin
-
comments
-
index
-
conversionMask
-
stringEncoding
-
decimalSymbol
-
groupingSymbol
-
currencySymbol
-
collatorStrength
protected int collatorStrength -
caseInsensitive
protected boolean caseInsensitive -
collatorDisabled
protected boolean collatorDisabled -
sortedDescending
protected boolean sortedDescending -
outputPaddingEnabled
protected boolean outputPaddingEnabled -
largeTextField
protected boolean largeTextField -
collatorLocale
-
collator
-
dateFormatLocale
-
dateFormatTimeZone
-
dateFormatLenient
protected boolean dateFormatLenient -
lenientStringToNumber
protected boolean lenientStringToNumber -
ignoreTimezone
protected boolean ignoreTimezone -
emptyStringAndNullAreDifferent
protected boolean emptyStringAndNullAreDifferent -
dateFormat
-
dateFormatChanged
protected boolean dateFormatChanged -
decimalFormat
-
decimalFormatChanged
protected boolean decimalFormatChanged -
storageMetadata
-
identicalFormat
protected boolean identicalFormat -
conversionMetadata
-
numberOfBinaryStringConversions
protected long numberOfBinaryStringConversions -
bigNumberFormatting
protected boolean bigNumberFormatting -
originalColumnType
protected int originalColumnType -
originalColumnTypeName
-
originalPrecision
protected int originalPrecision -
originalScale
protected int originalScale -
originalAutoIncrement
protected boolean originalAutoIncrement -
originalNullable
protected int originalNullable -
originalSigned
protected boolean originalSigned -
ignoreWhitespace
protected boolean ignoreWhitespace -
comparator
-
trimTypeCode
The trim type codes -
trimTypeDesc
The trim description -
SINGLE_BYTE_ENCODINGS
-
compatibleDateFormat
-
-
Constructor Details
-
ValueMetaBase
public ValueMetaBase() -
ValueMetaBase
-
ValueMetaBase
-
ValueMetaBase
-
ValueMetaBase
-
ValueMetaBase
public ValueMetaBase(String name, int type, int length, int precision, Comparator<Object> comparator) -
ValueMetaBase
- Throws:
KettleException
-
ValueMetaBase
@Deprecated public ValueMetaBase(DataInputStream inputStream) throws KettleFileException, KettleEOFException Deprecated.in favor of a combination ofValueMetaFactory
.createValueMeta() and the loadMetaData() method.Create a new Value meta object.- Parameters:
inputStream
-- Throws:
KettleFileException
KettleEOFException
-
ValueMetaBase
Deprecated.useValueMetaBase(String, int)
andsetStorageType(int)
instead- Parameters:
name
-type
-storageType
-
-
-
Method Details
-
setDefaultConversionMask
protected void setDefaultConversionMask() -
determineSingleByteEncoding
protected void determineSingleByteEncoding() -
clone
- Specified by:
clone
in interfaceValueMetaInterface
- Overrides:
clone
in classObject
- Returns:
- a copy of this value meta object
-
getComments
Description copied from interface:ValueMetaInterface
Gets the comments.- Specified by:
getComments
in interfaceValueMetaInterface
- Returns:
- the comments
-
setComments
Description copied from interface:ValueMetaInterface
Sets the comments for the object implementing the interface.- Specified by:
setComments
in interfaceValueMetaInterface
- Parameters:
comments
- the comments to set
-
getIndex
Description copied from interface:ValueMetaInterface
Gets the index.- Specified by:
getIndex
in interfaceValueMetaInterface
- Returns:
- the index
-
setIndex
Description copied from interface:ValueMetaInterface
Sets the index.- Specified by:
setIndex
in interfaceValueMetaInterface
- Parameters:
index
- the index to set
-
getLength
public int getLength()Description copied from interface:ValueMetaInterface
Gets the length.- Specified by:
getLength
in interfaceValueMetaInterface
- Returns:
- the length
-
setLength
public void setLength(int length) Description copied from interface:ValueMetaInterface
Sets the length.- Specified by:
setLength
in interfaceValueMetaInterface
- Parameters:
length
- the length to set
-
setLength
public void setLength(int length, int precision) Description copied from interface:ValueMetaInterface
Sets the length.- Specified by:
setLength
in interfaceValueMetaInterface
- Parameters:
length
- the length to setprecision
- the precision
-
getName
Description copied from interface:ValueMetaInterface
Gets the name.- Specified by:
getName
in interfaceValueMetaInterface
- Returns:
- the name
-
setName
Description copied from interface:ValueMetaInterface
Sets the name.- Specified by:
setName
in interfaceValueMetaInterface
- Parameters:
name
- the name to set
-
getOrigin
Description copied from interface:ValueMetaInterface
Gets the origin.- Specified by:
getOrigin
in interfaceValueMetaInterface
- Returns:
- the origin
-
setOrigin
Description copied from interface:ValueMetaInterface
Sets the origin.- Specified by:
setOrigin
in interfaceValueMetaInterface
- Parameters:
origin
- the origin to set
-
getPrecision
public int getPrecision()Description copied from interface:ValueMetaInterface
Gets the precision.- Specified by:
getPrecision
in interfaceValueMetaInterface
- Returns:
- the precision
-
setPrecision
public void setPrecision(int precision) Description copied from interface:ValueMetaInterface
Sets the precision.- Specified by:
setPrecision
in interfaceValueMetaInterface
- Parameters:
precision
- the precision to set
-
getStorageType
public int getStorageType()Description copied from interface:ValueMetaInterface
Gets the storage type.- Specified by:
getStorageType
in interfaceValueMetaInterface
- Returns:
- the storageType
-
setStorageType
public void setStorageType(int storageType) Description copied from interface:ValueMetaInterface
Sets the storage type.- Specified by:
setStorageType
in interfaceValueMetaInterface
- Parameters:
storageType
- the storageType to set
-
isStorageNormal
public boolean isStorageNormal()Description copied from interface:ValueMetaInterface
Checks if is storage normal.- Specified by:
isStorageNormal
in interfaceValueMetaInterface
- Returns:
- true, if is storage normal
-
isStorageIndexed
public boolean isStorageIndexed()Description copied from interface:ValueMetaInterface
Checks if is storage indexed.- Specified by:
isStorageIndexed
in interfaceValueMetaInterface
- Returns:
- true, if is storage indexed
-
isStorageBinaryString
public boolean isStorageBinaryString()Description copied from interface:ValueMetaInterface
Checks if is storage binary string.- Specified by:
isStorageBinaryString
in interfaceValueMetaInterface
- Returns:
- true, if is storage binary string
-
getType
public int getType()Description copied from interface:ValueMetaInterface
Gets the type.- Specified by:
getType
in interfaceValueMetaInterface
- Returns:
- the type
-
setType
Deprecated.Description copied from interface:ValueMetaInterface
Sets the type.- Specified by:
setType
in interfaceValueMetaInterface
- Parameters:
type
- the type to set
-
getConversionMask
Deprecated.Description copied from interface:ValueMetaInterface
Gets the conversion mask.- Specified by:
getConversionMask
in interfaceValueMetaInterface
- Returns:
- the conversionMask
-
setConversionMask
Description copied from interface:ValueMetaInterface
Sets the conversion mask.- Specified by:
setConversionMask
in interfaceValueMetaInterface
- Parameters:
conversionMask
- the conversionMask to set
-
getStringEncoding
Description copied from interface:ValueMetaInterface
Gets the string encoding.- Specified by:
getStringEncoding
in interfaceValueMetaInterface
- Returns:
- the encoding
-
setStringEncoding
Description copied from interface:ValueMetaInterface
Sets the string encoding.- Specified by:
setStringEncoding
in interfaceValueMetaInterface
- Parameters:
encoding
- the encoding to set
-
getDecimalSymbol
Description copied from interface:ValueMetaInterface
Gets the decimal symbol.- Specified by:
getDecimalSymbol
in interfaceValueMetaInterface
- Returns:
- the decimalSymbol
-
setDecimalSymbol
Description copied from interface:ValueMetaInterface
Sets the decimal symbol.- Specified by:
setDecimalSymbol
in interfaceValueMetaInterface
- Parameters:
decimalSymbol
- the decimalSymbol to set
-
getGroupingSymbol
Description copied from interface:ValueMetaInterface
Gets the grouping symbol.- Specified by:
getGroupingSymbol
in interfaceValueMetaInterface
- Returns:
- the groupingSymbol
-
setGroupingSymbol
Description copied from interface:ValueMetaInterface
Sets the grouping symbol.- Specified by:
setGroupingSymbol
in interfaceValueMetaInterface
- Parameters:
groupingSymbol
- the groupingSymbol to set
-
getCurrencySymbol
Description copied from interface:ValueMetaInterface
Gets the currency symbol.- Specified by:
getCurrencySymbol
in interfaceValueMetaInterface
- Returns:
- the currencySymbol
-
setCurrencySymbol
Description copied from interface:ValueMetaInterface
Sets the currency symbol.- Specified by:
setCurrencySymbol
in interfaceValueMetaInterface
- Parameters:
currencySymbol
- the currencySymbol to set
-
isCaseInsensitive
public boolean isCaseInsensitive()Description copied from interface:ValueMetaInterface
Returns a true of the value object is case insensitive, false if it is case sensitive,- Specified by:
isCaseInsensitive
in interfaceValueMetaInterface
- Returns:
- the caseInsensitive
-
setCaseInsensitive
public void setCaseInsensitive(boolean caseInsensitive) Description copied from interface:ValueMetaInterface
Sets whether or not the value object is case sensitive. This information is useful if the value is involved in string comparisons.- Specified by:
setCaseInsensitive
in interfaceValueMetaInterface
- Parameters:
caseInsensitive
- the caseInsensitive to set
-
isCollatorDisabled
public boolean isCollatorDisabled()Description copied from interface:ValueMetaInterface
Returns a true of the value object is case insensitive, false if it is case sensitive,- Specified by:
isCollatorDisabled
in interfaceValueMetaInterface
- Returns:
- the collatorDisabled
-
setCollatorDisabled
public void setCollatorDisabled(boolean collatorDisabled) Description copied from interface:ValueMetaInterface
Sets whether or not the value object should be sorted according to a locale using a collator- Specified by:
setCollatorDisabled
in interfaceValueMetaInterface
- Parameters:
collatorDisabled
- the collatorDisabled to set
-
getCollatorLocale
Description copied from interface:ValueMetaInterface
Get the current Locale of the collator- Specified by:
getCollatorLocale
in interfaceValueMetaInterface
- Returns:
- the current Collator Locale
-
setCollatorLocale
Description copied from interface:ValueMetaInterface
Sets the Locale of the collator- Specified by:
setCollatorLocale
in interfaceValueMetaInterface
-
getCollatorStrength
public int getCollatorStrength()Description copied from interface:ValueMetaInterface
Returns the strength of the collator.- Specified by:
getCollatorStrength
in interfaceValueMetaInterface
- Returns:
- the collatorStrength
-
setCollatorStrength
Description copied from interface:ValueMetaInterface
Sets the strength of the collator.- Specified by:
setCollatorStrength
in interfaceValueMetaInterface
- Parameters:
collatorStrength
- the collatorStrength to set- Throws:
IllegalArgumentException
-
isSortedDescending
public boolean isSortedDescending()Description copied from interface:ValueMetaInterface
Returns whether or not the value should be sorted in descending order.- Specified by:
isSortedDescending
in interfaceValueMetaInterface
- Returns:
- the sortedDescending
-
setSortedDescending
public void setSortedDescending(boolean sortedDescending) Description copied from interface:ValueMetaInterface
Sets whether or not the value should be set in a descending order.- Specified by:
setSortedDescending
in interfaceValueMetaInterface
- Parameters:
sortedDescending
- the sortedDescending to set
-
isOutputPaddingEnabled
public boolean isOutputPaddingEnabled()Description copied from interface:ValueMetaInterface
Returns true if output padding is enabled (padding to specified length).- Specified by:
isOutputPaddingEnabled
in interfaceValueMetaInterface
- Returns:
- true if output padding is enabled (padding to specified length)
-
setOutputPaddingEnabled
public void setOutputPaddingEnabled(boolean outputPaddingEnabled) Description copied from interface:ValueMetaInterface
Set to true if output padding is to be enabled (padding to specified length).- Specified by:
setOutputPaddingEnabled
in interfaceValueMetaInterface
- Parameters:
outputPaddingEnabled
- Set to true if output padding is to be enabled (padding to specified length)
-
isLargeTextField
public boolean isLargeTextField()Description copied from interface:ValueMetaInterface
Returns true if this is a large text field (CLOB, TEXT) with arbitrary length.- Specified by:
isLargeTextField
in interfaceValueMetaInterface
- Returns:
- true if this is a large text field (CLOB, TEXT) with arbitrary length.
-
setLargeTextField
public void setLargeTextField(boolean largeTextField) Description copied from interface:ValueMetaInterface
Set to true if this is to be a large text field (CLOB, TEXT) with arbitrary length.- Specified by:
setLargeTextField
in interfaceValueMetaInterface
- Parameters:
largeTextField
- Set to true if this is to be a large text field (CLOB, TEXT) with arbitrary length.
-
isDateFormatLenient
public boolean isDateFormatLenient()Description copied from interface:ValueMetaInterface
Returns true of the date format is lenient, false if it is strict.
See alsoValueMetaInterface.setDateFormatLenient(boolean)
- Specified by:
isDateFormatLenient
in interfaceValueMetaInterface
- Returns:
- the dateFormatLenient
-
setDateFormatLenient
public void setDateFormatLenient(boolean dateFormatLenient) Description copied from interface:ValueMetaInterface
Set to true if the date formatting (parsing) is to be set to lenient. Being lenient means that the "date format" is tolerant to some formatting errors. For example, a month specified as "15" will be interpreted as "March":
15 - (December = 12) = 3 = March.
Set to false for stricter formatting validation.- Specified by:
setDateFormatLenient
in interfaceValueMetaInterface
- Parameters:
dateFormatLenient
- the dateFormatLenient to set
-
getDateFormatLocale
Description copied from interface:ValueMetaInterface
Returns the locale from the date format.- Specified by:
getDateFormatLocale
in interfaceValueMetaInterface
- Returns:
- the dateFormatLocale
-
setDateFormatLocale
Description copied from interface:ValueMetaInterface
Sets the locale of the date format.- Specified by:
setDateFormatLocale
in interfaceValueMetaInterface
- Parameters:
dateFormatLocale
- the dateFormatLocale to set
-
convertDateToString
-
convertDateToCompatibleString
-
convertStringToDate
- Throws:
KettleValueException
-
convertDateToNumber
-
convertNumberToDate
-
convertDateToInteger
-
convertIntegerToDate
-
convertDateToBigNumber
-
convertBigNumberToDate
-
convertNumberToString
- Throws:
KettleValueException
-
convertNumberToCompatibleString
- Throws:
KettleValueException
-
convertStringToNumber
- Throws:
KettleValueException
-
getDateFormat
Description copied from interface:ValueMetaInterface
Gets the date format.- Specified by:
getDateFormat
in interfaceValueMetaInterface
- Returns:
- the date format
-
getDecimalFormat
Description copied from interface:ValueMetaInterface
Gets the decimal format.- Specified by:
getDecimalFormat
in interfaceValueMetaInterface
- Returns:
- the decimal format
-
getDecimalFormat
Description copied from interface:ValueMetaInterface
Gets the decimal format.- Specified by:
getDecimalFormat
in interfaceValueMetaInterface
- Parameters:
useBigDecimal
- the use big decimal- Returns:
- the decimal format
-
getFormatMask
Description copied from interface:ValueMetaInterface
Gets a formatting mask using this value's meta information.- Specified by:
getFormatMask
in interfaceValueMetaInterface
- Returns:
- the format mask.
-
convertIntegerToString
- Throws:
KettleValueException
-
convertIntegerToCompatibleString
- Throws:
KettleValueException
-
convertStringToInteger
- Throws:
KettleValueException
-
convertBigNumberToString
- Throws:
KettleValueException
-
convertStringToBigNumber
- Throws:
KettleValueException
-
convertBooleanToString
-
convertStringToBoolean
-
convertBooleanToNumber
-
convertNumberToBoolean
-
convertBooleanToInteger
-
convertIntegerToBoolean
-
convertBooleanToBigNumber
-
convertBigNumberToBoolean
-
convertBinaryStringToString
Converts a byte[] stored in a binary string storage type into a String;- Parameters:
binary
- the binary string- Returns:
- the String in the correct encoding.
- Throws:
KettleValueException
-
convertToNormalStorageType
Converts the specified data object to the normal storage type.- Specified by:
convertToNormalStorageType
in interfaceValueMetaInterface
- Parameters:
object
- the data object to convert- Returns:
- the data in a normal storage type
- Throws:
KettleValueException
- In case there is a data conversion error.
-
convertToBinaryStringStorageType
Converts the specified data object to the binary string storage type.- Specified by:
convertToBinaryStringStorageType
in interfaceValueMetaInterface
- Parameters:
object
- the data object to convert- Returns:
- the data in a binary string storage type
- Throws:
KettleValueException
- In case there is a data conversion error.
-
convertBinaryStringToNativeType
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)- Specified by:
convertBinaryStringToNativeType
in interfaceValueMetaInterface
- Parameters:
binary
-- Returns:
- Throws:
KettleValueException
-
convertNormalStorageTypeToBinaryString
Description copied from interface:ValueMetaInterface
Convert a normal storage type to a binary string object. (for comparison reasons)- Specified by:
convertNormalStorageTypeToBinaryString
in interfaceValueMetaInterface
- Parameters:
object
- The object expressed in a normal storage type- Returns:
- a binary string
- Throws:
KettleValueException
- in case there is a data conversion error
-
convertStringToBinaryString
- Throws:
KettleValueException
-
cloneValueData
Clones the data. Normally, we don't have to do anything here, but just for arguments and safety, we do a little extra work in case of binary blobs and Date objects. We should write a programmers manual later on to specify in all clarity that "we always overwrite/replace values in the Object[] data rows, we never modify them" .- Specified by:
cloneValueData
in interfaceValueMetaInterface
- Parameters:
object
- the object- Returns:
- a cloned data object if needed
- Throws:
KettleValueException
- the kettle value exception
-
getCompatibleString
Description copied from interface:ValueMetaInterface
Convert the supplied data to a String compatible with version 2.5.- Specified by:
getCompatibleString
in interfaceValueMetaInterface
- Throws:
KettleValueException
-
getString
Description copied from interface:ValueMetaInterface
Convert the supplied data to a String- Specified by:
getString
in interfaceValueMetaInterface
- Throws:
KettleValueException
-
trim
-
getNumber
Description copied from interface:ValueMetaInterface
Convert the supplied data to a Number- Specified by:
getNumber
in interfaceValueMetaInterface
- Throws:
KettleValueException
-
getInteger
Description copied from interface:ValueMetaInterface
Convert the supplied data to an Integer- Specified by:
getInteger
in interfaceValueMetaInterface
- Throws:
KettleValueException
-
getBigNumber
Description copied from interface:ValueMetaInterface
Convert the supplied data to a BigNumber- Specified by:
getBigNumber
in interfaceValueMetaInterface
- Throws:
KettleValueException
-
getBoolean
Description copied from interface:ValueMetaInterface
Convert the supplied data to a Boolean- Specified by:
getBoolean
in interfaceValueMetaInterface
- Throws:
KettleValueException
-
getDate
Description copied from interface:ValueMetaInterface
Convert the supplied data to a Date- Specified by:
getDate
in interfaceValueMetaInterface
- Throws:
KettleValueException
-
getBinary
Description copied from interface:ValueMetaInterface
Convert the supplied data to binary data- Specified by:
getBinary
in interfaceValueMetaInterface
- Throws:
KettleValueException
-
getBinaryString
Description copied from interface:ValueMetaInterface
convert the supplied data to a binary string representation (for writing text)- Specified by:
getBinaryString
in interfaceValueMetaInterface
- Throws:
KettleValueException
-
isString
public boolean isString()Checks whether or not the value is a String.- Specified by:
isString
in interfaceValueMetaInterface
- Returns:
- true if the value is a String.
-
isDate
public boolean isDate()Checks whether or not this value is a Date- Specified by:
isDate
in interfaceValueMetaInterface
- Returns:
- true if the value is a Date
-
isBigNumber
public boolean isBigNumber()Checks whether or not the value is a Big Number- Specified by:
isBigNumber
in interfaceValueMetaInterface
- Returns:
- true is this value is a big number
-
isNumber
public boolean isNumber()Checks whether or not the value is a Number- Specified by:
isNumber
in interfaceValueMetaInterface
- Returns:
- true is this value is a number
-
isBoolean
public boolean isBoolean()Checks whether or not this value is a boolean- Specified by:
isBoolean
in interfaceValueMetaInterface
- Returns:
- true if this value has type boolean.
-
isSerializableType
public boolean isSerializableType()Checks whether or not this value is of type Serializable- Specified by:
isSerializableType
in interfaceValueMetaInterface
- Returns:
- true if this value has type Serializable
-
isBinary
public boolean isBinary()Checks whether or not this value is of type Binary- Specified by:
isBinary
in interfaceValueMetaInterface
- Returns:
- true if this value has type Binary
-
isInteger
public boolean isInteger()Checks whether or not this value is an Integer- Specified by:
isInteger
in interfaceValueMetaInterface
- Returns:
- true if this value is an integer
-
isNumeric
public boolean isNumeric()Checks whether or not this Value is Numeric A Value is numeric if it is either of type Number or Integer- Specified by:
isNumeric
in interfaceValueMetaInterface
- Returns:
- true if the value is either of type Number or Integer
-
isNumeric
public static final boolean isNumeric(int t) Checks whether or not the specified type is either Integer or Number- Parameters:
t
- the type to check- Returns:
- true if the type is Integer or Number
-
isSortedAscending
public boolean isSortedAscending() -
getTypeDesc
Return the type of a value in a textual form: "String", "Number", "Integer", "Boolean", "Date", ...- Specified by:
getTypeDesc
in interfaceValueMetaInterface
- Returns:
- A String describing the type of value.
-
getStorageTypeDesc
Return the storage type of a value in a textual form: "normal", "binary-string", "indexes"- Returns:
- A String describing the storage type of the value metadata
-
toString
-
toStringMeta
a String text representation of this Value, optionally padded to the specified length- Specified by:
toStringMeta
in interfaceValueMetaInterface
- Returns:
- a String text representation of this Value, optionally padded to the specified length
-
writeData
Description copied from interface:ValueMetaInterface
Serialize the content of the specified data object to the outputStream. No metadata is written.- Specified by:
writeData
in interfaceValueMetaInterface
- Parameters:
outputStream
- the outputstream to write toobject
- the data object to serialize- Throws:
KettleFileException
- in case a I/O error occurs
-
readData
public Object readData(DataInputStream inputStream) throws KettleFileException, KettleEOFException, SocketTimeoutException Description copied from interface:ValueMetaInterface
De-serialize data from an inputstream. No metadata is read or changed.- Specified by:
readData
in interfaceValueMetaInterface
- Parameters:
inputStream
- the input stream to read from- Returns:
- a new data object
- Throws:
KettleFileException
- 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 reading
-
writeString
- Throws:
IOException
-
writeBinaryString
protected void writeBinaryString(DataOutputStream outputStream, byte[] binaryString) throws IOException - Throws:
IOException
-
readString
- Throws:
IOException
-
readBinaryString
- Throws:
IOException
-
writeBigNumber
- Throws:
IOException
-
readBigNumber
- Throws:
IOException
-
writeDate
- Throws:
IOException
-
readDate
- Throws:
IOException
-
writeBoolean
- Throws:
IOException
-
readBoolean
- Throws:
IOException
-
writeNumber
- Throws:
IOException
-
readNumber
- Throws:
IOException
-
writeInteger
- Throws:
IOException
-
readInteger
- Throws:
IOException
-
writeInteger
- Throws:
IOException
-
readSmallInteger
- Throws:
IOException
-
writeBinary
- Throws:
IOException
-
readBinary
- Throws:
IOException
-
writeMeta
Description copied from interface:ValueMetaInterface
Write the content of this class (metadata) to the specified output stream.- Specified by:
writeMeta
in interfaceValueMetaInterface
- Parameters:
outputStream
- the outputstream to write to- Throws:
KettleFileException
- in case a I/O error occurs
-
readMetaData
public void readMetaData(DataInputStream inputStream) throws KettleFileException, KettleEOFException Load the attributes of this particular value meta object from the input stream. Loading the type is not handled here, this should be read from the stream previously!- Specified by:
readMetaData
in interfaceValueMetaInterface
- Parameters:
inputStream
- the input stream to read from- Throws:
KettleFileException
- In case there was a IO problemKettleEOFException
- If we reached the end of the stream
-
getMetaXML
Description copied from interface:ValueMetaInterface
Returns an XML representation of the row metadata.- Specified by:
getMetaXML
in interfaceValueMetaInterface
- Returns:
- an XML representation of the row metadata
- Throws:
IOException
- Thrown in case there is an (Base64/GZip) decoding problem
-
getDataXML
Description copied from interface:ValueMetaInterface
Returns an XML representation of the row data.- Specified by:
getDataXML
in interfaceValueMetaInterface
- Parameters:
object
- The data to serialize as XML- Returns:
- an XML representation of the row data
- Throws:
IOException
- Thrown in case there is an (Base64/GZip) decoding problem
-
getValue
Convert a data XML node to an Object that corresponds to the metadata. This is basically String to Object conversion that is being done.- Specified by:
getValue
in interfaceValueMetaInterface
- Parameters:
node
- the node to retrieve the data value from- Returns:
- the converted data value
- Throws:
IOException
- 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 conversion
-
getTypes
get an array of String describing the possible types a Value can have.- Returns:
- an array of String describing the possible types a Value can have.
-
getAllTypes
Get an array of String describing the possible types a Value can have.- Returns:
- an array of String describing the possible types a Value can have.
-
getTypeDesc
TODO: change Desc to Code all over the place. Make sure we can localise this stuff later on.- Parameters:
type
- the type- Returns:
- the description (code) of the type
-
getType
Convert the String description of a type to an integer type.- Parameters:
desc
- The description of the type to convert- Returns:
- The integer type of the given String. (ValueMetaInterface.TYPE_...)
-
getStorageType
Convert the String description of a storage type to an integer type.- Parameters:
desc
- The description of the storage type to convert- Returns:
- The integer storage type of the given String. (ValueMetaInterface.STORAGE_TYPE_...) or -1 if the storage type code not be found.
-
getStorageTypeCode
-
isNull
Determine if an object is null. This is the case if data==null or if it's an empty string.- Specified by:
isNull
in interfaceValueMetaInterface
- Parameters:
data
- the object to test- Returns:
- true if the object is considered null.
- Throws:
KettleValueException
- in case there is a conversion error (only thrown in case of lazy conversion)
-
compare
Compare 2 values of the same data type- Specified by:
compare
in interfaceValueMetaInterface
- Parameters:
data1
- the first valuedata2
- the second value- Returns:
- 0 if the values are equal, -1 if data1 is smaller than data2 and +1 if it's larger.
- Throws:
KettleValueException
- In case we get conversion errors
-
compare
public int compare(Object data1, ValueMetaInterface meta2, Object data2) throws KettleValueException Compare 2 values of the same data type- Specified by:
compare
in interfaceValueMetaInterface
- Parameters:
data1
- the first valuemeta2
- the second value's metadatadata2
- the second value- Returns:
- 0 if the values are equal, -1 if data1 is smaller than data2 and +1 if it's larger.
- Throws:
KettleValueException
- In case we get conversion errors
-
convertData
Convert the specified data to the data type specified in this object.- Specified by:
convertData
in interfaceValueMetaInterface
- Parameters:
meta2
- the metadata of the object to be converteddata2
- the data of the object to be converted- Returns:
- the object in the data type of this value metadata object
- Throws:
KettleValueException
- in case there is a data conversion error
-
convertDataCompatible
public Object convertDataCompatible(ValueMetaInterface meta2, Object data2) throws KettleValueException Convert the specified data to the data type specified in this object. For String conversion, be compatible with version 2.5.2.- Specified by:
convertDataCompatible
in interfaceValueMetaInterface
- Parameters:
meta2
- the metadata of the object to be converteddata2
- the data of the object to be converted- Returns:
- the object in the data type of this value metadata object
- Throws:
KettleValueException
- in case there is a data conversion error
-
convertDataUsingConversionMetaData
Convert an object to the data type specified in the conversion metadata- Specified by:
convertDataUsingConversionMetaData
in interfaceValueMetaInterface
- Parameters:
data
- The data- Returns:
- The data converted to the storage data type
- Throws:
KettleValueException
- in case there is a conversion error.
-
convertDataFromString
public Object convertDataFromString(String pol, ValueMetaInterface convertMeta, String nullIf, String ifNull, int trim_type) throws KettleValueException Convert the specified string to the data type specified in this object.- Specified by:
convertDataFromString
in interfaceValueMetaInterface
- Parameters:
pol
- 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)- Returns:
- the object in the data type of this value metadata object
- Throws:
KettleValueException
- in case there is a data conversion error
-
hashCode
Calculate the hashcode of the specified data object- Specified by:
hashCode
in interfaceValueMetaInterface
- Parameters:
object
- the data value to calculate a hashcode for- Returns:
- the calculated hashcode
- Throws:
KettleValueException
-
createOriginalValue
Create an old-style value for backward compatibility reasons- Specified by:
createOriginalValue
in interfaceValueMetaInterface
- Parameters:
data
- the data to store in the value- Returns:
- a newly created Value object
- Throws:
KettleValueException
- case there is a data conversion problem
-
getValueData
Extracts the primitive data from an old style Value object- Specified by:
getValueData
in interfaceValueMetaInterface
- Parameters:
value
- the old style Value object- Returns:
- the value's data, NOT the meta data.
- Throws:
KettleValueException
- case there is a data conversion problem
-
getStorageMetadata
Description copied from interface:ValueMetaInterface
Returns the storage Meta data that is needed for internal conversion from BinaryString or String to the specified type. This storage Meta data object survives cloning and should travel through the transformation unchanged as long as the data type remains the same.- Specified by:
getStorageMetadata
in interfaceValueMetaInterface
- Returns:
- the storageMetadata
-
setStorageMetadata
Description copied from interface:ValueMetaInterface
Sets the storage meta data.- Specified by:
setStorageMetadata
in interfaceValueMetaInterface
- Parameters:
storageMetadata
- the storageMetadata to set
-
compareStorageAndActualFormat
protected void compareStorageAndActualFormat() -
getTrimType
public int getTrimType()Description copied from interface:ValueMetaInterface
Gets the trim type.- Specified by:
getTrimType
in interfaceValueMetaInterface
- Returns:
- the trimType
-
setTrimType
public void setTrimType(int trimType) Description copied from interface:ValueMetaInterface
Sets the trim type.- Specified by:
setTrimType
in interfaceValueMetaInterface
- Parameters:
trimType
- the trimType to set
-
getTrimTypeByCode
-
getTrimTypeByDesc
-
getTrimTypeCode
-
getTrimTypeDesc
-
getConversionMetadata
Description copied from interface:ValueMetaInterface
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.- Specified by:
getConversionMetadata
in interfaceValueMetaInterface
- Returns:
- the conversionMetadata
-
setConversionMetadata
Description copied from interface:ValueMetaInterface
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.- Specified by:
setConversionMetadata
in interfaceValueMetaInterface
- Parameters:
conversionMetadata
- the conversionMetadata to set
-
isSingleByteEncoding
public boolean isSingleByteEncoding()- Specified by:
isSingleByteEncoding
in interfaceValueMetaInterface
- Returns:
- true if the String encoding used (storage) is single byte encoded.
-
getNumberOfBinaryStringConversions
public long getNumberOfBinaryStringConversions()Description copied from interface:ValueMetaInterface
Returns the number of binary string to native data type conversions done with this object conversions- Specified by:
getNumberOfBinaryStringConversions
in interfaceValueMetaInterface
- Returns:
- the number of binary string to native data type conversions done with this object conversions
-
setNumberOfBinaryStringConversions
public void setNumberOfBinaryStringConversions(long numberOfBinaryStringConversions) Description copied from interface:ValueMetaInterface
Returns the number of binary string to native data type done with this object conversions to set.- Specified by:
setNumberOfBinaryStringConversions
in interfaceValueMetaInterface
- Parameters:
numberOfBinaryStringConversions
- the number of binary string to native data type done with this object conversions to set
-
isOriginalAutoIncrement
public boolean isOriginalAutoIncrement()Description copied from interface:ValueMetaInterface
Checks if is original auto increment.- Specified by:
isOriginalAutoIncrement
in interfaceValueMetaInterface
- Returns:
- true, if is original auto increment
-
setOriginalAutoIncrement
public void setOriginalAutoIncrement(boolean originalAutoIncrement) Description copied from interface:ValueMetaInterface
Sets the original auto increment.- Specified by:
setOriginalAutoIncrement
in interfaceValueMetaInterface
- Parameters:
originalAutoIncrement
- the new original auto increment
-
getOriginalColumnType
public int getOriginalColumnType()Description copied from interface:ValueMetaInterface
store original JDBC RecordSetMetaData for later use- Specified by:
getOriginalColumnType
in interfaceValueMetaInterface
- See Also:
-
setOriginalColumnType
public void setOriginalColumnType(int originalColumnType) Description copied from interface:ValueMetaInterface
Sets the original column type.- Specified by:
setOriginalColumnType
in interfaceValueMetaInterface
- Parameters:
originalColumnType
- the new original column type
-
getOriginalColumnTypeName
Description copied from interface:ValueMetaInterface
Gets the original column type name.- Specified by:
getOriginalColumnTypeName
in interfaceValueMetaInterface
- Returns:
- the original column type name
-
setOriginalColumnTypeName
Description copied from interface:ValueMetaInterface
Sets the original column type name.- Specified by:
setOriginalColumnTypeName
in interfaceValueMetaInterface
- Parameters:
originalColumnTypeName
- the new original column type name
-
isOriginalNullable
public int isOriginalNullable()Description copied from interface:ValueMetaInterface
Checks if is original nullable.- Specified by:
isOriginalNullable
in interfaceValueMetaInterface
- Returns:
- the int
-
setOriginalNullable
public void setOriginalNullable(int originalNullable) Description copied from interface:ValueMetaInterface
Sets the original nullable.- Specified by:
setOriginalNullable
in interfaceValueMetaInterface
- Parameters:
originalNullable
- the new original nullable
-
getOriginalPrecision
public int getOriginalPrecision()Description copied from interface:ValueMetaInterface
Gets the original precision.- Specified by:
getOriginalPrecision
in interfaceValueMetaInterface
- Returns:
- the original precision
-
setOriginalPrecision
public void setOriginalPrecision(int originalPrecision) Description copied from interface:ValueMetaInterface
Sets the original precision.- Specified by:
setOriginalPrecision
in interfaceValueMetaInterface
- Parameters:
originalPrecision
- the new original precision
-
getOriginalScale
public int getOriginalScale()Description copied from interface:ValueMetaInterface
Gets the original scale.- Specified by:
getOriginalScale
in interfaceValueMetaInterface
- Returns:
- the original scale
-
getOriginalNullable
public int getOriginalNullable()Description copied from interface:ValueMetaInterface
Gets the original nullable.- Specified by:
getOriginalNullable
in interfaceValueMetaInterface
- Returns:
- the original nullable
-
getOriginalSigned
public boolean getOriginalSigned()Description copied from interface:ValueMetaInterface
Gets the original signed.- Specified by:
getOriginalSigned
in interfaceValueMetaInterface
- Returns:
- the original signed
-
setOriginalScale
public void setOriginalScale(int originalScale) Description copied from interface:ValueMetaInterface
Sets the original scale.- Specified by:
setOriginalScale
in interfaceValueMetaInterface
- Parameters:
originalScale
- the new original scale
-
isOriginalSigned
public boolean isOriginalSigned()Description copied from interface:ValueMetaInterface
Checks if is original signed.- Specified by:
isOriginalSigned
in interfaceValueMetaInterface
- Returns:
- true, if is original signed
-
setOriginalSigned
public void setOriginalSigned(boolean originalSigned) Description copied from interface:ValueMetaInterface
Sets the original signed.- Specified by:
setOriginalSigned
in interfaceValueMetaInterface
- Parameters:
originalSigned
- the new original signed
-
isBigNumberFormatting
public boolean isBigNumberFormatting()- Returns:
- the bigNumberFormatting flag : true if BigNumbers of formatted as well
-
setBigNumberFormatting
public void setBigNumberFormatting(boolean bigNumberFormatting) - Parameters:
bigNumberFormatting
- the bigNumberFormatting flag to set : true if BigNumbers of formatted as well
-
getTrimTypeCodes
- Returns:
- The available trim type codes (NOT localized, use for persistence)
-
getTrimTypeDescriptions
- Returns:
- The available trim type descriptions (localized)
-
requiresRealClone
public boolean requiresRealClone()Description copied from interface:ValueMetaInterface
Returns true if the data type requires a real copy. Usually a binary or Serializable object.- Specified by:
requiresRealClone
in interfaceValueMetaInterface
- Returns:
- boolean
-
isLenientStringToNumber
public boolean isLenientStringToNumber()- Specified by:
isLenientStringToNumber
in interfaceValueMetaInterface
- Returns:
- the lenientStringToNumber
-
setLenientStringToNumber
public void setLenientStringToNumber(boolean lenientStringToNumber) - Specified by:
setLenientStringToNumber
in interfaceValueMetaInterface
- Parameters:
lenientStringToNumber
- the lenientStringToNumber to set
-
getDateFormatTimeZone
- Specified by:
getDateFormatTimeZone
in interfaceValueMetaInterface
- Returns:
- the date format time zone
-
setDateFormatTimeZone
- Specified by:
setDateFormatTimeZone
in interfaceValueMetaInterface
- Parameters:
dateFormatTimeZone
- the date format time zone to set
-
isIgnoreWhitespace
public boolean isIgnoreWhitespace()Description copied from interface:ValueMetaInterface
Is Ignore Whitespace Only applicable for TYPE_STRING comparisons- Specified by:
isIgnoreWhitespace
in interfaceValueMetaInterface
- Returns:
- true if whitespace should be ignored during string comparison
-
setIgnoreWhitespace
public void setIgnoreWhitespace(boolean ignoreWhitespace) Description copied from interface:ValueMetaInterface
Set Ignore Whitespace Only applicable for TYPE_STRING comparisons- Specified by:
setIgnoreWhitespace
in interfaceValueMetaInterface
- Parameters:
ignoreWhitespace
- true if whitespace should be ignored during string comparison
-
drawValue
Description copied from interface:ValueMetaInterface
This method draws the value using the supplied graphical context.- Specified by:
drawValue
in interfaceValueMetaInterface
- Parameters:
gc
- The graphical context to draw on.- Throws:
KettleValueException
-
getValueFromSQLType
public ValueMetaInterface getValueFromSQLType(DatabaseMeta databaseMeta, String name, ResultSetMetaData rm, int index, boolean ignoreLength, boolean lazyConversion) throws KettleDatabaseException Description copied from interface:ValueMetaInterface
Investigate JDBC result set metadata at the specified index. If this value metadata is interested in handling this SQL type, it should return the value meta. Otherwise it should return null.- Specified by:
getValueFromSQLType
in interfaceValueMetaInterface
- Parameters:
databaseMeta
- 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 conversion- Returns:
- The value metadata if this value should handle the SQL type at the specified index.
- Throws:
KettleDatabaseException
- In case something went wrong.
-
getOriginalColumnMetadata
protected void getOriginalColumnMetadata(ValueMetaInterface v, ResultSetMetaData rm, int index, boolean ignoreLength) throws SQLException - Throws:
SQLException
-
getMetadataPreview
public ValueMetaInterface getMetadataPreview(DatabaseMeta databaseMeta, ResultSet rs) throws KettleDatabaseException Description copied from interface:ValueMetaInterface
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.Note 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.
- Specified by:
getMetadataPreview
in interfaceValueMetaInterface
- Parameters:
databaseMeta
- the database metadata to reference capabilities and so on.rs
- A ResultSet from getColumns, positioned correctly on a column to read.- Throws:
KettleDatabaseException
-
getValueFromResultSet
public Object getValueFromResultSet(DatabaseInterface databaseInterface, ResultSet resultSet, int index) throws KettleDatabaseException Get a value from a result set column based on the current value metadata- Specified by:
getValueFromResultSet
in interfaceValueMetaInterface
- Parameters:
databaseInterface
- the database metadata to useresultSet
- The JDBC result set to read fromindex
- The column index (1-based)- Returns:
- The Kettle native data type based on the value metadata
- Throws:
KettleDatabaseException
- in case something goes wrong.
-
setPreparedStatementValue
public void setPreparedStatementValue(DatabaseMeta databaseMeta, PreparedStatement preparedStatement, int index, Object data) throws KettleDatabaseException Description copied from interface:ValueMetaInterface
Set a value on a JDBC prepared statement on the specified position- Specified by:
setPreparedStatementValue
in interfaceValueMetaInterface
- Parameters:
databaseMeta
- the database metadata to referencepreparedStatement
- The prepared statementindex
- the column index (1-based)data
- the value to set- Throws:
KettleDatabaseException
- in case something goes wrong
-
getNativeDataType
Description copied from interface:ValueMetaInterface
This method gives you the native Java data type corresponding to the value meta-data. Conversions from other storage types and other operations are done automatically according to the specified value meta-data.- Specified by:
getNativeDataType
in interfaceValueMetaInterface
- Parameters:
object
- The input data- Returns:
- The native data type
- Throws:
KettleValueException
- in case there is an unexpected data conversion error.
-
getDatabaseColumnTypeDefinition
public String getDatabaseColumnTypeDefinition(DatabaseInterface databaseInterface, String tk, String pk, boolean use_autoinc, boolean add_fieldname, boolean add_cr) Description copied from interface:ValueMetaInterface
Ask for suggestions as to how this plugin data type should be represented in the specified database interface- Specified by:
getDatabaseColumnTypeDefinition
in interfaceValueMetaInterface
- Parameters:
databaseInterface
- 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?- Returns:
- The field type definition
-
getQuotesBeforeSymbol
-
getNativeDataTypeClass
Description copied from interface:ValueMetaInterface
Return the Java class that represents the "native" storage type of this ValueMeta- Specified by:
getNativeDataTypeClass
in interfaceValueMetaInterface
- Returns:
- A Java class
- Throws:
KettleValueException
-
ValueMetaFactory
.createValueMeta() and the loadMetaData() method.