@Immutable public final class CSSParseHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static char |
URL_ESCAPE_CHAR
The character used to quote elements in CSS URLs
|
| Modifier and Type | Method and Description |
|---|---|
static String |
extractStringValue(String sStr)
Remove surrounding quotes (single or double) of a string (if present).
|
static String |
splitNumber(StringBuilder aPattern) |
static String |
trimUrl(CharSequence s)
Remove the leading "url(" and the trailing ")" from an URL CSS value.
|
static String |
unescapeOther(StringBuilder aImage)
Unescape e.g.
|
static String |
unescapeUnicode(StringBuilder aImage)
Unescape e.g.
|
static String |
unescapeURL(String sEscapedURL)
Unescape all escaped characters in a CSS URL.
|
static String |
validateIdentifier(StringBuilder aPattern)
In CSS, identifiers (including element names, classes, and IDs in
selectors) can contain only the characters [a-zA-Z0-9] and ISO 10646
characters U+00A0 and higher, plus the hyphen (-) and the underscore (_);
they cannot start with a digit, two hyphens, or a hyphen followed by a
digit.
|
public static final char URL_ESCAPE_CHAR
@Nullable public static String extractStringValue(@Nullable String sStr)
sStr - The string where the quotes should be removed@Nonnull public static String unescapeURL(@Nonnull String sEscapedURL)
sEscapedURL - The escaped URL. May not be null!@Nonnull public static String trimUrl(@Nonnull CharSequence s)
s - The value to remove the string from.null.@Nonnull public static String splitNumber(@Nonnull StringBuilder aPattern)
@Nonnull public static String validateIdentifier(@Nonnull StringBuilder aPattern)
aPattern - pattern to check@Nonnull public static String unescapeUnicode(StringBuilder aImage)
\26 or \000026 to
&.aImage - Source string@Nonnull public static String unescapeOther(StringBuilder aImage)
\x to x.aImage - Source stringCopyright © 2014–2022 Philip Helger. All rights reserved.