public final class InvocationContextImpl<P> extends AbstractInvocationContext<P>
| Modifier and Type | Field and Description |
|---|---|
private static int |
CLOSED
.
|
private CommandContext<P> |
commandContext
.
|
private static int |
FLUSHED
.
|
(package private) int |
status
.
|
private RenderPrintWriter |
writer
.
|
private static int |
WRITTEN
.
|
| Constructor and Description |
|---|
InvocationContextImpl(CommandContext<P> commandContext) |
| Modifier and Type | Method and Description |
|---|---|
Screenable |
append(char c) |
Screenable |
append(CharSequence s) |
Screenable |
append(CharSequence csq,
int start,
int end) |
Screenable |
append(Style style) |
void |
close() |
Screenable |
cls() |
void |
flush()
Flush the stream.
|
Map<String,Object> |
getAttributes()
Returns the current attributes.
|
Class<P> |
getConsumedType()
Returns the class of the element generic type.
|
int |
getHeight()
Returns the screen height in chars.
|
String |
getProperty(String propertyName)
Returns a generic property, usually this property is resolved by the
shell client.
|
Map<String,Object> |
getSession()
Returns the current session.
|
int |
getWidth()
Returns the screen width in chars.
|
RenderPrintWriter |
getWriter()
Returns the writer for the output.
|
void |
provide(P element)
Provide an element.
|
String |
readLine(String msg,
boolean echo)
Display a message and read a line on the console, this method call can be blocking until the user provides
a value.
|
boolean |
releaseAlternateBuffer()
Release control of the alternate buffer.
|
CommandInvoker<?,?> |
resolve(String s)
Resolve a command invoker for the specified command line.
|
boolean |
takeAlternateBuffer()
Take control of the alternate buffer.
|
leftShiftprivate static final int WRITTEN
private static final int FLUSHED
private static final int CLOSED
private final CommandContext<P> commandContext
private RenderPrintWriter writer
int status
public InvocationContextImpl(CommandContext<P> commandContext)
public RenderPrintWriter getWriter()
InvocationContextpublic boolean takeAlternateBuffer() throws IOException
InteractionContextScreenContext.flush() method
is invoked.IOExceptionpublic boolean releaseAlternateBuffer() throws IOException
InteractionContextScreenContext.flush() method
is invoked.IOExceptionpublic CommandInvoker<?,?> resolve(String s) throws CommandException
InvocationContexts - the command lineCommandException - any command exceptionpublic Class<P> getConsumedType()
Consumerpublic String getProperty(String propertyName)
InteractionContextpropertyName - the property namepublic String readLine(String msg, boolean echo) throws IOException, InterruptedException
InteractionContextmsg - the message to display before reading a lineecho - wether or not the line read should be echoed when typingIOException - any io exceptionInterruptedException - the thread was interrupted while waiting for the user valuepublic int getWidth()
ScreenContextpublic int getHeight()
ScreenContextpublic Screenable append(CharSequence s) throws IOException
IOExceptionpublic Screenable append(char c) throws IOException
IOExceptionpublic Screenable append(CharSequence csq, int start, int end) throws IOException
IOExceptionpublic Screenable append(Style style) throws IOException
IOExceptionpublic Screenable cls() throws IOException
IOExceptionpublic void provide(P element) throws Exception
Consumerelement - the provided elementException - any exceptionpublic void flush() throws IOException
ConsumerIOException - any io exceptionpublic Map<String,Object> getSession()
RuntimeContextpublic Map<String,Object> getAttributes()
RuntimeContextCopyright © 2015 eXo Platform SAS. All Rights Reserved.