Top Description Fields Constructors Methods
joptsimple.util

public Class PathConverter

extends Object
implements ValueConverter<Path>
Class Inheritance
All Implemented Interfaces
joptsimple.ValueConverter
Imports
java.nio.file.Path, .Paths, java.text.MessageFormat, java.util.ResourceBundle, joptsimple.ValueConversionException, .ValueConverter

Converts command line options to Path objects and checks the status of the underlying file.

Field Summary

Modifier and TypeField and Description
private final PathProperties[]

Constructor Summary

AccessConstructor and Description
public
PathConverter(PathProperties... pathProperties)

Method Summary

Modifier and TypeMethod and Description
public Path
convert(String
the string to convert
value
)

Implements joptsimple.ValueConverter.convert.

Converts the given string value into a Java type.
private String
message(String errorKey, String value)

public String
valuePattern()

Implements joptsimple.ValueConverter.valuePattern.

Gives a string that describes the pattern of the values this converter expects, if any.
public Class<Path>
valueType()

Implements joptsimple.ValueConverter.valueType.

Gives the class of the type of values this converter converts to.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

pathPropertiesback to summary
private final PathProperties[] pathProperties

Constructor Detail

PathConverterback to summary
public PathConverter(PathProperties... pathProperties)

Method Detail

convertback to summary
public Path convert(String value)

Implements joptsimple.ValueConverter.convert.

Doc from joptsimple.ValueConverter.convert.

Converts the given string value into a Java type.

Parameters
value:String

the string to convert

Returns:Path

the converted value

Annotations
@Override
messageback to summary
private String message(String errorKey, String value)
valuePatternback to summary
public String valuePattern()

Implements joptsimple.ValueConverter.valuePattern.

Doc from joptsimple.ValueConverter.valuePattern.

Gives a string that describes the pattern of the values this converter expects, if any. For example, a date converter can respond with a date format string.

Returns:String

a value pattern, or null if there's nothing interesting here

Annotations
@Override
valueTypeback to summary
public Class<Path> valueType()

Implements joptsimple.ValueConverter.valueType.

Doc from joptsimple.ValueConverter.valueType.

Gives the class of the type of values this converter converts to.

Returns:Class<Path>

the target class for conversion

Annotations
@Override