List of utility methods to do HTML Escape
String | escapeHTML(String aText) escape HTML if (aText == null) { return null; final StringBuilder result = new StringBuilder(); final StringCharacterIterator iterator = new StringCharacterIterator(aText); char character = iterator.current(); while (character != CharacterIterator.DONE) { if (character == '<') { ... |
String | escapeHtml(String s) escape Html if (s == null) { return null; StringBuilder result = new StringBuilder(); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); String nc = ESCAPES.get(c); if (nc != null) { ... |
String | escapeHTML(String s) escape HTML for (Character c : HTML_ENTITIES.keySet()) { if (s.indexOf(c) >= 0) { s = s.replace(c.toString(), HTML_ENTITIES.get(c)); return s; |
String | escapeHTML(String s) escape HTML if (s == null) return ""; StringBuffer sb = new StringBuffer(s.length() + 100); Map<Character, String> unent = getHtmlUnEntities(); for (int ii = 0, ll = s.length(); ii < ll; ii++) { char ch = s.charAt(ii); String ent = unent.get(ch); if (ent != null) { ... |
String | escapeHtml(String s) escape Html final StringBuilder out = new StringBuilder(Math.max(16, s.length())); for (int i = 0; i < s.length(); i++) { final char c = s.charAt(i); if (c > 127 || c == '"' || c == '<' || c == '>' || c == '&') { out.append("&#"); out.append((int) c); out.append(';'); } else { ... |
String | escapeHTML(String text) escape HTML StringBuilder escaped = new StringBuilder(); int n = text.length(); for (int i = 0; i < n; i++) { char c = text.charAt(i); escaped.append(HTML2ESCAPE_MAP.containsKey(c) ? HTML2ESCAPE_MAP.get(c) : c); return escaped.toString(); |
String | escapeHTML(String text) escape HTML StringBuilder escaped = new StringBuilder(); StringCharacterIterator iterator = new StringCharacterIterator(text); char character = iterator.current(); while (character != CharacterIterator.DONE) { if (character == '<') { escaped.append("<"); } else if (character == '>') { escaped.append(">"); ... |
String | escapeHTMLLine(String line) escape HTML Line if (escapeList == null) { init(); String key; for (Iterator var2 = escapeList.keySet().iterator(); var2 .hasNext(); line = line.replace(key, (String) escapeList.get(key))) { key = (String) var2.next(); return line; |
String | escapeHTMLSpecialChars(String aText) Escape characters for text appearing in HTML markup. StringBuilder result = new StringBuilder(); StringCharacterIterator iterator = new StringCharacterIterator(aText); char character = iterator.current(); while (character != CharacterIterator.DONE) { if (character == '<') { result.append("<"); } else if (character == '>') { result.append(">"); ... |
String | escapeHTMLTagCopy(String text) Replace characters having special meaning inside HTML tags with their escaped equivalents, using character entities such as '&'. final StringBuffer result = new StringBuffer(); final StringCharacterIterator iterator = new StringCharacterIterator(text); char character = iterator.current(); while (character != CharacterIterator.DONE) { if (character == '<') { result.append("<"); } else if (character == '>') { result.append(">"); ... |