/** * Decode a string containing references. * Change all numeric character reference and character entity references * to unicode characters. * @param string The string to translate. */ public static String decode (String string) { return decode(string, null); }
/** * Decodes entities in a string if it isn't null.<p> * * @param value the string for which to decode entities * * @return the string with the decoded entities */ protected static String decodeEntities(String value) { if (value != null) { value = Translate.decode(value); } return value; }
/** * Decode the characters in a string buffer containing references. * Change all numeric character reference and character entity references * to unicode characters. * @param buffer The StringBuffer containing references. * @return The decoded string. */ public static String decode (StringBuffer buffer) { return decode (buffer.toString()); }
/** * Decode the characters in a string buffer containing references. * Change all numeric character reference and character entity references * to unicode characters. * @param buffer The StringBuilder containing references. * @return The decoded string. */ public static String decode (StringBuilder buffer) { return decode (buffer.toString()); }
/** * Convert a reference to a unicode character. * Convert a single numeric character reference or character entity reference * to a unicode character. * @param string The string to convert. Of the form &xxxx; or &#xxxx; with * or without the leading ampersand or trailing semi-colon. * @return The converted character or '