|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectprettify.parser.Util
public class Util
Common Utilities. Some of the functions are port from JavaScript.
| Constructor Summary | |
|---|---|
protected |
Util()
|
| Method Summary | |
|---|---|
static java.lang.Boolean |
getVariableValueAsBoolean(java.lang.Object var)
Treat a variable as an boolean in JavaScript style. |
static java.lang.Integer |
getVariableValueAsInteger(java.lang.Object var)
Treat a variable as an integer in JavaScript style. |
static java.lang.String |
join(java.util.List<java.lang.String> strings)
Join the strings into one string. |
static java.lang.String |
join(java.util.List<java.lang.String> strings,
java.lang.String delimiter)
Join the strings into one string with delimiter in
between. |
static java.lang.String |
join(java.lang.String[] strings)
Join the strings into one string. |
static java.lang.String |
join(java.lang.String[] strings,
java.lang.String delimiter)
Join the strings into one string with delimiter in
between. |
static java.lang.String[] |
match(java.util.regex.Pattern pattern,
java.lang.String string,
boolean isGlobal)
Get all the matches for string compiled by pattern. |
static java.util.List<java.lang.Object> |
removeDuplicates(java.util.List<java.lang.Object> decorations,
java.lang.String source)
Remove identical adjacent tags from decorations. |
static boolean |
test(java.util.regex.Pattern pattern,
java.lang.String string)
Test whether the string has at least one match by
pattern. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected Util()
| Method Detail |
|---|
public static java.lang.Boolean getVariableValueAsBoolean(java.lang.Object var)
var - the variable to get value from
public static java.lang.Integer getVariableValueAsInteger(java.lang.Object var)
var - the variable to get value from
java.lang.IllegalArgumentException - the data type of var is neither
integer nor boolean.
public static java.lang.String[] match(java.util.regex.Pattern pattern,
java.lang.String string,
boolean isGlobal)
string compiled by pattern. If
isGlobal is true, the return results will only include the
group 0 matches. It is similar to string.match(regexp) in JavaScript.
pattern - the regexpstring - the stringisGlobal - similar to JavaScript /g flag
public static boolean test(java.util.regex.Pattern pattern,
java.lang.String string)
string has at least one match by
pattern.
pattern - the regexpstring - the string to test
public static java.lang.String join(java.util.List<java.lang.String> strings)
strings into one string.
strings - the string list to join
public static java.lang.String join(java.util.List<java.lang.String> strings,
java.lang.String delimiter)
strings into one string with delimiter in
between.
strings - the string list to joindelimiter - the delimiter
public static java.lang.String join(java.lang.String[] strings)
strings into one string.
strings - the string list to join
public static java.lang.String join(java.lang.String[] strings,
java.lang.String delimiter)
strings into one string with delimiter in
between. It is similar to RegExpObject.test(string) in JavaScript.
strings - the string list to joindelimiter - the delimiter
public static java.util.List<java.lang.Object> removeDuplicates(java.util.List<java.lang.Object> decorations,
java.lang.String source)
decorations.
decorations - see Job.decorationssource - the source code
decorations after treatment
java.lang.IllegalArgumentException - the size of decoration is not
a multiple of 2
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||