Package org.primefaces.util
Class EscapeUtils
java.lang.Object
org.primefaces.util.EscapeUtils
Utility methods contained herein must be used strictly for the appropriate context, e.g., HTML, HTML attribute, JS string.
Method calls are delegated to safe and well-tried allowlist encoders from owasp-java-encoding.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
static String
forCssString
(String input) static String
static String
static String
forHtmlAttribute
(String input) static String
forHtmlContent
(String input) static String
forHtmlUnquotedAttribute
(String input) static String
static String
forJavaScript
(String input) static String
forJavaScriptAttribute
(String input) static String
forJavaScriptBlock
(String input) static String
forJavaScriptSource
(String input) static String
forJavaScriptVarName
(String input) static String
forUriComponent
(String input) static String
static String
forXmlAttribute
(String input) static String
forXmlComment
(String input) static String
forXmlContent
(String input) static String
Ensure a valid XMLElement name is returned.
Uses theXMLChar
Replaces spaces by underscores, < by .lt, > by .gt.
-
Method Details
-
forHtml
- See Also:
-
forHtmlContent
- See Also:
-
forHtmlAttribute
- See Also:
-
forHtmlUnquotedAttribute
- See Also:
-
forCssString
- See Also:
-
forCssUrl
- See Also:
-
forUriComponent
- See Also:
-
forXml
- See Also:
-
forXmlContent
- See Also:
-
forXmlAttribute
- See Also:
-
forXmlComment
- See Also:
-
forCDATA
- See Also:
-
forJava
- See Also:
-
forJavaScript
- See Also:
-
forJavaScriptAttribute
- See Also:
-
forJavaScriptBlock
- See Also:
-
forJavaScriptSource
- See Also:
-
forJavaScriptVarName
-
forXmlTag
Ensure a valid XMLElement name is returned.
Uses theXMLChar
Replaces spaces by underscores, < by .lt, > by .gt. and all other characters by '.X.', where is the output ofInteger
.toHexString()- Parameters:
intag
- the source for the element name- Returns:
- valid XML element name
-