|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.htmlcleaner.Utils
public class Utils
Common utilities.
Created by: Vladimir Nikic
Field Summary | |
---|---|
static Pattern |
DECIMAL
|
static Pattern |
HEX_RELAXED
|
static Pattern |
HEX_STRICT
|
Constructor Summary | |
---|---|
Utils()
|
Method Summary | |
---|---|
static String |
escapeHtml(String s,
CleanerProperties props)
Escapes HTML string |
static String |
escapeXml(String s,
boolean advanced,
boolean recognizeUnicodeChars,
boolean translateSpecialEntities,
boolean isDomCreation,
boolean transResCharsToNCR,
boolean translateSpecialEntitiesToNCR)
change notes: 1) convert ascii characters encoded using x; format to the ascii characters -- may be an attempt to slip in malicious html 2) convert xx; format characters to " style representation if available for the character. |
static String |
escapeXml(String s,
boolean advanced,
boolean recognizeUnicodeChars,
boolean translateSpecialEntities,
boolean isDomCreation,
boolean transResCharsToNCR,
boolean translateSpecialEntitiesToNCR,
boolean isHtmlOutput)
change notes: 1) convert ascii characters encoded using x; format to the ascii characters -- may be an attempt to slip in malicious html 2) convert xx; format characters to " style representation if available for the character. |
static String |
escapeXml(String s,
CleanerProperties props,
boolean isDomCreation)
Escapes XML string. |
static String |
getXmlName(String name)
|
static String |
getXmlNSPrefix(String name)
|
static boolean |
isEmptyString(Object o)
|
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 |
isValidXmlIdentifier(String s)
Checks 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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static Pattern HEX_STRICT
public static Pattern HEX_RELAXED
public static Pattern DECIMAL
Constructor Detail |
---|
public Utils()
Method Detail |
---|
public static String escapeHtml(String s, CleanerProperties props)
s
- String to be escapedprops
- Cleaner properties affects escaping behaviour
public static String escapeXml(String s, CleanerProperties props, boolean isDomCreation)
s
- String to be escapedprops
- Cleaner properties affects escaping behaviourisDomCreation
- Tells if escaped content will be part of the DOMpublic static String escapeXml(String s, boolean advanced, boolean recognizeUnicodeChars, boolean translateSpecialEntities, boolean isDomCreation, boolean transResCharsToNCR, boolean translateSpecialEntitiesToNCR)
s
- advanced
- recognizeUnicodeChars
- translateSpecialEntities
- isDomCreation
-
public static String escapeXml(String s, boolean advanced, boolean recognizeUnicodeChars, boolean translateSpecialEntities, boolean isDomCreation, boolean transResCharsToNCR, boolean translateSpecialEntitiesToNCR, boolean isHtmlOutput)
s
- advanced
- recognizeUnicodeChars
- translateSpecialEntities
- isDomCreation
- isHtmlOutput
-
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[] tokenize(String s, String delimiters)
public static String getXmlNSPrefix(String name)
name
-
public static String getXmlName(String name)
name
-
public static String ltrim(String s)
s
- public static String rtrim(String s)
s
- public static boolean isWhitespaceString(Object object)
object
- Object whose string representation is checked
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |