|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.crsh.command.InvocationContextImpl<P>
final class InvocationContextImpl<P>
Field Summary | |
---|---|
private CommandContext<P> |
commandContext
. |
private RenderPrintWriter |
writer
. |
Constructor Summary | |
---|---|
InvocationContextImpl(CommandContext<P> commandContext)
|
Method Summary | |
---|---|
void |
close()
|
void |
flush()
|
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. |
boolean |
isPiped()
|
InvocationContextImpl<P> |
leftShift(Object o)
|
void |
provide(P element)
Provide an element. |
String |
readLine(String msg,
boolean echo)
Display a message and read a line on the console. |
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final CommandContext<P> commandContext
private RenderPrintWriter writer
Constructor Detail |
---|
InvocationContextImpl(CommandContext<P> commandContext)
Method Detail |
---|
public boolean isPiped()
isPiped
in interface CommandContext<P>
public RenderPrintWriter getWriter()
InvocationContext
getWriter
in interface InvocationContext<P>
public boolean takeAlternateBuffer() throws IOException
InteractionContext
Flushable.flush()
method
is invoked.
takeAlternateBuffer
in interface InteractionContext<P>
IOException
public boolean releaseAlternateBuffer() throws IOException
InteractionContext
Flushable.flush()
method
is invoked.
releaseAlternateBuffer
in interface InteractionContext<P>
IOException
public CommandInvoker<?,?> resolve(String s) throws ScriptException, IOException
InvocationContext
resolve
in interface InvocationContext<P>
s
- the command line
ScriptException
- any script exception
IOException
- any io exceptionpublic Class<P> getConsumedType()
Consumer
getConsumedType
in interface Consumer<P>
public String getProperty(String propertyName)
InteractionContext
getProperty
in interface InteractionContext<P>
propertyName
- the property name
public String readLine(String msg, boolean echo)
InteractionContext
readLine
in interface InteractionContext<P>
msg
- the message to display before reading a lineecho
- wether or not the line read should be echoed when typing
public int getWidth()
ScreenContext
getWidth
in interface ScreenContext<P>
public int getHeight()
ScreenContext
getHeight
in interface ScreenContext<P>
public void provide(P element) throws IOException
Consumer
provide
in interface Consumer<P>
element
- the provided element
IOException
public void flush() throws IOException
flush
in interface Flushable
IOException
public void close() throws IOException
close
in interface Closeable
IOException
public Map<String,Object> getSession()
RuntimeContext
getSession
in interface RuntimeContext
public Map<String,Object> getAttributes()
RuntimeContext
getAttributes
in interface RuntimeContext
public InvocationContextImpl<P> leftShift(Object o) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |