|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgroovy.ui.GroovyMain
public class GroovyMain
A Command line to execute groovy.
Field Summary | |
---|---|
private java.util.List |
args
|
private boolean |
autoOutput
|
private boolean |
autoSplit
|
private java.lang.String |
backupExtension
|
private CompilerConfiguration |
conf
|
private boolean |
debug
|
private boolean |
editFiles
|
private boolean |
isScriptFile
|
private int |
port
|
private boolean |
processFiles
|
private boolean |
processSockets
|
private java.lang.String |
script
|
private java.lang.String |
splitPattern
|
Constructor Summary | |
---|---|
GroovyMain()
|
Method Summary | |
---|---|
private static org.apache.commons.cli.Options |
buildOptions()
Build the options parser. |
java.io.File |
huntForTheScriptFile(java.lang.String input)
Hunt for the script file, doesn't bother if it is named precisely. |
static void |
main(java.lang.String[] args)
Main CLI interface. |
private static org.apache.commons.cli.CommandLine |
parseCommandLine(org.apache.commons.cli.Options options,
java.lang.String[] args)
Parse the command line. |
private static void |
printHelp(java.io.PrintStream out,
org.apache.commons.cli.Options options)
|
private static boolean |
process(org.apache.commons.cli.CommandLine line)
Process the users request. |
(package private) static void |
processArgs(java.lang.String[] args,
java.io.PrintStream out)
|
private void |
processFile(Script s,
java.io.File file)
Process a single input file. |
private void |
processFiles()
Process the input files. |
private void |
processOnce()
Process the standard, single script with args. |
private void |
processReader(Script s,
java.io.BufferedReader reader,
java.io.PrintWriter pw)
Process a script against a single input file. |
private void |
processSockets()
Process Sockets. |
private boolean |
run()
Run the script. |
private static void |
setSystemPropertyFrom(java.lang.String nameValue)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.List args
private boolean isScriptFile
private java.lang.String script
private boolean processFiles
private boolean editFiles
private boolean autoOutput
private boolean autoSplit
private java.lang.String splitPattern
private boolean processSockets
private int port
private java.lang.String backupExtension
private boolean debug
private CompilerConfiguration conf
Constructor Detail |
---|
public GroovyMain()
Method Detail |
---|
public static void main(java.lang.String[] args)
args
- all command line args.static void processArgs(java.lang.String[] args, java.io.PrintStream out)
private static void printHelp(java.io.PrintStream out, org.apache.commons.cli.Options options)
private static org.apache.commons.cli.CommandLine parseCommandLine(org.apache.commons.cli.Options options, java.lang.String[] args) throws org.apache.commons.cli.ParseException
options
- the options parser.args
- the command line args.
org.apache.commons.cli.ParseException
- if there was a problem.private static org.apache.commons.cli.Options buildOptions()
private static void setSystemPropertyFrom(java.lang.String nameValue)
private static boolean process(org.apache.commons.cli.CommandLine line) throws org.apache.commons.cli.ParseException
line
- the parsed command line.
org.apache.commons.cli.ParseException
- if invalid options are chosenprivate boolean run()
private void processSockets() throws CompilationFailedException, java.io.IOException
CompilationFailedException
java.io.IOException
public java.io.File huntForTheScriptFile(java.lang.String input)
private void processFiles() throws CompilationFailedException, java.io.IOException
CompilationFailedException
java.io.IOException
private void processFile(Script s, java.io.File file) throws java.io.IOException
s
- the script to execute.file
- the input file.
java.io.IOException
private void processReader(Script s, java.io.BufferedReader reader, java.io.PrintWriter pw) throws java.io.IOException
s
- script to execute.reader
- input file.pw
- output sink.
java.io.IOException
private void processOnce() throws CompilationFailedException, java.io.IOException
CompilationFailedException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |