/** * Replace special characters with entities for XML attributes. * special: '&', '<', '>', '\'', '"', '\r', '\n' * * @param x string to quote * @return equivilent string using entities for any special chars */ static public String quoteXmlAttribute(String x) { return replace(x, xmlIn, xmlOut); }
/** * Reverse XML quoting to recover the original string. * * @param x string to quote * @return equivilent string */ static public String unquoteXmlContent(String x) { return unreplace(x, xmlOutC, xmlInC); }
/** * Pad the given string with spaces on the right up to the given length. * * @param s String to pad * @param desiredLength ending length * @return padded String */ public static String padRight(String s, int desiredLength) { return padRight(s, desiredLength, " "); }
/** * Pad the given string with spaces on the left up to the given length. * * @param s String to pad * @param desiredLength ending length * @return padded String */ public static String padLeft(String s, int desiredLength) { return padLeft(s, desiredLength, " "); }
public void doAll( String s) { doURIencoded(s); doURI(s); doURL(s); }
/** * Replace special characters with entities for XML attributes. * special: '&', '<', '>', '\'', '"', '\r', '\n' * * @param x string to quote * @return equivilent string using entities for any special chars */ static public String quoteXmlContent(String x) { return replace(x, xmlInC, xmlOutC); }
/** * Pad the given string with spaces on the right up to the given length. * * @param s String to pad * @param desiredLength ending length * @return padded String */ public static String padRight(String s, int desiredLength) { return padRight(s, desiredLength, " "); }
/** * Get the post interval range to use. If we have a postRange then return that, else, * return half of the interval. * * @return The post range to use */ public double getPostRangeToUse() { return (hasPostRange() ? postRange : interval / 2); }
/** * Replace special characters with entities for XML attributes. * special: '&', '<', '>', '\'', '"', '\r', '\n' * * @param x string to quote * @return equivilent string using entities for any special chars */ static public String quoteXmlContent(String x) { return replace(x, xmlInC, xmlOutC); }
/** * Reverse XML quoting to recover the original string. * * @param x string to quote * @return equivilent string */ static public String unquoteXmlAttribute(String x) { return unreplace(x, xmlOut, xmlIn); }
/** * Replace special characters '\t', '\n', '\f', '\r'. * @param s string to quote * @return equivilent string replacing special chars */ static public String encodeString(String s) { return StringUtil2.replace(s, org, replace); }
/** * Reverse XML quoting to recover the original string. * * @param x string to quote * @return equivilent string */ static public String unquoteXmlContent(String x) { return StringUtil2.unreplace(x, xmlOutC, xmlInC); }
/** * Replace special characters with entities for XML attributes. * special: '&', '<', '>', '\'', '"', '\r', '\n' * * @param x string to quote * @return equivilent string using entities for any special chars */ static public String quoteXmlContent(String x) { return StringUtil2.replace(x, xmlInC, xmlOutC); }
/** * Replace special characters with entities for HTML content. * special: '&', '"', '\'', '<', '>', '\n' * * @param x string to quote * @return equivilent string using entities for any special chars */ static public String quoteHtmlContent(String x) { return replace(x, htmlIn, htmlOut); }
/** * Replace special characters with entities for HTML content. * special: '&', '"', '\'', '<', '>', '\n' * * @param x string to quote * @return equivilent string using entities for any special chars */ static public String quoteHtmlContent(String x) { return replace(x, htmlIn, htmlOut); }
/** * Replace special characters with entities for XML attributes. * special: '&', '<', '>', '\'', '"', '\r', '\n' * * @param x string to quote * @return equivilent string using entities for any special chars */ static public String quoteXmlAttribute(String x) { return replace(x, xmlIn, xmlOut); }
/** * Replace special characters with entities for XML attributes. * special: '&', '<', '>', '\'', '"', '\r', '\n' * * @param x string to quote * @return equivilent string using entities for any special chars */ static public String quoteXmlContent(String x) { return StringUtil2.replace(x, xmlInC, xmlOutC); }
/** * @deprecated legacy only, use HtmlEscapers.htmlEscaper() */ static public String quoteHtmlContent(String x) { if (x == null) return null; return replace(x, htmlIn, htmlOut); } }