public final class HtmlEscaper extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
escapeAll(String s,
boolean preserveExistingEntities)
Replaces the HTML "special characters" <, >, ", ', and & with their equivalent entities in HTML 4
and returns the result.
|
static String |
escapeAllExceptQuotes(String s,
boolean preserveExistingEntities)
Does the same as
escapeAll(String,boolean), except doesn't replace the quotation mark characters "
and '. |
static String |
escapeAmpersands(String s,
boolean preserveExistingEntities)
Replaces the HTML "special character" & with its equivalent entity in HTML 4 and returns the result.
|
public static String escapeAll(String s, boolean preserveExistingEntities)
s - the String to escapepreserveExistingEntities - if true, will avoid escaping the ampersand in an existing entity like
<. If false, the method will do a normal escaping by replace all matched characters.public static String escapeAllExceptQuotes(String s, boolean preserveExistingEntities)
escapeAll(String,boolean), except doesn't replace the quotation mark characters "
and '.s - the String to escapepreserveExistingEntities - if true, will avoid escaping the ampersand in an existing entity like
<. If false, the method will do a normal escaping by replace all matched characters.public static String escapeAmpersands(String s, boolean preserveExistingEntities)
s - the String to escapepreserveExistingEntities - if true, will avoid escaping the ampersand in an existing entity like
<. If false, the method will do a normal escaping by replace all matched characters.Copyright © 2015 Atlassian. All rights reserved.