|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovy.lang.GroovyObjectSupport groovy.lang.Script org.crsh.command.GroovyScriptCommand
public abstract class GroovyScriptCommand
Field Summary | |
---|---|
private String[] |
args . |
protected InvocationContext |
context The current context. |
protected RenderPrintWriter |
out The current output. |
private boolean |
piped . |
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
private boolean piped
Constructor Detail |
---|
protected GroovyScriptCommand()
Method Detail |
---|
public final void pushContext(InvocationContext<?> context) throws NullPointerException
NullPointerException
public final InvocationContext<?> popContext()
public final void execute(String s) throws ScriptException, IOException
ScriptException
IOException
public 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.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 CompletionMatch complete(RuntimeContext context, String line)
ShellCommand
complete
in interface ShellCommand
context
- the command contextline
- the original command line argumentspublic final String describe(String line, DescriptionFormat mode)
ShellCommand
describe
in interface ShellCommand
line
- the usage linemode
- the description modepublic final void open(CommandContext<Object> consumer)
Producer
open
in interface Producer<Object,CommandContext<Object>>
consumer
- the consumerpublic final void provide(Object element) throws IOException
Consumer
provide
in interface Consumer<Object>
element
- the provided elementIOException
public final void flush() throws IOException
flush
in interface Flushable
IOException
public final void close()
Producer
close
in interface Closeable
close
in interface Producer<Object,CommandContext<Object>>
public final CommandInvoker<?,?> resolveInvoker(String line)
ShellCommand
resolveInvoker
in interface ShellCommand
line
- the command line argumentspublic final CommandInvoker<?,?> resolveInvoker(String name, Map<String,?> options, List<?> args)
ShellCommand
resolveInvoker
in interface ShellCommand
name
- 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 |