Package joptsimple.internal
Class MethodInvokingValueConverter<V>
- java.lang.Object
-
- joptsimple.internal.MethodInvokingValueConverter<V>
-
- Type Parameters:
V- constraint on the type of values being converted to
- All Implemented Interfaces:
ValueConverter<V>
class MethodInvokingValueConverter<V> extends java.lang.Object implements ValueConverter<V>
-
-
Constructor Summary
Constructors Constructor Description MethodInvokingValueConverter(java.lang.reflect.Method method, java.lang.Class<V> clazz)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Vconvert(java.lang.String value)Converts the given string value into a Java type.java.lang.StringvaluePattern()Gives a string that describes the pattern of the values this converter expects, if any.java.lang.Class<V>valueType()Gives the class of the type of values this converter converts to.
-
-
-
Field Detail
-
method
private final java.lang.reflect.Method method
-
clazz
private final java.lang.Class<V> clazz
-
-
Constructor Detail
-
MethodInvokingValueConverter
MethodInvokingValueConverter(java.lang.reflect.Method method, java.lang.Class<V> clazz)
-
-
Method Detail
-
convert
public V convert(java.lang.String value)
Description copied from interface:ValueConverterConverts the given string value into a Java type.- Specified by:
convertin interfaceValueConverter<V>- Parameters:
value- the string to convert- Returns:
- the converted value
-
valueType
public java.lang.Class<V> valueType()
Description copied from interface:ValueConverterGives the class of the type of values this converter converts to.- Specified by:
valueTypein interfaceValueConverter<V>- 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<V>- Returns:
- a value pattern, or
nullif there's nothing interesting here
-
-