return HtmlEscapeUtil.escape(text, type, level);
/** * <p> * Perform an HTML <strong>unescape</strong> operation on a <kbd>String</kbd> input. * </p> * <p> * No additional configuration arguments are required. Unescape operations * will always perform <em>complete</em> unescape of NCRs (whole HTML5 set supported), decimal * and hexadecimal references. * </p> * <p> * This method is <strong>thread-safe</strong>. * </p> * * @param text the <kbd>String</kbd> to be unescaped. * @return The unescaped result <kbd>String</kbd>. As a memory-performance improvement, will return the exact * same object as the <kbd>text</kbd> input argument if no unescaping modifications were required (and * no additional <kbd>String</kbd> objects will be created during processing). Will * return <kbd>null</kbd> if <kbd>text</kbd> is <kbd>null</kbd>. */ public static String unescapeHtml(final String text) { return HtmlEscapeUtil.unescape(text); }
codepoint = parseIntFromReference(text, i + 3, f, 16); referenceOffset = f - 1; codepoint = translateIllFormedCodepoint(codepoint); codepoint = parseIntFromReference(text, i + 2, f, 10); referenceOffset = f - 1; codepoint = translateIllFormedCodepoint(codepoint);
final int codepoint = codePointAt((char)c1, (char)c2);
codepoint = parseIntFromReference(text, i + 3, f, 16); referenceOffset = f - 1; codepoint = translateIllFormedCodepoint(codepoint); codepoint = parseIntFromReference(text, i + 2, f, 10); referenceOffset = f - 1; codepoint = translateIllFormedCodepoint(codepoint);
codepoint = parseIntFromReference(text, i + 3, f, 16); referenceOffset = f - 1; codepoint = translateIllFormedCodepoint(codepoint); codepoint = parseIntFromReference(text, i + 2, f, 10); referenceOffset = f - 1; codepoint = translateIllFormedCodepoint(codepoint);
/** * <p> * Perform an HTML <strong>unescape</strong> operation on a <tt>String</tt> input. * </p> * <p> * No additional configuration arguments are required. Unescape operations * will always perform <em>complete</em> unescape of NCRs (whole HTML5 set supported), decimal * and hexadecimal references. * </p> * <p> * This method is <strong>thread-safe</strong>. * </p> * * @param text the <tt>String</tt> to be unescaped. * @return The unescaped result <tt>String</tt>. As a memory-performance improvement, will return the exact * same object as the <tt>text</tt> input argument if no unescaping modifications were required (and * no additional <tt>String</tt> objects will be created during processing). Will * return <tt>null</tt> if input is <tt>null</tt>. */ public static String unescapeHtml(final String text) { if (text == null) { return null; } if (text.indexOf('&') < 0) { // Fail fast, avoid more complex (and less JIT-table) method to execute if not needed return text; } return HtmlEscapeUtil.unescape(text); }
return HtmlEscapeUtil.escape(text, type, level);
codepoint = parseIntFromReference(text, i + 3, f, 16); referenceOffset = f - 1; codepoint = translateIllFormedCodepoint(codepoint); codepoint = parseIntFromReference(text, i + 2, f, 10); referenceOffset = f - 1; codepoint = translateIllFormedCodepoint(codepoint);
/** * <p> * Perform an HTML <strong>unescape</strong> operation on a <tt>Reader</tt> input, writing results to * a <tt>Writer</tt>. * </p> * <p> * No additional configuration arguments are required. Unescape operations * will always perform <em>complete</em> unescape of NCRs (whole HTML5 set supported), decimal * and hexadecimal references. * </p> * <p> * This method is <strong>thread-safe</strong>. * </p> * * @param reader the <tt>Reader</tt> reading the text to be unescaped. * @param writer the <tt>java.io.Writer</tt> to which the unescaped result will be written. Nothing will * be written at all to this writer if input is <tt>null</tt>. * @throws IOException if an input/output exception occurs * * @since 1.1.2 */ public static void unescapeHtml(final Reader reader, final Writer writer) throws IOException { if (writer == null) { throw new IllegalArgumentException("Argument 'writer' cannot be null"); } HtmlEscapeUtil.unescape(reader, writer); }
HtmlEscapeUtil.escape(reader, writer, type, level);
c2 = ce; codepoint = parseIntFromReference(escapes, 0, escapei, 16); codepoint = translateIllFormedCodepoint(codepoint); c2 = ce; codepoint = parseIntFromReference(escapes, 0, escapei, 10); codepoint = translateIllFormedCodepoint(codepoint);
HtmlEscapeUtil.unescape(text, offset, len, writer);
HtmlEscapeUtil.escape(text, offset, len, writer, type, level);
HtmlEscapeUtil.unescape(text, offset, len, writer);
HtmlEscapeUtil.escape(text, offset, len, writer, type, level);
HtmlEscapeUtil.unescape(new InternalStringReader(text), writer);
HtmlEscapeUtil.escape(new InternalStringReader(text), writer, type, level);