/** * Returns the escaped form of a given literal string. * * @param string the literal string to be escaped * @return the escaped form of {@code string} * @throws NullPointerException if {@code string} is null */ public String escape(String string) { // Inlineable fast-path loop which hands off to escapeSlow() only if needed int length = string.length(); for (int index = 0; index < length; index++) { if (escape(string.charAt(index)) != null) { return escapeSlow(string, index); } } return string; }
char[] r = escape(s.charAt(index)); if (destSize < sizeNeeded) { destSize = sizeNeeded + (slen - index) + DEST_PAD; dest = growBuffer(dest, destIndex, destSize); dest = growBuffer(dest, destIndex, sizeNeeded);
char[] r = escape(s.charAt(index)); if (destSize < sizeNeeded) { destSize = sizeNeeded + (slen - index) + DEST_PAD; dest = growBuffer(dest, destIndex, destSize); dest = growBuffer(dest, destIndex, sizeNeeded);
/** * Returns the escaped form of a given literal string. * * @param string the literal string to be escaped * @return the escaped form of {@code string} * @throws NullPointerException if {@code string} is null */ public String escape(String string) { // Inlineable fast-path loop which hands off to escapeSlow() only if needed int length = string.length(); for (int index = 0; index < length; index++) { if (escape(string.charAt(index)) != null) { return escapeSlow(string, index); } } return string; }
char[] r = escape(s.charAt(index)); if (destSize < sizeNeeded) { destSize = sizeNeeded + (slen - index) + DEST_PAD; dest = growBuffer(dest, destIndex, destSize); dest = growBuffer(dest, destIndex, sizeNeeded);
/** * Returns the escaped form of a given literal string. * * @param string the literal string to be escaped * @return the escaped form of {@code string} * @throws NullPointerException if {@code string} is null */ public String escape(String string) { // Inlineable fast-path loop which hands off to escapeSlow() only if needed int length = string.length(); for (int index = 0; index < length; index++) { if (escape(string.charAt(index)) != null) { return escapeSlow(string, index); } } return string; }
public Appendable append(char c) throws IOException { char[] escaped = escape(c); if (escaped == null) { out.append(c); } else { outputChars(escaped); } return this; }
private String escape(String src) { return CharEscapers.xmlEscaper().escape(src); }
public Appendable append(char c) throws IOException { char[] escaped = escape(c); if (escaped == null) { out.append(c); } else { outputChars(escaped); } return this; }
public Appendable append(char c) throws IOException { char[] escaped = escape(c); if (escaped == null) { out.append(c); } else { outputChars(escaped); } return this; }
private String escape(String src) { return CharEscapers.xmlEscaper().escape(src); }
private String escape(String src) { return CharEscapers.xmlEscaper().escape(src); }
public Appendable append(CharSequence csq, int start, int end) throws IOException { // "no escape" path (pushing the "escape" path into a separate method) // to make this more "inlineable". int unescapedChunkStart = start; for (int i = start; i < end; i++) { char[] escaped = escape(csq.charAt(i)); if (escaped != null) { if (unescapedChunkStart < i) { out.append(csq, unescapedChunkStart, i); } outputChars(escaped); unescapedChunkStart = i + 1; } } if (unescapedChunkStart < end) { out.append(csq, unescapedChunkStart, end); } return this; }
public Appendable append(CharSequence csq, int start, int end) throws IOException { // "no escape" path (pushing the "escape" path into a separate method) // to make this more "inlineable". int unescapedChunkStart = start; for (int i = start; i < end; i++) { char[] escaped = escape(csq.charAt(i)); if (escaped != null) { if (unescapedChunkStart < i) { out.append(csq, unescapedChunkStart, i); } outputChars(escaped); unescapedChunkStart = i + 1; } } if (unescapedChunkStart < end) { out.append(csq, unescapedChunkStart, end); } return this; }
public Appendable append(CharSequence csq, int start, int end) throws IOException { // "no escape" path (pushing the "escape" path into a separate method) // to make this more "inlineable". int unescapedChunkStart = start; for (int i = start; i < end; i++) { char[] escaped = escape(csq.charAt(i)); if (escaped != null) { if (unescapedChunkStart < i) { out.append(csq, unescapedChunkStart, i); } outputChars(escaped); unescapedChunkStart = i + 1; } } if (unescapedChunkStart < end) { out.append(csq, unescapedChunkStart, end); } return this; }