Package net.sf.basedb.core
Class PathParameterType
- java.lang.Object
-
- net.sf.basedb.core.ParameterType<String>
-
- 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: 2012-09-14 09:28:35 +0200 (fr, 14 sep 2012) $
-
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Path.Type
getPathType()
Get the type of the path to ask for.(package private) ParameterValueData<String>
newParameterValueData()
Create a newTextParameterValueData
object.String
toString()
(package private) void
validateValue(String name, String value)
Checks if the value is a valifPath
value.-
Methods inherited from class net.sf.basedb.core.ParameterType
getDefaultValue, getEnumeration, getHeight, getItems, getMultiplicity, getNotNull, getParameterClass, getValueType, getWidth, isEnumeration, isMasked, validate, validate
-
-
-
-
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 filedefaultValue
- The default value of this parameternotNull
- FALSE if nulls values are allowed, TRUE otherwise
-
-
Method Detail
-
validateValue
void validateValue(String name, String value) throws InvalidDataException
Checks if the value is a valifPath
value.- Specified by:
validateValue
in classParameterType<String>
- Parameters:
value
- The value to testname
- 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 newTextParameterValueData
object.- Specified by:
newParameterValueData
in classParameterType<String>
-
getPathType
public Path.Type getPathType()
Get the type of the path to ask for.- Returns:
- A
Path.Type
object
-
-