Class StringPrepProfile


  • public final class StringPrepProfile
    extends Object
    This class defines the "stringprep" profile as defined in RFC 4518. It must be used by all the matching rules that support unicode characters. For a complete list of such rules, refer to Section 4.2, RFC 4517.
    • Field Detail

      • CASE_FOLD

        public static final boolean CASE_FOLD
        Indicates whether case should be folded during string preparation.
        See Also:
        Constant Field Values
      • NO_CASE_FOLD

        public static final boolean NO_CASE_FOLD
        Indicates whether case should not be folded during string preparation.
        See Also:
        Constant Field Values
      • TRIM

        public static final boolean TRIM
        Indicates whether leading and trailing spaces should be trimmed during string preparation.
        See Also:
        Constant Field Values
    • Method Detail

      • prepareUnicode

        public static void prepareUnicode​(StringBuilder buffer,
                                          ByteSequence sequence,
                                          boolean trim,
                                          boolean foldCase)
        Prepares an attribute or assertion value as per stringprep algorithm defined in RFC 4518.
        Parameters:
        buffer - The buffer to which the prepared form of the string should be appended.
        sequence - The ByteSequence that needs preparation.
        trim - Indicates whether leading and trailing spaces should be omitted from the string representation.
        foldCase - Indicates whether the case will be folded during mapping.
        See Also:
        Internationalized String Preparation