Class CodeEscape
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidescapeJava(char[] text, int offset, int len, Writer writer) static voidescapeJava(char[] text, int offset, int len, Writer writer, CodeEscapeLevel level) static voidescapeJava(Reader reader, Writer writer) static voidescapeJava(Reader reader, Writer writer, CodeEscapeLevel level) static StringescapeJava(String text) static StringescapeJava(String text, CodeEscapeLevel level) static voidescapeJava(String text, Writer writer) static voidescapeJava(String text, Writer writer, CodeEscapeLevel level) static voidescapeJavaMinimal(char[] text, int offset, int len, Writer writer) static voidescapeJavaMinimal(Reader reader, Writer writer) static StringescapeJavaMinimal(String text) static voidescapeJavaMinimal(String text, Writer writer) static Stringstatic voidunescapeJava(char[] text, int offset, int len, Writer writer) Perform a Java unescape operation on a char[] input.static voidunescapeJava(Reader reader, Writer writer) Perform a Java unescape operation on a Reader input, writing results to a Writer.static StringunescapeJava(String text) Perform a Java unescape operation on a String input.static voidunescapeJava(String text, Writer writer) Perform a Java unescape operation on a String input, writing results to a Writer.
-
Constructor Details
-
CodeEscape
private CodeEscape()
-
-
Method Details
-
escapeToSingleLineForCsv
-
escapeJavaMinimal
-
escapeJava
-
escapeJava
-
escapeJavaMinimal
- Throws:
IOException
-
escapeJava
- Throws:
IOException
-
escapeJava
- Throws:
IOException
-
escapeJavaMinimal
- Throws:
IOException
-
escapeJava
- Throws:
IOException
-
escapeJava
public static void escapeJava(Reader reader, Writer writer, CodeEscapeLevel level) throws IOException - Throws:
IOException
-
escapeJavaMinimal
public static void escapeJavaMinimal(char[] text, int offset, int len, Writer writer) throws IOException - Throws:
IOException
-
escapeJava
- Throws:
IOException
-
escapeJava
public static void escapeJava(char[] text, int offset, int len, Writer writer, CodeEscapeLevel level) throws IOException - Throws:
IOException
-
unescapeJava
Perform a Java unescape operation on a String input.
No additional configuration arguments are required. Unescape operations will always perform complete Java unescape of SECs, u-based and octal escapes.
This method is thread-safe.
- Parameters:
text- the String to be unescaped.- Returns:
- The unescaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no unescaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.
-
unescapeJava
Perform a Java unescape operation on a String input, writing results to a Writer.
No additional configuration arguments are required. Unescape operations will always perform complete Java unescape of SECs, u-based and octal escapes.
This method is thread-safe.
- Parameters:
text- the String to be unescaped.writer- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException- if an input/output exception occurs- Since:
- 1.1.2
-
unescapeJava
Perform a Java unescape operation on a Reader input, writing results to a Writer.
No additional configuration arguments are required. Unescape operations will always perform complete Java unescape of SECs, u-based and octal escapes.
This method is thread-safe.
- Parameters:
reader- the Reader reading the text to be unescaped.writer- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException- if an input/output exception occurs- Since:
- 1.1.2
-
unescapeJava
Perform a Java unescape operation on a char[] input.
No additional configuration arguments are required. Unescape operations will always perform complete Java unescape of SECs, u-based and octal escapes.
This method is thread-safe.
- Parameters:
text- the char[] to be unescaped.offset- the position in text at which the unescape operation should start.len- the number of characters in text that should be unescaped.writer- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException- if an input/output exception occurs
-