Interface URLEncoder

  • All Known Implementing Classes:
    URLEncoderImpl

    public interface URLEncoder
    Service used to encode or decode strings that are placed into URLs. This is used as an alternative to UUEncoding. Alphabetics, numbers and some punctuation ("-", "_", ".", ":") are passed through as is, the "$" character is an escape, followed by either another "$", or by a four digit hex unicode number. A null input (not a blank input, but actual null) has a special encoding, "$N". Likewise, the blank string has the special encoding "$B".
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      String decode(String input)
      Given a previously encoded string, returns the original input.
      String encode(String input)
      Given an input value containing any characters, returns the input string, or an encoded version of the string (as outlined above).
    • Method Detail

      • encode

        String encode(String input)
        Given an input value containing any characters, returns the input string, or an encoded version of the string (as outlined above).
        Parameters:
        input - string to be encoded, which may be null
        Returns:
        encoded version of input
      • decode

        String decode(String input)
        Given a previously encoded string, returns the original input.
        Parameters:
        input - encoded string (may not be null)
        Returns:
        decoded input