public abstract class AbstractKVCommand extends AbstractCommand
Modifier and Type | Class and Description |
---|---|
static class |
AbstractKVCommand.BytesParser
Parses a
byte[] array as hexadecimal or doubly-quoted "C" style string. |
Modifier and Type | Field and Description |
---|---|
static Pattern |
CSTRING_PATTERN
Matches the doubly-quoted C strings returnd by
toCString() . |
static Pattern |
HEXBYTES_PATTERN
Matches hexadecimal byte strings.
|
log, name, paramParser
Modifier | Constructor and Description |
---|---|
protected |
AbstractKVCommand(String spec) |
Modifier and Type | Method and Description |
---|---|
static byte[] |
fromCString(String string)
Parse a
byte[] array encoded as a double-quoted C-string representation by toCString() . |
protected Parser<?> |
getParser(String typeName)
Convert parameter spec type name into a
Parser . |
static String |
toCString(byte[] data)
Convert a
byte[] array into a double-quoted C-string representation, surrounded by double quotes,
with non-ASCII bytes, double-quotes, and backslashes escaped with a backslash. |
getAction, getExprParam, getExprParam, getHelpDetail, getHelpSummary, getName, getSessionModes, getUsage, parse
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyIdentifierScope
public static final Pattern CSTRING_PATTERN
toCString()
.public static final Pattern HEXBYTES_PATTERN
protected AbstractKVCommand(String spec)
protected Parser<?> getParser(String typeName)
AbstractCommand
Parser
. Used for custom type names not supported by ParamParser
.
The implementation in AbstractCommand
supports all FieldType
s registered with the
database, plus:
getParser
in class AbstractCommand
typeName
- parameter type namepublic static String toCString(byte[] data)
byte[]
array into a double-quoted C-string representation, surrounded by double quotes,
with non-ASCII bytes, double-quotes, and backslashes escaped with a backslash.
Supported escapes are \\
, \"
, \b
, \f
, \t
, \n
, \r
, and \xNN
.
data
- byte arraypublic static byte[] fromCString(String string)
byte[]
array encoded as a double-quoted C-string representation by toCString()
.string
- C stringIllegalArgumentException
- if string
is malformedCopyright © 2022. All rights reserved.