Command using annotation to define itself. It is highly recommended
to extend this class when implementing a command.
It defines two hidden Options to create system properties (-Dkey=value) and a way to
configure the current working directory.
| Modifier and Type | Field and Description |
|---|---|
| private File | |
| protected ExecutionContext | executionContext
The execution context of the command. |
| protected PrintStream | out
The |
| protected List |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| public File | Returns: the configure current working directory. If not set use the "regular" Java current working directory.
|
| public PrintStream | |
| public void | |
| public void | setSystemProps(List<String>
the properties props)Gets system properties passed in the user command line. |
| public void | setUp(ExecutionContext
the context ec)Implements io. Set up the command execution environment. |
| public void |
| cwd | back to summary |
|---|---|
| private File cwd | |
| executionContext | back to summary |
|---|---|
| protected ExecutionContext executionContext The execution context of the command. | |
| out | back to summary |
|---|---|
| protected PrintStream out The | |
| systemProperties | back to summary |
|---|---|
| protected List<String> systemProperties | |
| DefaultCommand | back to summary |
|---|---|
| public DefaultCommand() | |
| applySystemProperties | back to summary |
|---|---|
| protected void applySystemProperties() Sets the system properties specified by the user command line. | |
| getCwd | back to summary |
|---|---|
public File getCwd()
| |
| out | back to summary |
|---|---|
public PrintStream out()
| |
| setCwd | back to summary |
|---|---|
| public void setCwd(File cwd) Sets the current working directory. This method is called when the user configure the "cwd" option as
follows:
| |
| setSystemProps | back to summary |
|---|---|
| public void setSystemProps(List<String> props) Gets system properties passed in the user command line. The user can configure system properties using
| |
| setUp | back to summary |
|---|---|
| public void setUp(ExecutionContext ec) throws CLIException Implements io. Doc from io. Set up the command execution environment. The command line model has been retrieved and is frozen. Values has been set / injected. You can use this callback to validate the inputs.
| |
| tearDown | back to summary |
|---|---|
| public void tearDown() throws CLIException Implements io. Doc from io. The command has been executed. Use this method to cleanup the environment.
| |