Package joptsimple.util
Class PathConverter
- java.lang.Object
-
- joptsimple.util.PathConverter
-
- All Implemented Interfaces:
ValueConverter<java.nio.file.Path>
public class PathConverter extends java.lang.Object implements ValueConverter<java.nio.file.Path>
Converts command line options toPathobjects and checks the status of the underlying file.
-
-
Field Summary
Fields Modifier and Type Field Description private PathProperties[]pathProperties
-
Constructor Summary
Constructors Constructor Description PathConverter(PathProperties... pathProperties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.file.Pathconvert(java.lang.String value)Converts the given string value into a Java type.private java.lang.Stringmessage(java.lang.String errorKey, java.lang.String value)java.lang.StringvaluePattern()Gives a string that describes the pattern of the values this converter expects, if any.java.lang.Class<java.nio.file.Path>valueType()Gives the class of the type of values this converter converts to.
-
-
-
Field Detail
-
pathProperties
private final PathProperties[] pathProperties
-
-
Constructor Detail
-
PathConverter
public PathConverter(PathProperties... pathProperties)
-
-
Method Detail
-
convert
public java.nio.file.Path convert(java.lang.String value)
Description copied from interface:ValueConverterConverts the given string value into a Java type.- Specified by:
convertin interfaceValueConverter<java.nio.file.Path>- Parameters:
value- the string to convert- Returns:
- the converted value
-
valueType
public java.lang.Class<java.nio.file.Path> valueType()
Description copied from interface:ValueConverterGives the class of the type of values this converter converts to.- Specified by:
valueTypein interfaceValueConverter<java.nio.file.Path>- Returns:
- the target class for conversion
-
valuePattern
public java.lang.String valuePattern()
Description copied from interface:ValueConverterGives a string that describes the pattern of the values this converter expects, if any. For example, a date converter can respond with adate format string.- Specified by:
valuePatternin interfaceValueConverter<java.nio.file.Path>- Returns:
- a value pattern, or
nullif there's nothing interesting here
-
message
private java.lang.String message(java.lang.String errorKey, java.lang.String value)
-
-