Class Escapers

java.lang.Object
com.google.common.escape.Escapers

@Beta @GwtCompatible @Deprecated(since="2022-12-01") public final class Escapers extends Object
Deprecated.
The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023
Static utility methods pertaining to Escaper instances.
Since:
15.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Deprecated.
    The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated.
    Returns a builder for creating simple, fast escapers.
    static String
    computeReplacement(CharEscaper escaper, char c)
    Deprecated.
    Returns a string that would replace the given character in the specified escaper, or null if no replacement should be made.
    static String
    Deprecated.
    Returns a string that would replace the given character in the specified escaper, or null if no replacement should be made.
    static Escaper
    Deprecated.
    Returns an Escaper that does no escaping, passing all character data through unchanged.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • nullEscaper

      public static Escaper nullEscaper()
      Deprecated.
      Returns an Escaper that does no escaping, passing all character data through unchanged.
    • builder

      public static Escapers.Builder builder()
      Deprecated.
      Returns a builder for creating simple, fast escapers. A builder instance can be reused and each escaper that is created will be a snapshot of the current builder state. Builders are not thread safe.

      The initial state of the builder is such that:

      • There are no replacement mappings
      • safeMin == Character.MIN_VALUE
      • safeMax == Character.MAX_VALUE
      • unsafeReplacement == null

      For performance reasons escapers created by this builder are not Unicode aware and will not validate the well-formedness of their input.

    • computeReplacement

      public static String computeReplacement(CharEscaper escaper, char c)
      Deprecated.
      Returns a string that would replace the given character in the specified escaper, or null if no replacement should be made. This method is intended for use in tests through the EscaperAsserts class; production users of CharEscaper should limit themselves to its public interface.
      Parameters:
      c - the character to escape if necessary
      Returns:
      the replacement string, or null if no escaping was needed
    • computeReplacement

      public static String computeReplacement(UnicodeEscaper escaper, int cp)
      Deprecated.
      Returns a string that would replace the given character in the specified escaper, or null if no replacement should be made. This method is intended for use in tests through the EscaperAsserts class; production users of UnicodeEscaper should limit themselves to its public interface.
      Parameters:
      cp - the Unicode code point to escape if necessary
      Returns:
      the replacement string, or null if no escaping was needed