net.chaosserver.bilbo.task.validate
Class ValidateTask

java.lang.Object
  |
  +--net.chaosserver.bilbo.task.BaseTask
        |
        +--net.chaosserver.bilbo.task.RecursiveTask
              |
              +--net.chaosserver.bilbo.task.RootFirstRecursiveTask
                    |
                    +--net.chaosserver.bilbo.task.validate.ValidateTask
All Implemented Interfaces:
Task

public class ValidateTask
extends RootFirstRecursiveTask

Looks for errors and inconsistencies in the directory against the mapping file.

Since:
Bilbo 2.0

Field Summary
protected  String fromStyle
          Holds the fromStyle to validate.
protected  boolean mappingFilePresent
          Flag indicating presence of the mapping file in the directory.
protected  String toStyle
          Holds the toStyle to validate.
 
Fields inherited from class net.chaosserver.bilbo.task.BaseTask
settings
 
Constructor Summary
ValidateTask()
           
 
Method Summary
 void execute(File currentDirectory)
          Performs a bunch of validation and then spits the results to stdout.
protected  String getFromStyle()
          Getter for the fromStyle property.
protected  String getToStyle()
          Getter for the toStyle property.
 boolean isMappingFilePresent()
          Getter for the mappingFilePresent property.
 void parseTaskArguments(String argumentString)
          Parses the argument string.
protected  void setFromStyle(String fromStyle)
          Setter for the fromStyle property.
protected  void setMappingFilePresent(boolean mappingFilePresent)
          Setter for the mappingFilePresent property.
protected  void setToStyle(String toStyle)
          Setter for the toStyle property.
 
Methods inherited from class net.chaosserver.bilbo.task.RootFirstRecursiveTask
executeRecursive
 
Methods inherited from class net.chaosserver.bilbo.task.RecursiveTask
executeSpecific, isRootDirectory
 
Methods inherited from class net.chaosserver.bilbo.task.BaseTask
execute, getHelpResource, getSettings, printHelp, setSettings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mappingFilePresent

protected boolean mappingFilePresent
Flag indicating presence of the mapping file in the directory.


fromStyle

protected String fromStyle
Holds the fromStyle to validate.


toStyle

protected String toStyle
Holds the toStyle to validate.

Constructor Detail

ValidateTask

public ValidateTask()
Method Detail

setFromStyle

protected void setFromStyle(String fromStyle)
Setter for the fromStyle property.

Parameters:
fromStyle - the fromStyle property

getFromStyle

protected String getFromStyle()
Getter for the fromStyle property.

Returns:
fromStyle property

setToStyle

protected void setToStyle(String toStyle)
Setter for the toStyle property.

Parameters:
toStyle - the toStyle property

getToStyle

protected String getToStyle()
Getter for the toStyle property.

Returns:
the toStyle property

setMappingFilePresent

protected void setMappingFilePresent(boolean mappingFilePresent)
Setter for the mappingFilePresent property.

Parameters:
mappingFilePresent - the mappingFilePresent property

isMappingFilePresent

public boolean isMappingFilePresent()
Getter for the mappingFilePresent property.

Returns:
the mappingFilePresent property

parseTaskArguments

public void parseTaskArguments(String argumentString)
                        throws BadTaskCommandArgumentsException
Parses the argument string. Valid arguments are fromstyle tostyle.

Specified by:
parseTaskArguments in interface Task
Overrides:
parseTaskArguments in class BaseTask
Parameters:
argumentString - the string to parse
Throws:
BadTaskCommandArgumentsException - if the arguments do not match expected.

execute

public void execute(File currentDirectory)
             throws ValidateException
Performs a bunch of validation and then spits the results to stdout.

Specified by:
execute in class RecursiveTask
Parameters:
currentDirectory - the directory to validate
Throws:
ValidateException - if there is an error validating


Copyright © 20030415