|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.chaosserver.bilbo.task.BaseTask
Base task that provides the template design pattern for concrete implementations.
Field Summary | |
protected Settings |
settings
Holds the settings object. |
Constructor Summary | |
BaseTask()
|
Method Summary | |
void |
execute()
Main task method. |
protected abstract void |
executeSpecific()
Abstract implementation. |
protected String |
getHelpResource()
Gets the help resource location. |
protected Settings |
getSettings()
Getter for the settings object. |
void |
parseTaskArguments(String argumentString)
Empty implementation |
void |
printHelp()
Prints the usage notes out for the concrete task. |
void |
setSettings(Settings settings)
Setter for the settings object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Settings settings
Constructor Detail |
public BaseTask()
Method Detail |
public void setSettings(Settings settings)
setSettings
in interface Task
settings
- the settings objectprotected Settings getSettings()
public void execute() throws TaskException
printHelp
or
executeSpecific
.
execute
in interface Task
TaskException
- indicates generic errorpublic void parseTaskArguments(String argumentString) throws BadTaskCommandArgumentsException
parseTaskArguments
in interface Task
argumentString
- the task specific argument string
BadTaskCommandArgumentsException
- if the argument string
is invalidprotected abstract void executeSpecific() throws TaskException
TaskException
- indicates a generic errorpublic void printHelp() throws TaskException
The concrete task should place it's usage notes in a file
named help.txt
inside its package. If
no file is found, then the default usage notes will be
displayed.
TaskException
- if there is an error printing
the usage notesprotected String getHelpResource()
This appends "help.txt" to the package location.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |