|
||||||||||
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
This class provides the base class for Groovy scripts. It should not be used directly as it is rather used
for configuring a Groovy CompilerConfiguration.setScriptBaseClass(String)
class.
Field Summary | |
---|---|
private String[] |
args
. |
private CommandContext |
context
. |
Constructor Summary | |
---|---|
GroovyScriptCommand()
|
Method Summary | |
---|---|
CommandCompletion |
complete(CommandContext context,
String line)
Provide completions for the specified arguments. |
CommandInvoker<?,?> |
createInvoker(String line)
Provides an invoker for the specified arguments. |
String |
describe(String line,
DescriptionFormat mode)
Returns a description of the command or null if none can be found. |
Class<Void> |
getConsumedType()
Returns the class of the consumed type. |
Class<Void> |
getProducedType()
Returns the class of the produced type. |
Object |
getProperty(String property)
|
void |
invoke(InvocationContext<Void,Void> context)
Invoke a command |
Object |
invokeMethod(String name,
Object args)
|
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 CommandContext context
private String[] args
Constructor Detail |
---|
public GroovyScriptCommand()
Method Detail |
---|
public final Class<Void> getProducedType()
CommandInvoker
getProducedType
in interface CommandInvoker<Void,Void>
public final Class<Void> getConsumedType()
CommandInvoker
getConsumedType
in interface CommandInvoker<Void,Void>
public Object invokeMethod(String name, Object args)
invokeMethod
in interface groovy.lang.GroovyObject
invokeMethod
in class groovy.lang.Script
public final Object getProperty(String property)
getProperty
in interface groovy.lang.GroovyObject
getProperty
in class groovy.lang.Script
public final CommandCompletion complete(CommandContext context, String line)
ShellCommand
complete
in interface ShellCommand
context
- the command contextline
- the original command line arguments
public String describe(String line, DescriptionFormat mode)
ShellCommand
describe
in interface ShellCommand
line
- the usage linemode
- the description mode
public final void invoke(InvocationContext<Void,Void> context) throws ScriptException
CommandInvoker
invoke
in interface CommandInvoker<Void,Void>
context
- the command execution context
ScriptException
- any script exceptionpublic final CommandInvoker<?,?> createInvoker(String line)
ShellCommand
createInvoker
in interface ShellCommand
line
- the command line arguments
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |