|
||||||||||
| 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.lang.groovy.command.GroovyScriptCommand
public abstract class GroovyScriptCommand
| Field Summary | |
|---|---|
private String[] |
args
. |
protected InvocationContext |
context
The current context. |
private CommandInvoker<Object,Object> |
invoker
|
protected RenderPrintWriter |
out
The current output. |
private LinkedList<InvocationContext<?>> |
stack
. |
| Constructor Summary | |
|---|---|
protected |
GroovyScriptCommand()
|
| Method Summary | |
|---|---|
CompletionMatch |
complete(RuntimeContext 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. |
void |
execute(String s)
|
Object |
getProperty(String property)
|
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 InvocationContext context
protected RenderPrintWriter out
private String[] args
private final CommandInvoker<Object,Object> invoker
| Constructor Detail |
|---|
protected GroovyScriptCommand()
| Method Detail |
|---|
public final void pushContext(InvocationContext<?> context)
throws NullPointerException
NullPointerExceptionpublic final InvocationContext<?> popContext()
public final void execute(String s)
throws ScriptException,
IOException
ScriptException
IOExceptionpublic final InvocationContext<?> peekContext()
public final 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 CompletionMatch complete(RuntimeContext context,
String line)
ShellCommand
complete in interface ShellCommandcontext - the command contextline - the original command line arguments
public final String describe(String line,
DescriptionFormat mode)
ShellCommand
describe in interface ShellCommandline - the usage linemode - the description mode
public final CommandInvoker<?,?> resolveInvoker(String line)
ShellCommand
resolveInvoker in interface ShellCommandline - the command line arguments
public final 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 | |||||||||