|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.htmlcleaner.Utils
public class Utils
Common utilities.
Field Summary | |
---|---|
static Map<Character,String> |
RESERVED_XML_CHARS
|
static String |
VAR_END
|
static String |
VAR_START
|
Constructor Summary | |
---|---|
Utils()
|
Method Summary | |
---|---|
static String |
escapeXml(String s,
CleanerProperties props,
boolean isDomCreation)
Escapes XML string. |
static String |
evaluateTemplate(String template,
Map variables)
Evaluates string template for specified map of variables. |
static String |
fullUrl(String pageUrl,
String link)
Calculates full URL for specified page URL and link which could be full, absolute or relative like there can be found in A or IMG tags. |
static String |
getCharsetFromContent(URL url)
|
static String |
getCharsetFromContentTypeString(String contentType)
|
static String |
getXmlName(String name)
|
static String |
getXmlNSPrefix(String name)
|
static boolean |
isEmptyString(Object o)
|
static boolean |
isFullUrl(String link)
Checks if specified link is full URL. |
static boolean |
isHexadecimalDigit(char ch)
|
static boolean |
isIdentifierHelperChar(char ch)
Checks if specified character can be part of xml identifier (tag name of attribute name) and is not standard identifier character. |
static boolean |
isReservedXmlChar(char ch)
|
static boolean |
isValidInt(String s,
int radix)
|
static boolean |
isValidXmlChar(char ch)
|
static boolean |
isValidXmlIdentifier(String s)
Chacks whether specified string can be valid tag name or attribute name in xml. |
static boolean |
isWhitespaceString(Object object)
Checks whether specified object's string representation is empty string (containing of only whitespaces). |
static String |
ltrim(String s)
Trims specified string from left. |
static String |
rtrim(String s)
Trims specified string from right. |
static String[] |
tokenize(String s,
String delimiters)
|
static void |
updateTagTransformations(CleanerTransformations transformations,
String key,
String value)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static String VAR_START
public static String VAR_END
public static final Map<Character,String> RESERVED_XML_CHARS
Constructor Detail |
---|
public Utils()
Method Detail |
---|
public static String ltrim(String s)
s
- public static String rtrim(String s)
s
- public static String getCharsetFromContentTypeString(String contentType)
public static String getCharsetFromContent(URL url) throws IOException
IOException
public static boolean isHexadecimalDigit(char ch)
public static boolean isValidXmlChar(char ch)
public static boolean isReservedXmlChar(char ch)
public static boolean isValidInt(String s, int radix)
public static String escapeXml(String s, CleanerProperties props, boolean isDomCreation)
s
- String to be escapedprops
- Cleaner properties gover affect escaping behaviourisDomCreation
- Tells if escaped content will be part of the DOMpublic static boolean isWhitespaceString(Object object)
object
- Object whose string representation is checked
public static boolean isIdentifierHelperChar(char ch)
ch
- Character to be checked
public static boolean isValidXmlIdentifier(String s)
s
- String to be checked
public static boolean isEmptyString(Object o)
o
-
public static String evaluateTemplate(String template, Map variables)
template
- Template stringvariables
- Map of variables (can be null)
public static String[] tokenize(String s, String delimiters)
public static void updateTagTransformations(CleanerTransformations transformations, String key, String value)
public static boolean isFullUrl(String link)
link
-
public static String fullUrl(String pageUrl, String link)
public static String getXmlNSPrefix(String name)
name
-
public static String getXmlName(String name)
name
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |