public static String quote(String str, char quote) { return UnicodeUtilities.quote(str, quote); }
/** * Returns a string representation of an object that can be used in the 'image' constructor argument of {@link * GroupingNode}. This method ensures that strings are quoted, and that all complex characters are escaped. * * @param obj The object to output. * @return The string representation. */ public static String asImage(Object obj) { if (!(obj instanceof String)) { return obj.toString(); } return UnicodeUtilities.quote((String)obj, '"'); }