com.chaosserver.bilbo.task.generate
Class GenerateTask

java.lang.Object
  |
  +--com.chaosserver.bilbo.task.BaseTask
        |
        +--com.chaosserver.bilbo.task.generate.GenerateTask
All Implemented Interfaces:
Task

public class GenerateTask
extends BaseTask

Generates mappings files.

Since:
Bilbo 2.0

Field Summary
protected  int errorLevel
          Holds the error response if an error is encountered.
protected  Collection mappings
          Holds the mapping names to generate for each file.
 
Fields inherited from class com.chaosserver.bilbo.task.BaseTask
DEFAULT_HELP, settings
 
Constructor Summary
GenerateTask()
          Default constructor.
 
Method Summary
 void execute(File currentDirectory)
          Iterators through each file in the directory and generates a mapping for each mapping passed in through the arguments.
protected  int getErrorLevel()
          Getter for the error level
protected  void parseFlags(String flags)
          Parses the flag portion of the task arguments.
protected  void parseMappingString(String mappingsString)
          Parses the mapping portion of the task arguments.
 void parseTaskArguments(String argumentString)
          Parses the task specific argument string.
protected  void setErrorLevel(int errorLevel)
          Setter for the error level
 
Methods inherited from class com.chaosserver.bilbo.task.BaseTask
execute, executeRecursive, getHelpResource, getSettings, printHelp, setSettings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

errorLevel

protected int errorLevel
Holds the error response if an error is encountered.


mappings

protected Collection mappings
Holds the mapping names to generate for each file.

Constructor Detail

GenerateTask

public GenerateTask()
Default constructor.

Method Detail

setErrorLevel

protected void setErrorLevel(int errorLevel)
Setter for the error level

Parameters:
errorLevel - the error level

getErrorLevel

protected int getErrorLevel()
Getter for the error level

Returns:
the error level

parseTaskArguments

public void parseTaskArguments(String argumentString)
                        throws BadTaskCommandArgumentsException
Description copied from interface: Task
Parses the task specific argument string.

Parameters:
argumentString - the task specific argument string
Throws:
BadTaskCommandArgumentsException - if the argument string is invalid

parseFlags

protected void parseFlags(String flags)
Parses the flag portion of the task arguments.

Parameters:
flags - the flag portion of the task arguments

parseMappingString

protected void parseMappingString(String mappingsString)
                           throws BadTaskCommandArgumentsException
Parses the mapping portion of the task arguments.

Parameters:
mappingsString - the mapping portion of the task arguments
Throws:
BadTaskCommandArgumentsException - if there is an error with the arguments provided

execute

public void execute(File currentDirectory)
             throws GenerateException
Iterators through each file in the directory and generates a mapping for each mapping passed in through the arguments.

Specified by:
execute in class BaseTask
Parameters:
currentDirectory - the directory to process
Throws:
GenerateException - if there is an error generating


Copyright © 20020228