org.apache.felix.gogo.runtime
public class CommandSessionImpl extends java.lang.Object implements CommandSession, Converter
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COMMANDS |
protected java.io.InputStream |
in |
protected java.io.PrintStream |
out |
static java.lang.String |
SESSION_CLOSED |
protected java.util.Map<java.lang.String,java.lang.Object> |
variables |
static java.lang.String |
VARIABLES |
CONVERTER_CLASSES, INSPECT, LINE, PART
Modifier | Constructor and Description |
---|---|
protected |
CommandSessionImpl(CommandProcessorImpl shell,
java.io.InputStream in,
java.io.PrintStream out,
java.io.PrintStream err) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this command session.
|
java.lang.Object |
convert(java.lang.Class<?> desiredType,
java.lang.Object in)
Convert an object to another type.
|
java.lang.Object |
execute(java.lang.CharSequence commandline)
Execute a program in this session.
|
java.lang.CharSequence |
format(java.lang.Object result,
int inspect)
Convert an object to string form (CharSequence).
|
java.lang.CharSequence |
format(java.lang.Object target,
int level,
Converter escape)
Convert an objet to a CharSequence object in the requested format.
|
java.lang.Object |
get(java.lang.String name)
Get the value of a variable.
|
java.io.PrintStream |
getConsole()
Return the PrintStream for the console.
|
java.io.InputStream |
getKeyboard()
Return the input stream that is the first of the pipeline.
|
void |
put(java.lang.String name,
java.lang.Object value)
Set the value of a variable.
|
public static final java.lang.String SESSION_CLOSED
public static final java.lang.String VARIABLES
public static final java.lang.String COMMANDS
protected java.io.InputStream in
protected java.io.PrintStream out
protected final java.util.Map<java.lang.String,java.lang.Object> variables
protected CommandSessionImpl(CommandProcessorImpl shell, java.io.InputStream in, java.io.PrintStream out, java.io.PrintStream err)
public void close()
CommandSession
close
in interface CommandSession
public java.lang.Object execute(java.lang.CharSequence commandline) throws java.lang.Exception
CommandSession
execute
in interface CommandSession
java.lang.Exception
public java.io.InputStream getKeyboard()
CommandSession
getKeyboard
in interface CommandSession
public java.lang.Object get(java.lang.String name)
CommandSession
get
in interface CommandSession
public void put(java.lang.String name, java.lang.Object value)
CommandSession
put
in interface CommandSession
name
- Name of the variable.value
- Value of the variablepublic java.io.PrintStream getConsole()
CommandSession
getConsole
in interface CommandSession
public java.lang.CharSequence format(java.lang.Object target, int level, Converter escape) throws java.lang.Exception
Converter
public java.lang.Object convert(java.lang.Class<?> desiredType, java.lang.Object in)
CommandSession
convert
in interface CommandSession
convert
in interface Converter
desiredType
- The type that the returned object can be assigned toin
- The object that must be convertedpublic java.lang.CharSequence format(java.lang.Object result, int inspect)
CommandSession
format
in interface CommandSession
Copyright © 2014. All Rights Reserved.