Package org.pentaho.di.core.row
Class ValueDataUtil
java.lang.Object
org.pentaho.di.core.row.ValueDataUtil
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic Objectabs(ValueMetaInterface metaA, Object dataA) static ObjectaddDays(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) static ObjectaddHours(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) static ObjectaddMinutes(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) static ObjectaddMonths(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) static ObjectaddSeconds(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) static ObjectaddTimeToDate(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB, ValueMetaInterface metaC, Object dataC) static StringbyteToHexEncode(ValueMetaInterface metaA, Object dataA) Change a string into its hexadecimal representation.static Objectceil(ValueMetaInterface metaA, Object dataA) static StringcharToHexEncode(ValueMetaInterface meta, Object data) Change a string into its hexadecimal representation.static LongchecksumAdler32(ValueMetaInterface metaA, Object dataA, boolean failIfNoFile) static LongChecksumAdler32(ValueMetaInterface metaA, Object dataA) Deprecated.static LongchecksumCRC32(ValueMetaInterface metaA, Object dataA, boolean failIfNoFile) static LongChecksumCRC32(ValueMetaInterface metaA, Object dataA) Deprecated.static Objectcombination1(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB, ValueMetaInterface metaC, Object dataC) A + B * Cstatic Objectcombination2(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) SQRT( A*A + B*B )static StringcreateChecksum(ValueMetaInterface metaA, Object dataA, String type) Deprecated.static StringcreateChecksum(ValueMetaInterface metaA, Object dataA, String type, boolean failIfNoFile) static ObjectDateDiff(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB, String resultType) Returns the number of days that have elapsed between dataA and dataB.static ObjectDateWorkingDiff(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) static ObjectdayOfMonth(ValueMetaInterface metaA, Object dataA) static ObjectdayOfWeek(ValueMetaInterface metaA, Object dataA) static ObjectdayOfYear(ValueMetaInterface metaA, Object dataA) static Objectdivide(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) Deprecated.static Objectdivide(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB, VariableSpace space) static BigDecimaldivideBigDecimals(BigDecimal a, BigDecimal b, MathContext mc) Deprecated.static BigDecimaldivideBigDecimals(BigDecimal a, BigDecimal b, VariableSpace space) static DoubledivideDoubles(Double a, Double b) static LongdivideLongs(Long a, Long b) static StringescapeHTML(ValueMetaInterface metaA, Object dataA) static StringescapeSQL(ValueMetaInterface metaA, Object dataA) static StringescapeXML(ValueMetaInterface metaA, Object dataA) static Objectfloor(ValueMetaInterface metaA, Object dataA) static Stringget_Double_Metaphone(ValueMetaInterface metaA, Object dataA) static Stringget_Metaphone(ValueMetaInterface metaA, Object dataA) static Stringget_RefinedSoundEx(ValueMetaInterface metaA, Object dataA) static Stringget_SoundEx(ValueMetaInterface metaA, Object dataA) static LonggetDamerauLevenshtein_Distance(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) DamerauLevenshtein distance is a measure of the similarity between two strings, which we will refer to as the source string (s) and the target string (t).static StringgetDigits(ValueMetaInterface metaA, Object dataA) static StringgetFileEncoding(ValueMetaInterface metaA, Object dataA) Deprecated.static StringgetFileEncoding(ValueMetaInterface metaA, Object dataA, boolean failIfNoFile) Get file encoding.static DoublegetJaro_Similitude(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) Jaro similitude is a measure of the similarity between two strings, which we will refer to as the source string (s) and the target string (t).static DoublegetJaroWinkler_Similitude(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) JaroWinkler similitude is a measure of the similarity between two strings, which we will refer to as the source string (s) and the target string (t).static LonggetLevenshtein_Distance(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) Levenshtein distance (LD) is a measure of the similarity between two strings, which we will refer to as the source string (s) and the target string (t).static LonggetNeedlemanWunsch_Distance(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) NeedlemanWunsch distance is a measure of the similarity between two strings, which we will refer to as the source string (s) and the target string (t).static ObjectDefault utility method to get exact zero value according to ValueMetaInterface.static StringhexToByteDecode(ValueMetaInterface meta, Object data) Change a hexadecimal string into normal ASCII representation.static StringhexToCharDecode(ValueMetaInterface meta, Object data) Change a hexadecimal string into normal ASCII representation.static ObjecthourOfDay(ValueMetaInterface metaA, Object dataA) static StringinitCap(ValueMetaInterface metaA, Object dataA) static final booleanisSpace(char c) Deprecated.UseConst.isSpace(char)insteadstatic booleanisXMLFileWellFormed(ValueMetaInterface metaA, Object dataA) Deprecated.static booleanisXMLFileWellFormed(ValueMetaInterface metaA, Object dataA, boolean failIfNoFile) Checks an xml file is well formed.static booleanisXMLWellFormed(ValueMetaInterface metaA, Object dataA) Checks an xml string is well formed.static final StringDeprecated.UseConst.ltrim(String)insteadstatic ObjectloadFileContentInBinary(ValueMetaInterface metaA, Object dataA) Deprecated.static byte[]loadFileContentInBinary(ValueMetaInterface metaA, Object dataA, boolean failIfNoFile) static StringlowerCase(ValueMetaInterface metaA, Object dataA) static Objectminus(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) static ObjectminuteOfHour(ValueMetaInterface metaA, Object dataA) static ObjectmonthOfDate(ValueMetaInterface metaA, Object dataA) static Objectmultiply(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) static BigDecimalmultiplyBigDecimals(BigDecimal a, BigDecimal b, MathContext mc) static DoublemultiplyDoubles(Double a, Double b) static LongmultiplyLongs(Long a, Long b) protected static ObjectmultiplyNumeric(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) protected static ObjectmultiplyString(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) static final intnrSpacesAfter(String field) Count the number of spaces to the right of a text.static final intnrSpacesBefore(String field) Count the number of spaces to the left of a text.static Objectnvl(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) static final booleanonlySpaces(String str) Checks whether or not a String consists only of spaces.static Objectpercent1(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) Deprecated.static Objectpercent1(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB, VariableSpace space) static Objectpercent2(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) Deprecated.static Objectpercent2(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB, VariableSpace space) static Objectpercent3(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) Deprecated.static Objectpercent3(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB, VariableSpace space) static Objectplus(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) static Objectplus3(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB, ValueMetaInterface metaC, Object dataC) static ObjectquarterOfDate(ValueMetaInterface metaA, Object dataA) static Objectremainder(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) Returns the remainder (modulus) of A / B.static StringremoveCR(ValueMetaInterface metaA, Object dataA) static StringremoveCRLF(ValueMetaInterface metaA, Object dataA) static StringremoveDigits(ValueMetaInterface metaA, Object dataA) static StringremoveLF(ValueMetaInterface metaA, Object dataA) static StringremoveTAB(ValueMetaInterface metaA, Object dataA) static ObjectremoveTimeFromDate(ValueMetaInterface metaA, Object dataA) static final StringReplace value occurances in a String with another value.static voidreplaceBuffer(StringBuffer str, String code, String repl) Alternate faster version of string replace using a stringbuffer as input.static final StringrightPad(StringBuffer ret, int limit) Right pad a StringBuffer: adds spaces to a string until a certain length.static final StringRight pad a string: adds spaces to a string until a certain length.static final StringDeprecated.UseConst.rtrim(String)insteadstatic Objectround(ValueMetaInterface metaA, Object dataA) Rounding with no decimal places (using default rounding method ROUND_HALF_CEILING)static Objectround(ValueMetaInterface metaA, Object dataA, int roundingMode) Rounding with no decimal places with a given rounding methodstatic Objectround(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) Rounding with decimal places (using default rounding method ROUND_HALF_EVEN)static Objectround(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB, int roundingMode) Rounding with decimal places with a given rounding methodstatic Objectround(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB, ValueMetaInterface metaC, Object dataC) Rounding with decimal places with a given rounding methodstatic ObjectsecondOfMinute(ValueMetaInterface metaA, Object dataA) static Objectsqrt(ValueMetaInterface metaA, Object dataA) static longstringLen(ValueMetaInterface metaA, Object dataA) static Objectsum(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) static final StringDeprecated.UseConst.trim(String)insteadstatic StringunEscapeHTML(ValueMetaInterface metaA, Object dataA) static StringunEscapeXML(ValueMetaInterface metaA, Object dataA) static StringupperCase(ValueMetaInterface metaA, Object dataA) static StringuseCDATA(ValueMetaInterface metaA, Object dataA) static ObjectweekOfYear(ValueMetaInterface metaA, Object dataA) static ObjectweekOfYearISO8601(ValueMetaInterface metaA, Object dataA) static ObjectyearOfDate(ValueMetaInterface metaA, Object dataA) static ObjectyearOfDateISO8601(ValueMetaInterface metaA, Object dataA) 
- 
Constructor Details- 
ValueDataUtilpublic ValueDataUtil()
 
