public class BaseLensCommand extends Object implements org.springframework.shell.core.ExecutionProcessor
Modifier and Type | Field and Description |
---|---|
static String |
DATE_FMT |
static ThreadLocal<DateFormat> |
DATE_PARSER |
Constructor and Description |
---|
BaseLensCommand()
Instantiates a new base lens command.
|
Modifier and Type | Method and Description |
---|---|
void |
afterReturningInvocation(org.springframework.shell.event.ParseResult parseResult,
Object o) |
void |
afterThrowingInvocation(org.springframework.shell.event.ParseResult parseResult,
Throwable throwable) |
org.springframework.shell.event.ParseResult |
beforeInvocation(org.springframework.shell.event.ParseResult parseResult)
This Code piece allows lens cli to be able to parse list arguments.
|
static String |
formatDate(Date dt) |
String |
formatJson(Object data)
Pretty printing JSON object into CLI String.
|
LensClient |
getClient() |
static LensClientSingletonWrapper |
getClientWrapper() |
String |
getOrDefaultQueryHandleString(String queryHandleString) |
String |
getValidPath(File path,
boolean shouldBeDirectory,
boolean shouldExist)
Method that uses PathValidator to get appropriate path.
|
String |
removePrefixBeforeURI(String path)
Method to remove unrequired prefix from path.
|
void |
setClient(LensClient client) |
public static final String DATE_FMT
public static final ThreadLocal<DateFormat> DATE_PARSER
public void setClient(LensClient client)
public LensClient getClient()
public static LensClientSingletonWrapper getClientWrapper()
public String formatJson(Object data)
data
- to be formattedpublic org.springframework.shell.event.ParseResult beforeInvocation(org.springframework.shell.event.ParseResult parseResult)
beforeInvocation
in interface org.springframework.shell.core.ExecutionProcessor
parseResult
- public void afterReturningInvocation(org.springframework.shell.event.ParseResult parseResult, Object o)
afterReturningInvocation
in interface org.springframework.shell.core.ExecutionProcessor
public void afterThrowingInvocation(org.springframework.shell.event.ParseResult parseResult, Throwable throwable)
afterThrowingInvocation
in interface org.springframework.shell.core.ExecutionProcessor
public String getValidPath(File path, boolean shouldBeDirectory, boolean shouldExist)
path
- shouldBeDirectory
- shouldExist
- public String removePrefixBeforeURI(String path)
path
- Copyright © 2014–2018 Apache Software Foundation. All rights reserved.