|
||||||||||
| 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. |
protected RenderPrintWriter |
out
The current output. |
private LinkedList<InvocationContext<?>> |
stack
. |
| Constructor Summary | |
|---|---|
protected |
GroovyScriptCommand()
|
| Method Summary | |
|---|---|
void |
close()
Close the producer. |
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)
|
void |
flush()
|
Class<Object> |
getConsumedType()
Returns the class of the element generic type. |
Class<Object> |
getProducedType()
Returns the class of the produced type. |
Object |
getProperty(String property)
|
Object |
invokeMethod(String name,
Object args)
|
void |
open(CommandContext<Object> consumer)
Open the producer with the specified consumer. |
InvocationContext<?> |
peekContext()
|
InvocationContext<?> |
popContext()
|
void |
provide(Object element)
Provide an element. |
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
| 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 Class<Object> getProducedType()
Producer
getProducedType in interface Producer<Object,CommandContext<Object>>public final Class<Object> getConsumedType()
Consumer
getConsumedType in interface Consumer<Object>
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 void open(CommandContext<Object> consumer)
Producer
open in interface Producer<Object,CommandContext<Object>>consumer - the consumer
public final void provide(Object element)
throws IOException
Consumer
provide in interface Consumer<Object>element - the provided element
IOException
public final void flush()
throws IOException
flush in interface FlushableIOExceptionpublic final void close()
Producer
close in interface Closeableclose in interface Producer<Object,CommandContext<Object>>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 | |||||||||