public abstract class Tool extends Object
| Modifier and Type | Field and Description |
|---|---|
protected PrintStream |
stderr |
protected PrintStream |
stdout |
protected boolean |
verbose |
| Constructor and Description |
|---|
Tool() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
exit(int exitCode)
Exits the tool.
|
protected void |
exit(String reason)
Exits the tool with a reason
|
protected void |
exit(String reason,
Exception e)
Exits the tool with a reason and exception
|
protected void |
parseArgs(String[] args)
Parses the tool' arguments
|
void |
run(String[] args)
Runs the tool's logic for given parameters
|
protected PrintStream stderr
protected PrintStream stdout
protected boolean verbose
protected void parseArgs(String[] args)
args - Arguments to parse.protected void exit(int exitCode)
exitCode - Code to exit with. 0 for success, non-zero for failure.protected void exit(String reason)
reason - Reason for exit (may be null).e - Exception to exit with.protected void exit(String reason, Exception e)
reason - Reason for exit (may be null).e - Exception to exit with.public void run(String[] args)
args - Arguments to the toolbox.Copyright © 2015. All rights reserved.