public class DefaultPrinter extends JlineCommandRegistry implements Printer
Printer.TableRowsCommandRegistry.CommandSession| Modifier and Type | Field and Description |
|---|---|
protected static int |
PRNT_INDENTION |
protected static int |
PRNT_MAX_DEPTH |
protected static int |
PRNT_MAX_ROWS |
protected static String |
VAR_PRNT_OPTIONS |
ALL, BOOLEAN_KEYS, BORDER, COLUMNS, COLUMNS_IN, COLUMNS_OUT, EXCLUDE, HIGHLIGHT_VALUE, INCLUDE, INDENTION, MAP_SIMILARITY, MAX_COLUMN_WIDTH, MAX_DEPTH, MAXROWS, MULTI_COLUMNS, OBJECT_TO_MAP, OBJECT_TO_STRING, ONE_ROW_TABLE, ROW_HIGHLIGHT, ROWNUM, SHORT_NAMES, SKIP_DEFAULT_OPTIONS, STRUCT_ON_TABLE, STYLE, TO_STRING, VALUE_STYLE, VALUE_STYLE_ALL, WIDTH| Constructor and Description |
|---|
DefaultPrinter(ConfigurationPath configPath) |
DefaultPrinter(ScriptEngine engine,
ConfigurationPath configPath) |
| Modifier and Type | Method and Description |
|---|---|
String[] |
appendUsage(String[] customUsage) |
Map<String,Object> |
compileOptions(Options opt) |
protected Map<String,Object> |
defaultPrntOptions(boolean skipDefault)
Set default and mandatory printing options.
|
protected void |
highlightAndPrint(Map<String,Object> options,
Throwable exception)
Highlight and print an exception
|
protected void |
manageBooleanOptions(Map<String,Object> options)
Boolean printing options Printer checks only if key is present.
|
void |
println(Map<String,Object> optionsIn,
Object object) |
void |
println(Object object) |
Exception |
prntCommand(CommandInput input) |
boolean |
refresh()
Clear printer syntax highlighter cache
|
void |
setHighlightValue(Map<String,Function<Object,org.jline.utils.AttributedString>> highlightValue)
Highlight column value
|
void |
setObjectToMap(Map<Class<?>,Function<Object,Map<String,Object>>> objectToMap)
Override ScriptEngine toMap() method
|
void |
setObjectToString(Map<Class<?>,Function<Object,String>> objectToString)
Override ScriptEngine toString() method
|
protected org.jline.terminal.Terminal |
terminal() |
commandDescription, commandInfo, commandOptions, compileCommandDescription, compileCommandInfo, compileCommandOptions, defaultCompleter, parseOptionsalias, commandAliases, commandNames, compileCompleters, doHelpDesc, getCommandMethods, hasCommand, invoke, registerCommands, registerCommands, registeredCommand, rename, saveExceptionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaggregateCompleters, compileCompleters, nameprotected static final String VAR_PRNT_OPTIONS
protected static final int PRNT_MAX_ROWS
protected static final int PRNT_MAX_DEPTH
protected static final int PRNT_INDENTION
public DefaultPrinter(ConfigurationPath configPath)
public DefaultPrinter(ScriptEngine engine, ConfigurationPath configPath)
public boolean refresh()
Printerpublic Exception prntCommand(CommandInput input)
prntCommand in interface Printerpublic void setObjectToMap(Map<Class<?>,Function<Object,Map<String,Object>>> objectToMap)
objectToMap - key: object class, value: toMap functionpublic void setObjectToString(Map<Class<?>,Function<Object,String>> objectToString)
objectToString - key: object class, value: toString functionpublic void setHighlightValue(Map<String,Function<Object,org.jline.utils.AttributedString>> highlightValue)
highlightValue - key: regex for column name, value: highlight functionprotected org.jline.terminal.Terminal terminal()
protected void manageBooleanOptions(Map<String,Object> options)
options - printing optionsprotected Map<String,Object> defaultPrntOptions(boolean skipDefault)
skipDefault - when true does not set default optionsCopyright © 2023. All rights reserved.