- 
- 
Method Details- 
leftTrimDeprecated.UseConst.ltrim(String)instead
- 
rightTrimDeprecated.UseConst.rtrim(String)instead
- 
isSpaceDeprecated.UseConst.isSpace(char)insteadDetermines whether or not a character is considered a space. A character is considered a space in Kettle if it is a space, a tab, a newline or a cariage return.- Parameters:
- c- The character to verify if it is a space.
- Returns:
- true if the character is a space. false otherwise.
 
- 
trimDeprecated.UseConst.trim(String)insteadTrims a string: removes the leading and trailing spaces of a String.- Parameters:
- string- The string to trim
- Returns:
- The trimmed string.
 
- 
getLevenshtein_Distancepublic static Long getLevenshtein_Distance(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) Levenshtein distance (LD) is a measure of the similarity between two strings, which we will refer to as the source string (s) and the target string (t). The distance is the number of deletions, insertions, or substitutions required to transform s into t.
- 
getDamerauLevenshtein_Distancepublic static Long getDamerauLevenshtein_Distance(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) DamerauLevenshtein distance is a measure of the similarity between two strings, which we will refer to as the source string (s) and the target string (t). The distance is the number of deletions, insertions, or substitutions required to transform s into t.
- 
getNeedlemanWunsch_Distancepublic static Long getNeedlemanWunsch_Distance(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) NeedlemanWunsch distance is a measure of the similarity between two strings, which we will refer to as the source string (s) and the target string (t). The distance is the number of deletions, insertions, or substitutions required to transform s into t.
- 
getJaro_Similitudepublic static Double getJaro_Similitude(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) Jaro similitude is a measure of the similarity between two strings, which we will refer to as the source string (s) and the target string (t).
- 
getJaroWinkler_Similitudepublic static Double getJaroWinkler_Similitude(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) JaroWinkler similitude is a measure of the similarity between two strings, which we will refer to as the source string (s) and the target string (t).
- 
get_Metaphone
- 
get_Double_Metaphone
- 
get_SoundEx
- 
get_RefinedSoundEx
- 
initCap
- 
upperCase
- 
lowerCase
- 
escapeXML
- 
unEscapeXML
- 
escapeHTML
- 
unEscapeHTML
- 
escapeSQL
- 
useCDATA
- 
removeCR
- 
removeLF
- 
removeCRLF
- 
removeTAB
- 
getDigits
- 
removeDigits
- 
stringLen
- 
createChecksum@Deprecated public static String createChecksum(ValueMetaInterface metaA, Object dataA, String type) Deprecated.
- 
createChecksumpublic static String createChecksum(ValueMetaInterface metaA, Object dataA, String type, boolean failIfNoFile) throws KettleFileNotFoundException - Parameters:
- metaA- The ValueMetaInterface
- dataA- Filename
- type- Algorithm to be used when computing the checksum (MD5 or SHA-1)
- failIfNoFile- Indicates if the transformation should fail if no file is found
- Returns:
- File's checksum
- Throws:
- KettleFileNotFoundException
 
