Package com.google.common.escape
Class Escapers
java.lang.Object
com.google.common.escape.Escapers
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 ClassesModifier and TypeClassDescriptionstatic final classDeprecated.The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023 -
Method Summary
Modifier and TypeMethodDescriptionstatic Escapers.Builderbuilder()Deprecated.Returns a builder for creating simple, fast escapers.static StringcomputeReplacement(CharEscaper escaper, char c) Deprecated.Returns a string that would replace the given character in the specified escaper, ornullif no replacement should be made.static StringcomputeReplacement(UnicodeEscaper escaper, int cp) Deprecated.Returns a string that would replace the given character in the specified escaper, ornullif no replacement should be made.static EscaperDeprecated.Returns anEscaperthat does no escaping, passing all character data through unchanged.
-
Method Details
-
nullEscaper
Deprecated.Returns anEscaperthat does no escaping, passing all character data through unchanged. -
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_VALUEsafeMax == Character.MAX_VALUEunsafeReplacement == null
For performance reasons escapers created by this builder are not Unicode aware and will not validate the well-formedness of their input.
-
computeReplacement
Deprecated.Returns a string that would replace the given character in the specified escaper, ornullif no replacement should be made. This method is intended for use in tests through theEscaperAssertsclass; production users ofCharEscapershould limit themselves to its public interface.- Parameters:
c- the character to escape if necessary- Returns:
- the replacement string, or
nullif no escaping was needed
-
computeReplacement
Deprecated.Returns a string that would replace the given character in the specified escaper, ornullif no replacement should be made. This method is intended for use in tests through theEscaperAssertsclass; production users ofUnicodeEscapershould limit themselves to its public interface.- Parameters:
cp- the Unicode code point to escape if necessary- Returns:
- the replacement string, or
nullif no escaping was needed
-