org.crsh.shell.impl
Class InvocationContextImpl<C,P>

java.lang.Object
  extended by org.crsh.command.impl.BaseCommandContext
      extended by org.crsh.command.impl.BaseInvocationContext<C,P>
          extended by org.crsh.shell.impl.InvocationContextImpl<C,P>
All Implemented Interfaces:
CommandContext, InvocationContext<C,P>

 class InvocationContextImpl<C,P>
extends BaseInvocationContext<C,P>

Version:
$Revision$
Author:
Julien Viet

Field Summary
private  ShellProcessContext processContext
          .
 
Fields inherited from class org.crsh.command.impl.BaseInvocationContext
buffer, consumedItems, producedItems, writer
 
Constructor Summary
InvocationContextImpl(ShellProcessContext processContext, Iterable<C> consumedItems, Map<String,Object> attributes)
           
 
Method Summary
 String getProperty(String propertyName)
          Returns a generic property.
 int getWidth()
          Returns the term width in chars.
 String readLine(String msg, boolean echo)
          Display a message and read a line on the console.
 
Methods inherited from class org.crsh.command.impl.BaseInvocationContext
consume, getBuffer, getProducedItems, getWriter, isPiped, produce
 
Methods inherited from class org.crsh.command.impl.BaseCommandContext
getAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.crsh.command.CommandContext
getAttributes
 

Field Detail

processContext

private final ShellProcessContext processContext
.

Constructor Detail

InvocationContextImpl

public InvocationContextImpl(ShellProcessContext processContext,
                             Iterable<C> consumedItems,
                             Map<String,Object> attributes)
Method Detail

getWidth

public int getWidth()
Description copied from interface: InvocationContext
Returns the term width in chars. When the value is not positive it means the value could not be determined.

Returns:
the term width

getProperty

public String getProperty(String propertyName)
Description copied from interface: InvocationContext
Returns a generic property.

Parameters:
propertyName - the property name
Returns:
the property value

readLine

public String readLine(String msg,
                       boolean echo)
Description copied from interface: InvocationContext
Display a message and read a line on the console.

Parameters:
msg - the message to display before reading a line
echo - wether or not the line read should be echoed when typing
Returns:
the line read


Copyright © 2012 eXo Platform SAS. All Rights Reserved.