- 
ChecksumCRC32Deprecated.
- 
checksumCRC32public static Long checksumCRC32(ValueMetaInterface metaA, Object dataA, boolean failIfNoFile) throws KettleFileNotFoundException - Parameters:
- metaA- The ValueMetaInterface
- dataA- Filename
- failIfNoFile- Indicates if the transformation should fail if no file is found
- Returns:
- File's CRC32 checksum
- Throws:
- KettleFileNotFoundException
 
- 
ChecksumAdler32Deprecated.
- 
checksumAdler32public static Long checksumAdler32(ValueMetaInterface metaA, Object dataA, boolean failIfNoFile) throws KettleFileNotFoundException - Parameters:
- metaA- The ValueMetaInterface
- dataA- Filename
- failIfNoFile- Indicates if the transformation should fail if no file is found
- Returns:
- File's Adler32 checksum
- Throws:
- KettleFileNotFoundException
 
- 
pluspublic static Object plus(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) throws KettleValueException - Throws:
- KettleValueException
 
- 
plus3public static Object plus3(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB, ValueMetaInterface metaC, Object dataC) throws KettleValueException - Throws:
- KettleValueException
 
- 
sumpublic static Object sum(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) throws KettleValueException - Throws:
- KettleValueException
 
- 
loadFileContentInBinary@Deprecated public static Object loadFileContentInBinary(ValueMetaInterface metaA, Object dataA) throws KettleValueException Deprecated.- Throws:
- KettleValueException
 
