|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdanbikel.util.Text
public class Text
A set of static utility functions that operate on String
or StringBuffer
objects.
Field Summary | |
---|---|
static Character |
javadocHack
Used so that external links to elements of the Character
class will work. |
Method Summary | |
---|---|
static boolean |
expandVars(Properties props,
StringBuffer sb)
Expands the variables in the specified StringBuffer . |
static boolean |
expandVars(StringBuffer sb)
Expands the variables in the specified StringBuffer . |
static int |
find(StringBuffer sb,
String toFind)
Finds the first occurrence of toFind in the characters
contained in the string buffer sb . |
static int |
find(StringBuffer sb,
String toFind,
int startIdx)
Finds the first occurrence of toFind at or after
startIdx in the characters of the string buffer
sb . |
static boolean |
isAllDigits(String s)
Returns true if s is composed only of
characters for which Character.isDigit(char) returns true ;
returns false otherwise. |
static boolean |
isAllLettersOrDigits(String s)
Returns true if s is composed only of
characters for which Character.isLetterOrDigit(char) returns
true ; returns false otherwise. |
static boolean |
isAllWhitespace(String s)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static Character javadocHack
Character
class will work.
Method Detail |
---|
public static final boolean expandVars(Properties props, StringBuffer sb)
StringBuffer
.
The syntax for a variable is ${var-name}
.
var-name
can either be the name of a property in
props
, the name of a System property or /
,
which will expand to File.separator
, allowing for
platform-independent specification of paths. Variables cannot be nested,
as this method simply looks for the first occurrence of ${
and the next occurence of }
. This type of variable
expansion is identical to the type allowed in Java security
policy files, except that the specified Properties
object is first consulted before that of the System
object. If a variable does not exist as a property, then this
method returns false
and does not alter the
StringBuffer
object.
props
- the Properties
object, or null
if only System properties are to be used for expansionsb
- the StringBuffer
in which to attempt to expand
variables
true
if successful, false
if
there were expansion problemspublic static final boolean expandVars(StringBuffer sb)
StringBuffer
. The
syntax for a variable is ${var-name}
. var-name
can either be the name of a System property, or /
, which will
expand to File.separator
, allowing for platform-independent
specification of paths. Variables cannot be nested, as this method simply
looks for the first occurrence of ${
and the next occurence
of }
. This type of variable expansion is identical to the
type allowed in Java security policy files. If a variable does not exist
as a property, then this method returns false
and does not
alter the StringBuffer
object. Calling this method is
identical to calling
Text.expandVars(null, sb)
sb
- the StringBuffer
in which to attempt to expand
variables
true
if successful, false
if
there were expansion problemspublic static final int find(StringBuffer sb, String toFind)
toFind
in the characters
contained in the string buffer sb
.
sb
- the string buffer to searchtoFind
- the string to search for
toFind
or -1 if toFind
does not occur in sb
public static final int find(StringBuffer sb, String toFind, int startIdx)
toFind
at or after
startIdx
in the characters of the string buffer
sb
.
sb
- the string buffer to searchtoFind
- the string to search forstartIdx
- the index in sb
at which to start
looking for toFind
public static final boolean isAllWhitespace(String s)
public static final boolean isAllDigits(String s)
true
if s
is composed only of
characters for which Character.isDigit(char)
returns true
;
returns false
otherwise.
s
- the string to test
true
if s
contains only digitspublic static final boolean isAllLettersOrDigits(String s)
true
if s
is composed only of
characters for which Character.isLetterOrDigit(char)
returns
true
; returns false
otherwise.
s
- the string to test
true
if s
contains only letters or
digits
|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |