Class SourceCodeEscapers
java.lang.Object
com.google.errorprone.util.SourceCodeEscapers
A factory for Escaper instances used to escape strings for safe use in Java.
This is a subset of source code escapers that are in the process of being open-sources as part of guava, see: https://github.com/google/guava/issues/1620
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.common.escape.CharEscaper
Returns anEscaper
instance that escapes special characters in a string so it can safely be included in either a Java character literal or string literal.
-
Method Details
-
javaCharEscaper
public static com.google.common.escape.CharEscaper javaCharEscaper()Returns anEscaper
instance that escapes special characters in a string so it can safely be included in either a Java character literal or string literal. This is the preferred way to escape Java characters for use in String or character literals.See: The Java Language Specification for more details.
-