public class EscapingUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static char |
DOUBLE_QUOTE_CHAR |
static String |
NON_BREAKING_SPACE |
static char |
SPECIAL_CHAR |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isConstantNumber(String string)
Returns true is the given string is a constant number
|
static boolean |
isGarbageText(String value)
Quotes a string if not a representation of an integer number >= 0 (dlv does not support it).
|
static boolean |
isNonBreakingSpace(String nodeValue)
Checks if the given string matches the regex [ ] for a non-breaking-space
|
static boolean |
isQuotedString(String quotedStringValue)
Checks whether a string is properly quoted (e.g, "quotedStringValue")
|
static String |
normalizeTextNodes(String nodeValue) |
static String |
quoteUnquotedString(String unquotedString)
Wraps a string into double quotes (producing "unquotedString")
|
static boolean |
sameURL(URL url,
URL ourl)
Compares two URLs ignoring # or / at the end.
|
static URL |
stringToUrl(String urlString)
|
static URI |
urlToUri(URL url)
|
public static final char SPECIAL_CHAR
public static final char DOUBLE_QUOTE_CHAR
public static final String NON_BREAKING_SPACE
public static URI urlToUri(URL url)
URL into a URI, turning any exceptions into runtime exceptions. NEVER USE
URL.toURI() as that method fails if the URL contains unencoded, unsafe characters such as | which are
allowed in java's URL implementation but not in URI.public static boolean sameURL(URL url, URL ourl)
public static URL stringToUrl(String urlString) throws MalformedURLException
MalformedURLExceptionpublic static boolean isGarbageText(String value)
value - the string to quotepublic static boolean isConstantNumber(String string)
string - the input stringpublic static String quoteUnquotedString(String unquotedString)
unquotedString - the value to quotepublic static boolean isQuotedString(String quotedStringValue)
quotedStringValue - true if quotedStringValue is properly quoted (e.g, "quotedStringValue"), false
otherwisepublic static boolean isNonBreakingSpace(String nodeValue)
nodeValue - the string to checktrue if the given string matches the regex [ ], false otherwiseCopyright © 2020 OXPath Team. All rights reserved.