|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.crsh.shell.impl.command.AbstractInvocationContext<P>
org.crsh.shell.impl.command.InvocationContextImpl<P>
public final class InvocationContextImpl<P>
| 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 |
| Constructor Detail |
|---|
public InvocationContextImpl(CommandContext<P> commandContext)
| Method Detail |
|---|
public RenderPrintWriter getWriter()
InvocationContext
public boolean takeAlternateBuffer()
throws IOException
InteractionContextScreenContext.flush() method
is invoked.
IOException
public boolean releaseAlternateBuffer()
throws IOException
InteractionContextScreenContext.flush() method
is invoked.
IOException
public CommandInvoker<?,?> resolve(String s)
throws CommandException
InvocationContext
s - the command line
CommandException - any command exceptionpublic Class<P> getConsumedType()
Consumer
public String getProperty(String propertyName)
InteractionContext
propertyName - the property name
public 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 typing
IOException - any io exception
InterruptedException - 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 element
Exception - any exception
public void flush()
throws IOException
Consumer
IOException - any io exception
public void close()
throws Exception
Exceptionpublic 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 | |||||||||