2.17.2: 2011-06-17

net.sf.basedb.core
Class PathParameterType

java.lang.Object
  extended by net.sf.basedb.core.ParameterType<String>
      extended by net.sf.basedb.core.PathParameterType

public class PathParameterType
extends ParameterType<String>

This class represent a parameter type that is a path to either a directory or a file. This parameter type should be used when a plugin needs to ask for a directory or file to save it's output.

Version:
2.0
Author:
Nicklas
Last modified
$Date: 2010-10-01 13:51:57 +0200 (Fri, 01 Oct 2010) $

Field Summary
private  Path.Type pathType
           
 
Constructor Summary
PathParameterType(Path.Type pathType)
          Create a new optional path parameter type.
PathParameterType(Path.Type pathType, String defaultValue, boolean notNull)
          Create a new path parameter type.
PathParameterType(Path.Type pathType, String defaultValue, boolean notNull, int multiplicity, int width, int height, List<String> items)
           
 
Method Summary
 Path.Type getPathType()
          Get the type of the path to ask for.
(package private)  ParameterValueData<String> newParameterValueData()
          Create a new TextParameterValueData object.
 String toString()
           
(package private)  void validateValue(String name, String value)
          Checks if the value is a valif Path value.
 
Methods inherited from class net.sf.basedb.core.ParameterType
getDefaultValue, getEnumeration, getHeight, getItems, getMultiplicity, getNotNull, getParameterClass, getValueType, getWidth, isEnumeration, validate, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pathType

private final Path.Type pathType
Constructor Detail

PathParameterType

public PathParameterType(Path.Type pathType)
Create a new optional path parameter type.

Parameters:
pathType - If the path is to a directory or file

PathParameterType

public PathParameterType(Path.Type pathType,
                         String defaultValue,
                         boolean notNull)
Create a new path parameter type.

Parameters:
pathType - If the path is to a directory or file
defaultValue - The default value of this parameter
notNull - FALSE if nulls values are allowed, TRUE otherwise

PathParameterType

public PathParameterType(Path.Type pathType,
                         String defaultValue,
                         boolean notNull,
                         int multiplicity,
                         int width,
                         int height,
                         List<String> items)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

validateValue

void validateValue(String name,
                   String value)
             throws InvalidDataException
Checks if the value is a valif Path value.

Specified by:
validateValue in class ParameterType<String>
Parameters:
value - The value to test
name - The name of the parameter, use the name if there is need to throw an exception
Throws:
InvalidDataException - If the value is not a valid path

newParameterValueData

ParameterValueData<String> newParameterValueData()
Create a new TextParameterValueData object.

Specified by:
newParameterValueData in class ParameterType<String>

getPathType

public Path.Type getPathType()
Get the type of the path to ask for.

Returns:
A Path.Type object

2.17.2: 2011-06-17