QuotedStringTokenizer with partial handling of
RFC9110 quoted-strings.
The deviation from the RFC is that characters are not enforced to be
qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text and it is expected
that the caller will enforce any character restrictions.
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final boolean | |
| private final boolean | |
| private final boolean | |
| private final boolean | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv | RFC9110QuotedStringTokenizer(String delim, boolean optionalWhiteSpace, boolean returnDelimiters, boolean returnQuotes, boolean embeddedQuotes, boolean escapeOnlyQuote)
|
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | |
| public boolean | needsQuoting(char
A character c)Implements org. |
| public void | quote(Appendable
The Appendable to append the quoted and escaped string into. buffer, String The String to quote. input)Implements org. |
| public String | quoteIfNeeded(String
The string to quote. s)Implements org. |
| public void | quoteIfNeeded(StringBuilder
the buffer to append to buf, String the string to possibly quote str)Implements org. |
| private String | |
| public Iterator | tokenize(String
The string to be tokenized string)Implements org. Iterator of tokens
split from the string by delimiters.
|
| public String | |
| public String | unquote(String
The string to unquote. s)Implements org. |
| _delim | back to summary |
|---|---|
| private final String _delim | |
| _embeddedQuotes | back to summary |
|---|---|
| private final boolean _embeddedQuotes | |
| _escapeOnlyQuote | back to summary |
|---|---|
| private final boolean _escapeOnlyQuote | |
| _optionalWhiteSpace | back to summary |
|---|---|
| private final boolean _optionalWhiteSpace | |
| _returnDelimiters | back to summary |
|---|---|
| private final boolean _returnDelimiters | |
| _returnQuotes | back to summary |
|---|---|
| private final boolean _returnQuotes | |
| RFC9110QuotedStringTokenizer | back to summary |
|---|---|
| pack-priv RFC9110QuotedStringTokenizer(String delim, boolean optionalWhiteSpace, boolean returnDelimiters, boolean returnQuotes, boolean embeddedQuotes, boolean escapeOnlyQuote) | |
| isOptionalWhiteSpace | back to summary |
|---|---|
| protected boolean isOptionalWhiteSpace(char c) | |
| needsQuoting | back to summary |
|---|---|
| public boolean needsQuoting(char c) Implements org.
| |
| quote | back to summary |
|---|---|
| public void quote(Appendable buffer, String input) Implements org. Doc from org. Quote a string into an Appendable, escaping any characters that need to be escaped.
| |
| quoteIfNeeded | back to summary |
|---|---|
| public String quoteIfNeeded(String s) Implements org. Doc from org. Quote a string. The string is quoted only if quoting is required due to embedded delimiters, quote characters or the empty string. | |
| quoteIfNeeded | back to summary |
|---|---|
| public void quoteIfNeeded(StringBuilder buf, String str) Implements org. Doc from org. Append into buf the provided string, adding quotes if needed.
Quoting is determined if any of the characters in the
| |
| quoteIfNeededImpl | back to summary |
|---|---|
| private String quoteIfNeededImpl(StringBuilder buf, String str) | |
| tokenize | back to summary |
|---|---|
| public Iterator Implements org. Doc from org. Tokenize the passed string into an | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| unquote | back to summary |
|---|---|
| public String unquote(String s) Implements org. Doc from org. Unquote a string and expand any escaped characters | |