- 
loadFileContentInBinarypublic static byte[] loadFileContentInBinary(ValueMetaInterface metaA, Object dataA, boolean failIfNoFile) throws KettleValueException, KettleFileNotFoundException - Parameters:
- metaA- The ValueMetaInterface
- dataA- Filename
- failIfNoFile- Indicates if the transformation should fail if no file is found
- Returns:
- File's content in binary
- Throws:
- KettleValueException
- KettleFileNotFoundException
 
- 
minuspublic static Object minus(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) throws KettleValueException - Throws:
- KettleValueException
 
- 
multiplypublic static Object multiply(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) throws KettleValueException - Throws:
- KettleValueException
 
- 
multiplyNumericprotected static Object multiplyNumeric(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) throws KettleValueException - Throws:
- KettleValueException
 
- 
multiplyDoubles
- 
multiplyLongs
- 
multiplyBigDecimals
- 
multiplyStringprotected static Object multiplyString(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) throws KettleValueException - Throws:
- KettleValueException
 
- 
divide@Deprecated public static Object divide(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) throws KettleValueException Deprecated.- Throws:
- KettleValueException
 
- 
dividepublic static Object divide(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB, VariableSpace space) throws KettleValueException - Throws:
- KettleValueException
 
- 
divideDoubles
- 
divideLongs
- 
divideBigDecimalsDeprecated.
- 
divideBigDecimals
- 
sqrt- Throws:
- KettleValueException
 
- 
percent1@Deprecated public static Object percent1(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) throws KettleValueException Deprecated.100 * A / B- Parameters:
- metaA-
- dataA-
- metaB-
- dataB-
- Returns:
- Throws:
- KettleValueException
 
- 
percent1public static Object percent1(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB, VariableSpace space) throws KettleValueException - Throws:
- KettleValueException
 
