|
Compiere 3.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compiere.util.Util
public class Util
General Utilities
| Constructor Summary | |
|---|---|
Util()
|
|
| Method Summary | |
|---|---|
static String |
cleanMnemonic(String in)
Clean mnemonic Ampersand (used to indicate shortcut) |
static String |
cleanWhitespace(String in)
Clean - Remove all white spaces |
static int |
count(String orig,
String find)
Should return you the number of occurences of "find" in orig |
static String |
crc(String tempStr)
Generate CRC String for tempStr |
static File |
createBackup(File file)
Create Backup of file |
static void |
dump(Map<?,?> map)
Dump a Map (key=value) to out |
static int |
findIndexOf(String str,
char search)
Find index of search character in str. |
static int |
findIndexOf(String str,
char search1,
char search2)
Find index of search characters in str. |
static int |
findIndexOf(String str,
String search)
Find index of search character in str. |
static String |
getBackupName()
Get Backup Name from time |
static int |
getCount(String string,
char countChar)
Get the number of occurances of countChar in string. |
static AttributedCharacterIterator |
getIterator(AttributedString aString,
AttributedCharacterIterator.Attribute[] relevantAttributes)
Return a Iterator with only the relevant attributes. |
static String |
getNextWord(String tempStr)
To split for indexes we will look for the next Word in tempstr |
static String |
initCap(String in)
Init Cap Words With Spaces |
static boolean |
is7Bit(String str)
Is 7 Bit |
static boolean |
is8Bit(String str)
Is 8 Bit |
static boolean |
isAlphaNumeric(String str)
Is String Alpha Numeric |
static boolean |
isEmpty(String str)
Is String Empty |
static boolean |
isEqual(Object o1,
Object o2)
Is Equal. |
static boolean |
isNumeric(String str)
Is String Numeric |
static void |
main(String[] args)
Test |
static String |
maskHTML(String content)
Mask HTML content. |
static String |
maskHTML(String content,
boolean maskCR)
Mask HTML content. |
static void |
printActionInputMap(JComponent comp)
Print Action and Input Map for component |
static String |
remove(String original,
String toBeRemoved,
boolean ignoreCase)
Remove String toBeRemoved from original |
static String |
removeCRLF(String in)
Remove CR / LF from String |
static String |
removeSpecialChar(String tempStr)
For some save scenarios and analysis we should remove special characters, i.e. |
static StringBuffer |
replace(StringBuffer original,
String search,
String replace)
Replace all occurences of search with replace in original |
static StringBuffer |
replace(StringBuffer original,
String search,
String replace,
boolean ignoreCase,
boolean allOccurences)
Replace all or one occurence of search with replace in original |
static String |
replace(String original,
char search,
String replace)
Replace all occurences of search with replace in original |
static String |
replace(String original,
String search,
String replace)
Replace all occurences of search with replace in original |
static String |
replace(String original,
String search,
String replace,
boolean ignoreCase,
boolean allOccurences)
Replace all or one occurence of search with replace in original |
static StringBuffer |
replaceOne(StringBuffer original,
String search,
String replace)
Replace one occurence of search with replace in original |
static String |
replaceOne(String original,
String search,
String replace)
Replace one occurence of search with replace in original |
static StringBuffer |
replaceRegex(StringBuffer original,
String regex,
String replace,
boolean CASE_INSENSITIVE)
Run RegEx Expression against original String |
static String |
replaceRegex(String original,
String regex,
String replace,
boolean CASE_INSENSITIVE)
Run RegEx Expression against original String |
static int |
size(String str)
Size of String in bytes |
static String[] |
split(String searchIn,
String splitter)
This function will split a string based on a split character. |
static byte[] |
toByteArray(String s)
Convert the hex string to byte array |
static String |
toHex(byte b)
Return Hex String representation of byte b |
static String |
toHex(char c)
Return Hex String representation of char c |
static String |
toHexString(byte[] bytes)
Convert the binary to hex string |
static String |
trimLength(String str,
int length)
Trim to max character length |
static String |
trimSize(String str,
int size)
Trim to max byte size |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Util()
| Method Detail |
|---|
public static StringBuffer replace(StringBuffer original,
String search,
String replace)
original - the original Stringsearch - the string to look forreplace - the string we will replace search with
public static String replace(String original,
String search,
String replace)
original - the original Stringsearch - the string to look forreplace - the string we will replace search with
public static String replace(String original,
char search,
String replace)
original - the original Stringsearch - the character to look forreplace - the string we will replace search with
public static StringBuffer replace(StringBuffer original,
String search,
String replace,
boolean ignoreCase,
boolean allOccurences)
original - the original StringBuffersearch - String to get replacedreplace - String to replaceignoreCase - should we ignore casesallOccurences - should all Occurences get replaced
public static String replace(String original,
String search,
String replace,
boolean ignoreCase,
boolean allOccurences)
original - the original StringBuffersearch - String to get replacedreplace - String to replaceignoreCase - should we ignore casesallOccurences - should all Occurences get replaced
public static StringBuffer replaceOne(StringBuffer original,
String search,
String replace)
original - StringBuffersearch - String to look forreplace - String to replace search with
public static String replaceOne(String original,
String search,
String replace)
original - String to look insearch - String to search forreplace - String to replace search with
public static StringBuffer replaceRegex(StringBuffer original,
String regex,
String replace,
boolean CASE_INSENSITIVE)
original - StringBuffer with original contextregex - Regular Expression to run as queryreplace - Replace StringCASE_INSENSITIVE - whether we should take care of case or not
public static String replaceRegex(String original,
String regex,
String replace,
boolean CASE_INSENSITIVE)
original - StringBuffer with original contextregex - Regular Expression to run as queryreplace - Replace StringCASE_INSENSITIVE - whether we should take care of case or not
public static String[] split(String searchIn,
String splitter)
searchIn - The string to splitsplitter - The separator
public static String remove(String original,
String toBeRemoved,
boolean ignoreCase)
original - String to look intoBeRemoved - String to get removedignoreCase - should we take care of case
public static String getNextWord(String tempStr)
tempStr - to look into
public static String removeSpecialChar(String tempStr)
tempStr - to remove Special Char
public static int count(String orig,
String find)
orig - The String to look infind - The String to look for
public static String crc(String tempStr)
throws IOException
tempStr -
IOExceptionpublic static String removeCRLF(String in)
in - input
public static String cleanWhitespace(String in)
in - in
public static String maskHTML(String content)
content - content
public static String maskHTML(String content,
boolean maskCR)
content - contentmaskCR - convert CR into
public static int getCount(String string,
char countChar)
string - String to be searchedcountChar - to be counted character
public static boolean isEmpty(String str)
str - string
public static boolean isAlphaNumeric(String str)
str - string
public static boolean isNumeric(String str)
str - string
public static String getBackupName()
public static File createBackup(File file)
file - original
public static int findIndexOf(String str,
char search)
str - stringsearch - search character
public static int findIndexOf(String str,
char search1,
char search2)
str - stringsearch1 - first search charactersearch2 - second search character (or)
public static int findIndexOf(String str,
String search)
str - stringsearch - search character
public static String toHex(byte b)
b - byte
public static String toHex(char c)
c - character
public static String toHexString(byte[] bytes)
bytes - byte array
public static byte[] toByteArray(String s)
s - hex string
public static String initCap(String in)
in - string
public static AttributedCharacterIterator getIterator(AttributedString aString,
AttributedCharacterIterator.Attribute[] relevantAttributes)
aString - attributed stringrelevantAttributes - relevant attributes
public static void dump(Map<?,?> map)
map - Mappublic static void printActionInputMap(JComponent comp)
comp - Component with ActionMappublic static boolean is8Bit(String str)
str - string
public static boolean is7Bit(String str)
str - string
public static String cleanMnemonic(String in)
in - input
public static String trimLength(String str,
int length)
str - stringlength - max (incl) character length
public static int size(String str)
str - string
public static String trimSize(String str,
int size)
str - stringsize - max size in bytes
public static boolean isEqual(Object o1,
Object o2)
o1 - oneo2 - two
public static void main(String[] args)
args - args
|
Compiere 3.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||