|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.pentaho.di.core.util.StringUtil
public class StringUtil
A collection of utilities to manipulate strings.
Field Summary | |
---|---|
static String |
CRLF
|
static String |
HEX_CLOSE
|
static String |
HEX_OPEN
|
static String |
INDENTCHARS
|
static String[] |
SYSTEM_PROPERTIES
|
static String |
UNIX_CLOSE
|
static String |
UNIX_OPEN
|
static String |
WINDOWS_CLOSE
|
static String |
WINDOWS_OPEN
|
Constructor Summary | |
---|---|
StringUtil()
|
Method Summary | |
---|---|
static String |
environmentSubstitute(String aString,
Map<String,String> systemProperties)
Substitutes variables in aString with the environment
values in the system properties |
static String |
generateRandomString(int length,
String prefix,
String postfix,
boolean uppercase)
|
static String |
getFormattedDateTime(Date date)
Giving back a date/time string in the format following the rule from the most to the least significant |
static String |
getFormattedDateTime(Date date,
boolean milliseconds)
Giving back a date/time string in the format following the rule from the most to the least significant |
static String |
getFormattedDateTimeNow()
Giving back the actual time as a date/time string in the format following the rule from the most to the least significant |
static String |
getFormattedDateTimeNow(boolean milliseconds)
Giving back the actual time as a date/time string in the format following the rule from the most to the least significant |
static String |
getIndent(int indentLevel)
|
static void |
getUsedVariables(String aString,
List<String> list,
boolean includeSystemVariables)
|
static String |
getVariableName(String variable)
remove specification from variable |
static String |
initCap(String st)
|
static boolean |
IsDate(String str)
|
static boolean |
IsDate(String str,
String mask)
|
static boolean |
isEmpty(String string)
Check if the string supplied is empty. |
static boolean |
isEmpty(StringBuffer string)
Check if the stringBuffer supplied is empty. |
static boolean |
IsInteger(String str)
|
static boolean |
IsNumber(String str)
|
static boolean |
isSystemVariable(String aString)
|
static Date |
str2dat(String arg0,
String arg1,
String val)
|
static double |
str2num(String pattern,
String decimal,
String grouping,
String currency,
String value)
|
static String |
substitute(String aString,
Map<String,String> variablesValues,
String open,
String close)
Substitutes variables in aString . |
static String |
substitute(String aString,
Map<String,String> variablesValues,
String open,
String close,
int recursion)
Substitutes variables in aString . |
static String |
substituteHex(String aString)
Substitutes hex values in aString and convert them to operating system char equivalents in the return string. |
static String |
substituteUnix(String aString,
Map<String,String> variables)
Substitutes variables in aString . |
static String |
substituteWindows(String aString,
Map<String,String> variables)
Substitutes variables in aString . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String UNIX_OPEN
public static final String UNIX_CLOSE
public static final String WINDOWS_OPEN
public static final String WINDOWS_CLOSE
public static final String HEX_OPEN
public static final String HEX_CLOSE
public static final String CRLF
public static final String INDENTCHARS
public static final String[] SYSTEM_PROPERTIES
Constructor Detail |
---|
public StringUtil()
Method Detail |
---|
public static String substitute(String aString, Map<String,String> variablesValues, String open, String close)
aString
. Variable names are
delimited by open and close strings. The values are retrieved from the
given map.
aString
- the string on which to apply the substitution.variablesValues
- a map containing the variable values. The keys are the variable
names, the values are the variable values.open
- the open delimiter for variables.close
- the close delimiter for variables.
public static String substitute(String aString, Map<String,String> variablesValues, String open, String close, int recursion)
aString
. Variable names are
delimited by open and close strings. The values are retrieved from the
given map.
aString
- the string on which to apply the substitution.variablesValues
- a map containg the variable values. The keys are the variable
names, the values are the variable values.open
- the open delimiter for variables.close
- the close delimiter for variables.recursion
- the number of recursion (internal counter to avoid endless
loops)
public static String substituteHex(String aString)
aString
and convert them to operating system char equivalents in the return string.
Format is $[01] or $[6F,FF,00,1F]
Example: "This is a hex encoded six digits number 123456 in this string: $[31,32,33,34,35,36]"
aString
- the string on which to apply the substitution.
public static final String environmentSubstitute(String aString, Map<String,String> systemProperties)
aString
with the environment
values in the system properties
aString
- the string on which to apply the substitution.systemProperties
- the system properties to use
public static String substituteUnix(String aString, Map<String,String> variables)
aString
. Variables are of the
form "${
aString
- the string on which to apply the substitution.variables
- a map containg the variable values. The keys are the variable
names, the values are the variable values.
public static String substituteWindows(String aString, Map<String,String> variables)
aString
. Variables are of the
form "%%
aString
- the string on which to apply the substitution.variables
- a map containg the variable values. The keys are the variable
names, the values are the variable values.
public static boolean isSystemVariable(String aString)
public static void getUsedVariables(String aString, List<String> list, boolean includeSystemVariables)
public static final String generateRandomString(int length, String prefix, String postfix, boolean uppercase)
public static String initCap(String st)
public static double str2num(String pattern, String decimal, String grouping, String currency, String value) throws KettleValueException
KettleValueException
public static final boolean isEmpty(String string)
string
- The string to check
public static final boolean isEmpty(StringBuffer string)
string
- The stringBuffer to check
public static Date str2dat(String arg0, String arg1, String val) throws KettleValueException
KettleValueException
public static String getIndent(int indentLevel)
public static String getFormattedDateTime(Date date)
date
- the date to convert
public static String getFormattedDateTime(Date date, boolean milliseconds)
date
- the date to convertmilliseconds
- true when milliseconds should be added
public static String getFormattedDateTimeNow()
public static String getFormattedDateTimeNow(boolean milliseconds)
milliseconds
- true when milliseconds should be added
public static boolean IsInteger(String str)
public static boolean IsNumber(String str)
public static boolean IsDate(String str)
public static boolean IsDate(String str, String mask)
public static final String getVariableName(String variable)
variable
- the variable to look for, with the $ or % variable specification.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |