Class TextEscape


  • public class TextEscape
    extends Object
    Methods for escaping text.
    • Method Detail

      • toHTML

        public static String toHTML​(String value)
        Escape value for use in HTML.
        Parameters:
        value - the value to escape.
        Returns:
        the escaped value.
      • toXML

        public static String toXML​(String value)
        Escape value for use in XML 1.0.
        Parameters:
        value - the value to escape.
        Returns:
        the escaped value.
      • toCSV

        public static String toCSV​(String value)
        Escape value for use in CSV.
        Parameters:
        value - the value to escape.
        Returns:
        the escaped value.
      • toURLParameter

        public static String toURLParameter​(String value)
        Escape value for use in a URL parameter.
        Parameters:
        value - the value to escape.
        Returns:
        the escaped value.
      • toSearchCase

        public static String toSearchCase​(String name)
        Generate the normalized name of an object. The intention is that a normalized name is suitable for case-insensitive searches and the like.

        At present this routine simply converts the name to an uppercase, taking into account the form. In the future it may remove accent and other character-modifiers. It converts to uppercase form taking into account most case-conversion issues. In particular, it deals with the i/ı/I/İ issue with the Turkish capitalization, as they are all converted to I.

        Note: the output string may be longer than the input string.

        Parameters:
        name - The name to normalize.
        Returns:
        Normalized name.