|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.crsh.shell.impl.command.AbstractInvocationContext<P> org.crsh.shell.impl.command.InvocationContextImpl<P>
public final class InvocationContextImpl<P>
Field Summary | |
---|---|
private static int |
CLOSED . |
private CommandContext<P> |
commandContext . |
private static int |
FLUSHED . |
(package private) int |
status . |
private RenderPrintWriter |
writer . |
private static int |
WRITTEN . |
Constructor Summary | |
---|---|
InvocationContextImpl(CommandContext<P> commandContext) |
Method Summary | |
---|---|
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. |
Methods inherited from class org.crsh.shell.impl.command.AbstractInvocationContext |
---|
leftShift |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int WRITTEN
private static final int FLUSHED
private static final int CLOSED
private final CommandContext<P> commandContext
private RenderPrintWriter writer
int status
Constructor Detail |
---|
public InvocationContextImpl(CommandContext<P> commandContext)
Method Detail |
---|
public RenderPrintWriter getWriter()
InvocationContext
public boolean takeAlternateBuffer() throws IOException
InteractionContext
ScreenContext.flush()
method is invoked.
IOException
public boolean releaseAlternateBuffer() throws IOException
InteractionContext
ScreenContext.flush()
method is invoked.
IOException
public CommandInvoker<?,?> resolve(String s) throws CommandException
InvocationContext
s
- the command lineCommandException
- any command exceptionpublic Class<P> getConsumedType()
Consumer
public String getProperty(String propertyName)
InteractionContext
propertyName
- the property namepublic String readLine(String msg, boolean echo) throws IOException, InterruptedException
InteractionContext
msg
- 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()
ScreenContext
public int getHeight()
ScreenContext
public Screenable append(CharSequence s) throws IOException
IOException
public Screenable append(char c) throws IOException
IOException
public Screenable append(CharSequence csq, int start, int end) throws IOException
IOException
public Screenable append(Style style) throws IOException
IOException
public Screenable cls() throws IOException
IOException
public void provide(P element) throws Exception
Consumer
element
- the provided elementException
- any exceptionpublic void flush() throws IOException
Consumer
IOException
- any io exceptionpublic void close() throws Exception
Exception
public Map<String,Object> getSession()
RuntimeContext
public Map<String,Object> getAttributes()
RuntimeContext
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |