public final class InvocationContextImpl<P> extends java.lang.Object implements InvocationContext<P>
| Constructor and Description |
|---|
InvocationContextImpl(CommandContext<P> commandContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
java.util.Map<java.lang.String,java.lang.Object> |
getAttributes()
Returns the current attributes.
|
java.lang.Class<P> |
getConsumedType()
Returns the class of the element generic type.
|
int |
getHeight()
Returns the screen height in chars.
|
java.lang.String |
getProperty(java.lang.String propertyName)
Returns a generic property, usually this property is resolved by the
shell client.
|
java.util.Map<java.lang.String,java.lang.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(java.lang.Object o) |
void |
provide(P element)
Provide an element.
|
java.lang.String |
readLine(java.lang.String msg,
boolean echo)
Display a message and read a line on the console.
|
boolean |
releaseAlternateBuffer()
Release control of the alternate buffer.
|
CommandInvoker<?,?> |
resolve(java.lang.String s)
Resolve a command invoker for the specified command line.
|
boolean |
takeAlternateBuffer()
Take control of the alternate buffer.
|
void |
write(Chunk chunk)
Write a chunk to the screen.
|
public InvocationContextImpl(CommandContext<P> commandContext)
public boolean isPiped()
isPiped in interface CommandContext<P>public RenderPrintWriter getWriter()
InvocationContextgetWriter in interface InvocationContext<P>public boolean takeAlternateBuffer()
throws java.io.IOException
InteractionContextFlushable.flush() method
is invoked.takeAlternateBuffer in interface InteractionContextjava.io.IOExceptionpublic boolean releaseAlternateBuffer()
throws java.io.IOException
InteractionContextFlushable.flush() method
is invoked.releaseAlternateBuffer in interface InteractionContextjava.io.IOExceptionpublic CommandInvoker<?,?> resolve(java.lang.String s) throws ScriptException, java.io.IOException
InvocationContextresolve in interface InvocationContext<P>s - the command lineScriptException - any script exceptionjava.io.IOException - any io exceptionpublic java.lang.Class<P> getConsumedType()
ConsumergetConsumedType in interface Consumer<P>public java.lang.String getProperty(java.lang.String propertyName)
InteractionContextgetProperty in interface InteractionContextpropertyName - the property namepublic java.lang.String readLine(java.lang.String msg,
boolean echo)
InteractionContextreadLine in interface InteractionContextmsg - the message to display before reading a lineecho - wether or not the line read should be echoed when typingpublic int getWidth()
ScreenContextgetWidth in interface ScreenContextpublic int getHeight()
ScreenContextgetHeight in interface ScreenContextpublic void write(Chunk chunk) throws java.io.IOException
ScreenContextwrite in interface ScreenContextchunk - the chunkjava.io.IOException - any io exceptionpublic void provide(P element) throws java.io.IOException
Consumerpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushablejava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionpublic java.util.Map<java.lang.String,java.lang.Object> getSession()
RuntimeContextgetSession in interface RuntimeContextpublic java.util.Map<java.lang.String,java.lang.Object> getAttributes()
RuntimeContextgetAttributes in interface RuntimeContextpublic InvocationContextImpl<P> leftShift(java.lang.Object o) throws java.io.IOException
java.io.IOExceptionCopyright © 2014 eXo Platform SAS. All Rights Reserved.