- 
percent2@Deprecated public static Object percent2(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) throws KettleValueException Deprecated.A - ( A * B / 100 )- Parameters:
- metaA-
- dataA-
- metaB-
- dataB-
- Returns:
- Throws:
- KettleValueException
 
- 
percent2public static Object percent2(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB, VariableSpace space) throws KettleValueException - Throws:
- KettleValueException
 
- 
percent3@Deprecated public static Object percent3(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) throws KettleValueException Deprecated.A + ( A * B / 100 )- Parameters:
- metaA-
- dataA-
- metaB-
- dataB-
- Returns:
- Throws:
- KettleValueException
 
- 
percent3public static Object percent3(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB, VariableSpace space) throws KettleValueException - Throws:
- KettleValueException
 
- 
combination1public static Object combination1(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB, ValueMetaInterface metaC, Object dataC) throws KettleValueException A + B * C- Parameters:
- metaA-
- dataA-
- metaB-
- dataB-
- Returns:
- Throws:
- KettleValueException
 
- 
combination2public static Object combination2(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) throws KettleValueException SQRT( A*A + B*B )- Parameters:
- metaA-
- dataA-
- metaB-
- dataB-
- Returns:
- Throws:
- KettleValueException
 
- 
roundRounding with no decimal places (using default rounding method ROUND_HALF_CEILING)- Parameters:
- metaA- Metadata of value to round
- dataA- Value to round
- Returns:
- The rounded value
- Throws:
- KettleValueException
 
- 
roundpublic static Object round(ValueMetaInterface metaA, Object dataA, int roundingMode) throws KettleValueException Rounding with no decimal places with a given rounding method- Parameters:
- metaA- Metadata of value to round
- dataA- Value to round
- roundingMode- The mode for rounding, e.g. java.math.BigDecimal.ROUND_HALF_EVEN
- Returns:
- The rounded value
- Throws:
- KettleValueException
 
- 
roundpublic static Object round(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) throws KettleValueException Rounding with decimal places (using default rounding method ROUND_HALF_EVEN)- Parameters:
- metaA- Metadata of value to round
- dataA- Value to round
- metaB- Metadata of decimal places
- dataB- decimal places
- Returns:
- The rounded value
- Throws:
- KettleValueException
 
- 
roundpublic static Object round(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB, int roundingMode) throws KettleValueException Rounding with decimal places with a given rounding method- Parameters:
- metaA- Metadata of value to round
- dataA- Value to round
- metaB- Metadata of decimal places
- dataB- decimal places
- roundingMode- roundingMode The mode for rounding, e.g. java.math.BigDecimal.ROUND_HALF_EVEN
- Returns:
- The rounded value
- Throws:
- KettleValueException
 
- 
roundpublic static Object round(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB, ValueMetaInterface metaC, Object dataC) throws KettleValueException Rounding with decimal places with a given rounding method- Parameters:
- metaA- Metadata of value to round
- dataA- Value to round
- metaB- Metadata of decimal places
- dataB- decimal places
- metaC- Metadata of rounding mode
- dataC- rounding mode, e.g. java.math.BigDecimal.ROUND_HALF_EVEN
- Returns:
- The rounded value
- Throws:
- KettleValueException
 
- 
ceil- Throws:
- KettleValueException
 
- 
floor- Throws:
- KettleValueException
 
- 
abs- Throws:
- KettleValueException
 
- 
remainderpublic static Object remainder(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) throws KettleValueException Returns the remainder (modulus) of A / B.- Parameters:
- metaA-
- dataA- The dividend
- metaB-
- dataB- The divisor
- Returns:
- The remainder
- Throws:
- KettleValueException
 
- 
nvlpublic static Object nvl(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) throws KettleValueException - Throws:
- KettleValueException
 
- 
removeTimeFromDatepublic static Object removeTimeFromDate(ValueMetaInterface metaA, Object dataA) throws KettleValueException - Throws:
- KettleValueException
 
- 
addTimeToDatepublic static Object addTimeToDate(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB, ValueMetaInterface metaC, Object dataC) throws KettleValueException - Throws:
- KettleValueException
 
- 
addDayspublic static Object addDays(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) throws KettleValueException - Throws:
- KettleValueException
 
- 
addHourspublic static Object addHours(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) throws KettleValueException - Throws:
- KettleValueException
 
- 
addMinutespublic static Object addMinutes(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) throws KettleValueException - Throws:
- KettleValueException
 
- 
addSecondspublic static Object addSeconds(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) throws KettleValueException - Throws:
- KettleValueException
 
- 
addMonthspublic static Object addMonths(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) throws KettleValueException - Throws:
- KettleValueException
 
- 
DateDiffpublic static Object DateDiff(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB, String resultType) throws KettleValueException Returns the number of days that have elapsed between dataA and dataB.- Parameters:
- metaA-
- dataA- The "end date"
- metaB-
- dataB- The "start date"
- resultType- The "result type" (ms, s, mn, h, d)
- Returns:
- Number of days
- Throws:
- KettleValueException
 
- 
DateWorkingDiffpublic static Object DateWorkingDiff(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB) throws KettleValueException - Throws:
- KettleValueException
 
- 
yearOfDate- Throws:
- KettleValueException
 
- 
monthOfDatepublic static Object monthOfDate(ValueMetaInterface metaA, Object dataA) throws KettleValueException - Throws:
- KettleValueException
 
- 
quarterOfDatepublic static Object quarterOfDate(ValueMetaInterface metaA, Object dataA) throws KettleValueException - Throws:
- KettleValueException
 
- 
dayOfYear- Throws:
- KettleValueException
 
- 
dayOfMonth- Throws:
- KettleValueException
 
- 
hourOfDay- Throws:
- KettleValueException
 
- 
minuteOfHourpublic static Object minuteOfHour(ValueMetaInterface metaA, Object dataA) throws KettleValueException - Throws:
- KettleValueException
 
- 
secondOfMinutepublic static Object secondOfMinute(ValueMetaInterface metaA, Object dataA) throws KettleValueException - Throws:
- KettleValueException
 
- 
dayOfWeek- Throws:
- KettleValueException
 
- 
weekOfYear- Throws:
- KettleValueException
 
- 
weekOfYearISO8601public static Object weekOfYearISO8601(ValueMetaInterface metaA, Object dataA) throws KettleValueException - Throws:
- KettleValueException
 
- 
yearOfDateISO8601public static Object yearOfDateISO8601(ValueMetaInterface metaA, Object dataA) throws KettleValueException - Throws:
- KettleValueException
 
- 
hexToByteDecodepublic static String hexToByteDecode(ValueMetaInterface meta, Object data) throws KettleValueException Change a hexadecimal string into normal ASCII representation. E.g. if Value contains string "61" afterwards it would contain value "a". If the hexadecimal string is of odd length a leading zero will be used. Note that only the low byte of a character will be processed, this is for binary transformations.- Returns:
- Value itself
- Throws:
- KettleValueException
 
- 
byteToHexEncodepublic static String byteToHexEncode(ValueMetaInterface metaA, Object dataA) throws KettleValueException Change a string into its hexadecimal representation. E.g. if Value contains string "a" afterwards it would contain value "0061". Note that transformations happen in groups of 4 hex characters, so the value of a characters is always in the range 0-65535.- Returns:
- Throws:
- KettleValueException
 
- 
charToHexEncodepublic static String charToHexEncode(ValueMetaInterface meta, Object data) throws KettleValueException Change a string into its hexadecimal representation. E.g. if Value contains string "a" afterwards it would contain value "0061". Note that transformations happen in groups of 4 hex characters, so the value of a characters is always in the range 0-65535.- Returns:
- A string with Hex code
- Throws:
- KettleValueException- In case of a data conversion problem.
 
- 
hexToCharDecodepublic static String hexToCharDecode(ValueMetaInterface meta, Object data) throws KettleValueException Change a hexadecimal string into normal ASCII representation. E.g. if Value contains string "61" afterwards it would contain value "a". If the hexadecimal string is of a wrong length leading zeroes will be used. Note that transformations happen in groups of 4 hex characters, so the value of a characters is always in the range 0-65535.- Returns:
- A hex-to-char decoded String
- Throws:
- KettleValueException
 
- 
rightPadRight pad a string: adds spaces to a string until a certain length. If the length is smaller then the limit specified, the String is truncated.- Parameters:
- ret- The string to pad
- limit- The desired length of the padded string.
- Returns:
- The padded String.
 
- 
rightPadRight pad a StringBuffer: adds spaces to a string until a certain length. If the length is smaller then the limit specified, the String is truncated.- Parameters:
- ret- The StringBuffer to pad
- limit- The desired length of the padded string.
- Returns:
- The padded String.
 
- 
replaceReplace value occurances in a String with another value.- Parameters:
- string- The original String.
- repl- The text to replace
- with- The new text bit
- Returns:
- The resulting string with the text pieces replaced.
 
- 
replaceBufferAlternate faster version of string replace using a stringbuffer as input.- Parameters:
- str- The string where we want to replace in
- code- The code to search for
- repl- The replacement string for code
 
- 
nrSpacesBeforeCount the number of spaces to the left of a text. (leading)- Parameters:
- field- The text to examine
- Returns:
- The number of leading spaces found.
 
- 
nrSpacesAfterCount the number of spaces to the right of a text. (trailing)- Parameters:
- field- The text to examine
- Returns:
- The number of trailing spaces found.
 
- 
onlySpacesChecks whether or not a String consists only of spaces.- Parameters:
- str- The string to check
- Returns:
- true if the string has nothing but spaces.
 
- 
isXMLFileWellFormedDeprecated.Checks an xml file is well formed.- Parameters:
- metaA- The ValueMetaInterface
- dataA- The value (filename)
- Returns:
- true if the file is well formed.
 
- 
isXMLFileWellFormedpublic static boolean isXMLFileWellFormed(ValueMetaInterface metaA, Object dataA, boolean failIfNoFile) throws KettleFileNotFoundException Checks an xml file is well formed.- Parameters:
- metaA- The ValueMetaInterface
- dataA- The value (filename)
- failIfNoFile- Indicates if the transformation should fail if no file is found
- Returns:
- true if the file is well formed.
- Throws:
- KettleFileNotFoundException
 
- 
isXMLWellFormedChecks an xml string is well formed.- Parameters:
- metaA- The ValueMetaInterface
- dataA- The value (filename)
- Returns:
- true if the file is well formed.
 
- 
getFileEncoding@Deprecated public static String getFileEncoding(ValueMetaInterface metaA, Object dataA) throws KettleValueException Deprecated.Get file encoding.- Parameters:
- metaA- The ValueMetaInterface
- dataA- The value (filename)
- Returns:
- file encoding.
- Throws:
- KettleValueException
 
- 
getFileEncodingpublic static String getFileEncoding(ValueMetaInterface metaA, Object dataA, boolean failIfNoFile) throws KettleValueException, KettleFileNotFoundException Get file encoding.- Parameters:
- metaA- The ValueMetaInterface
- dataA- The value (filename)
- failIfNoFile- Indicates if the transformation should fail if no file is found
- Returns:
- file encoding.
- Throws:
- KettleFileNotFoundException
- KettleValueException
 
- 
getZeroForValueMetaTypeDefault utility method to get exact zero value according to ValueMetaInterface. Using this utility method saves from ClassCastExceptions later.- Parameters:
- type-
- Returns:
- Throws:
- KettleValueException
 
 
- 
checksumAdler32(ValueMetaInterface, Object, boolean)instead