public class HTMLUtils extends Object
Modifier and Type | Field and Description |
---|---|
protected static Pattern |
RE_CLIENT_ID_ESCAPES |
static Pattern |
RE_HTML_NAME
(html 4.01 6.2) ID and NAME tokens must begin with a letter ([A-Za-z])
and may be followed by any number of letters, digits ([0-9]),
hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
|
Constructor and Description |
---|
HTMLUtils() |
Modifier and Type | Method and Description |
---|---|
static ResponseWriter |
createHTMLResponseWriter(FacesContext context,
Writer out) |
static String |
decodeClientId(String id)
Decodes id encoded with
encodeClientId(java.lang.String) . |
static String |
encodeClientId(String id)
Encodes id to be legal SGML id string.
|
static boolean |
isValidName(String name)
Returns true if the specified element/attribute name is a legal html element/attribute name.
|
static String |
quote(String s)
Escapes HTML.
|
static String |
quote(String s,
boolean elementContent)
Escapes HTML.
|
public static final Pattern RE_HTML_NAME
protected static final Pattern RE_CLIENT_ID_ESCAPES
public static String quote(String s, boolean elementContent)
elementContent
- True if escaping element content
(in which case ' [single-quote] and " [double-quote] don't need to be escaped).public static boolean isValidName(String name)
public static String encodeClientId(String id)
public static String decodeClientId(String id)
encodeClientId(java.lang.String)
.public static ResponseWriter createHTMLResponseWriter(FacesContext context, Writer out)