Class JavaStringEscapes
java.lang.Object
org.openrewrite.java.logging.internal.JavaStringEscapes
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringescapeJavaStringContent(String value) Escapes a decodedStringvalue so it can be placed verbatim between the double quotes of a Java string literal.
-
Method Details
-
escapeJavaStringContent
Escapes a decodedStringvalue so it can be placed verbatim between the double quotes of a Java string literal. Printable characters, including non-ASCII text such ascaféor emoji, are left untouched; only the characters that would otherwise produce invalid or unreadable source are escaped.- Parameters:
value- the decoded string value (escape sequences already resolved to their characters)- Returns:
- the escaped literal content, without surrounding quotes
-