public class StringEscaper extends Object
| Constructor and Description |
|---|
StringEscaper() |
| Modifier and Type | Method and Description |
|---|---|
static String |
escapeWord(String word)
Escapes the given word in a way that
parseLine(String) can
correctly unescape it. |
static String |
escapeWords(Collection<String> words)
Escapes all words in the given collection and joins them separated by a
space.
|
static List<String> |
parseLine(String line)
Splits a string into words.
|
static String |
persistString(String original)
Converts the string into a form that is suitable for storage in
text-based medium.
|
static String |
unpersistString(String persistedString)
Recovers the original string from a string that has been created with
persistString(String). |
public static String persistString(String original)
original - The original stringpublic static String unpersistString(String persistedString) throws TextException
persistString(String).persistedString - The persisted stringTextException - if the persisted string can not be parsedpublic static List<String> parseLine(String line) throws TextException
line - The line to parseTextException - if quotes are not closedpublic static String escapeWord(String word)
parseLine(String) can
correctly unescape it. The following rules are applied to the word:
word - The word to escapepublic static String escapeWords(Collection<String> words)
words - The words to escapeCopyright © 2026. All rights reserved.