|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgroovy.lang.GroovyObjectSupport
groovy.lang.Script
org.crsh.command.GroovyScriptCommand
public abstract class GroovyScriptCommand
| Field Summary | |
|---|---|
private String[] |
args
. |
protected CommandContext |
context
The current context. |
protected RenderPrintWriter |
out
The current output. |
private LinkedList<InvocationContext<?>> |
stack
. |
| Constructor Summary | |
|---|---|
protected |
GroovyScriptCommand()
|
| Method Summary | |
|---|---|
CommandCompletion |
complete(CommandContext context,
String line)
Provide completions for the specified arguments. |
String |
describe(String line,
DescriptionFormat mode)
Returns a description of the command or null if none can be found. |
Class<Object> |
getConsumedType()
Returns the class of the consumed type. |
Class<Object> |
getProducedType()
Returns the class of the produced type. |
Object |
getProperty(String property)
|
PipeCommand<Object> |
invoke(InvocationContext<Object> context)
Invoke a command |
Object |
invokeMethod(String name,
Object args)
|
InvocationContext<?> |
peekContext()
|
InvocationContext<?> |
popContext()
|
void |
pushContext(InvocationContext<?> context)
|
CommandInvoker<?,?> |
resolveInvoker(String line)
Provides an invoker for the command line specified as a command line to parse. |
CommandInvoker<?,?> |
resolveInvoker(String name,
Map<String,?> options,
List<?> args)
Provides an invoker for the command line specified under the form of a command, options and arguments. |
| Methods inherited from class groovy.lang.Script |
|---|
evaluate, evaluate, getBinding, print, printf, printf, println, println, run, run, setBinding, setProperty |
| Methods inherited from class groovy.lang.GroovyObjectSupport |
|---|
getMetaClass, setMetaClass |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private LinkedList<InvocationContext<?>> stack
protected CommandContext context
protected RenderPrintWriter out
private String[] args
| Constructor Detail |
|---|
protected GroovyScriptCommand()
| Method Detail |
|---|
public final void pushContext(InvocationContext<?> context)
throws NullPointerException
NullPointerExceptionpublic final InvocationContext<?> popContext()
public final InvocationContext<?> peekContext()
public final Class<Object> getProducedType()
CommandInvoker
getProducedType in interface CommandInvoker<Object,Object>public final Class<Object> getConsumedType()
CommandInvoker
getConsumedType in interface CommandInvoker<Object,Object>
public Object invokeMethod(String name,
Object args)
invokeMethod in interface groovy.lang.GroovyObjectinvokeMethod in class groovy.lang.Scriptpublic final Object getProperty(String property)
getProperty in interface groovy.lang.GroovyObjectgetProperty in class groovy.lang.Script
public final CommandCompletion complete(CommandContext context,
String line)
ShellCommand
complete in interface ShellCommandcontext - the command contextline - the original command line arguments
public String describe(String line,
DescriptionFormat mode)
ShellCommand
describe in interface ShellCommandline - the usage linemode - the description mode
public final PipeCommand<Object> invoke(InvocationContext<Object> context)
throws ScriptException
CommandInvoker
invoke in interface CommandInvoker<Object,Object>context - the command execution context
ScriptException - any script exceptionpublic final CommandInvoker<?,?> resolveInvoker(String line)
ShellCommand
resolveInvoker in interface ShellCommandline - the command line arguments
public CommandInvoker<?,?> resolveInvoker(String name,
Map<String,?> options,
List<?> args)
ShellCommand
resolveInvoker in interface ShellCommandname - the command name, might be nulloptions - the optionsargs - the arguments
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||