public class KeyValuePrinter
extends java.lang.Object
KeyValueCollection kvOptions = new KeyValueCollection();
KeyValueCollection kvData = new KeyValueCollection();
kvData.addString("Password", KeyValuePrinter.HIDE_FILTER_NAME);
KeyValuePrinter hidePrinter = new KeyValuePrinter(kvOptions, kvData);
KeyValuePrinter.setDefaultPrinter(hidePrinter);
KeyValueCollection col = new KeyValueCollection();
col.addString("Password", "asdfg");
col.addString("qqwee", "dfdg");
System.out.println(col.toString());
Output is:
KVList:
'Password' [output supressed]
'qqwee' [str] = "dfdg"
KeyValueCollection kvData = new KeyValueCollection();
KeyValueCollection kvPPfilter = new KeyValueCollection();
KeyValueCollection kvPPOptions = new KeyValueCollection();
kvPPfilter.addString(KeyValuePrinter.CUSTOM_FILTER_TYPE, "PrefixPostfixFilter");
kvPPOptions.addString(PrefixPostfixFilter.KEY_PREFIX_STRING, "<###");
kvPPOptions.addString(PrefixPostfixFilter.VALUE_POSTFIX_STRING, "###>");
kvPPOptions.addString(PrefixPostfixFilter.KEY_POSTFIX_STRING, ">");
kvPPOptions.addString(PrefixPostfixFilter.VALUE_PREFIX_STRING, "<");
kvPPfilter.addList(KeyValuePrinter.CUSTOM_FILTER_OPTIONS, kvPPOptions);
kvData.addList("test", kvPPfilter);
KeyValuePrinter.setDefaultPrinter(
new KeyValuePrinter(new KeyValueCollection(), kvData));
KeyValueCollection col = new KeyValueCollection();
col.addString("qqwee", "d2f3d4g5");
col.addString("test", "tratata");
System.out.println(col.toString());
KVList:
'qqwee' [str] = "d2f3d4g5"
<###'test'> [str] = <"tratata"###>
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
COPY_FILTER_NAME |
"Copy" filter just outputs data as is.
|
static java.lang.String |
CUSTOM_FILTER_NAME |
Key value for adding user defined custom filter to filter set.
|
static java.lang.String |
CUSTOM_FILTER_OPTIONS |
Custom filter options, which will be passed to
KeyValueOutputFilter.configure()
method of custom filter class. |
static java.lang.String |
CUSTOM_FILTER_TYPE |
Fully-qualified name of custom filter class type with public default constructor.
|
static java.lang.String |
DEF_FILTER_OPTION |
String option.
|
static java.lang.String |
FILTER_NAME |
|
static java.lang.String |
HIDE_FILTER_NAME |
"Hide" filter doesn't show the data, but key is present in output.
|
static java.lang.String |
HIDE_FIRST_CHARACTERS_COUNT |
|
static java.lang.String |
HIDE_FIRST_FILTER_NAME |
|
static java.lang.String |
HIDE_LAST_CHARACTERS_COUNT |
|
static java.lang.String |
HIDE_LAST_FILTER_NAME |
|
static java.lang.String |
SKIP_FILTER_NAME |
"Skip" filter doesn't show either key or data.
|
static java.lang.String |
TAG_FILTER_NAME |
"tag()" filter tags the value of the key.
|
static java.lang.String |
TRUNCATE_FILTER_NAME |
"Truncate" filter cuts the binary data off if it's longer then
some threshold
|
static java.lang.String |
TRUNCATE_THRESHOLD_OPTION |
Integer option.
|
static java.lang.String |
UNHIDE_FIRST_CHARACTERS_COUNT |
|
static java.lang.String |
UNHIDE_FIRST_FILTER_NAME |
|
static java.lang.String |
UNHIDE_LAST_CHARACTERS_COUNT |
|
static java.lang.String |
UNHIDE_LAST_FILTER_NAME |
Constructor | Description |
---|---|
KeyValuePrinter(KeyValueCollection options,
KeyValueCollection data) |
Creates a new printer.
|
Modifier and Type | Method | Description |
---|---|---|
void |
appendValue(java.lang.StringBuffer buf,
KeyValueCollection list) |
Appends string representation of TKV list to given buffer by applying
configured set of filters to the list.
|
void |
appendValue(java.lang.StringBuffer buf,
KeyValueCollection list,
int indent) |
Appends string representation of TKV list to given buffer by applying
configured set of filters to the list.
|
void |
appendValue(java.lang.StringBuffer buf,
java.lang.String key,
java.lang.Object value) |
Appends string representation of key/value pair to given buffer by applying
configured set of filters to the list.
|
void |
appendValue(java.lang.StringBuffer buf,
java.lang.String key,
java.lang.Object value,
int indent) |
Appends string representation of key/value pair to given buffer by applying
configured set of filters to the list.
|
static KeyValuePrinter |
getDefaultPrinter() |
Gets default printer for this VM.
|
static void |
setDefaultPrinter(KeyValuePrinter printer) |
Sets default printer for this VM.
|
java.lang.String |
toString(KeyValueCollection kvList) |
Creates string representation of TKV list applying configured set of
filters.
|
java.lang.String |
toString(java.lang.String key,
java.lang.Object value) |
Creates string representation of key/value pair applying configured set of
filters.
|
public static final java.lang.String DEF_FILTER_OPTION
public static final java.lang.String TRUNCATE_THRESHOLD_OPTION
public static final java.lang.String COPY_FILTER_NAME
public static final java.lang.String HIDE_FILTER_NAME
public static final java.lang.String SKIP_FILTER_NAME
public static final java.lang.String TRUNCATE_FILTER_NAME
public static final java.lang.String TAG_FILTER_NAME
public static final java.lang.String HIDE_FIRST_FILTER_NAME
public static final java.lang.String HIDE_FIRST_CHARACTERS_COUNT
public static final java.lang.String HIDE_LAST_FILTER_NAME
public static final java.lang.String HIDE_LAST_CHARACTERS_COUNT
public static final java.lang.String UNHIDE_FIRST_FILTER_NAME
public static final java.lang.String UNHIDE_FIRST_CHARACTERS_COUNT
public static final java.lang.String UNHIDE_LAST_FILTER_NAME
public static final java.lang.String UNHIDE_LAST_CHARACTERS_COUNT
public static final java.lang.String FILTER_NAME
public static final java.lang.String CUSTOM_FILTER_NAME
CUSTOM_FILTER_TYPE
,
and CUSTOM_FILTER_OPTIONS
pairs.public static final java.lang.String CUSTOM_FILTER_TYPE
public static final java.lang.String CUSTOM_FILTER_OPTIONS
KeyValueOutputFilter.configure()
method of custom filter class.public KeyValuePrinter(KeyValueCollection options, KeyValueCollection data)
options
- global options for the printerdata
- individual key-filter mappingpublic static KeyValuePrinter getDefaultPrinter()
public static void setDefaultPrinter(KeyValuePrinter printer)
printer
- default (singleton) printerpublic java.lang.String toString(KeyValueCollection kvList)
kvList
- list to outputpublic java.lang.String toString(java.lang.String key, java.lang.Object value)
key
- name of value to convertvalue
- value to convertpublic void appendValue(java.lang.StringBuffer buf, KeyValueCollection list)
buf
- buffer to append the list tolist
- list to outputpublic void appendValue(java.lang.StringBuffer buf, KeyValueCollection list, int indent)
buf
- buffer to append the list tolist
- list to outputpublic void appendValue(java.lang.StringBuffer buf, java.lang.String key, java.lang.Object value)
buf
- buffer to append the list tokey
- name of value to convertvalue
- value to convertpublic void appendValue(java.lang.StringBuffer buf, java.lang.String key, java.lang.Object value, int indent)
buf
- buffer to append the list tokey
- name of value to convertvalue
- value to convertSend comments on this topicTechpubs.webadmin@genesys.com.
Document version: 9.0.006.00
Copyright © 2006–2019 Genesys Telecommunications Laboratories, Inc. All rights reserved.