org.jbehave.core.steps
Class ParameterConverters.NumberConverter
java.lang.Object
org.jbehave.core.steps.ParameterConverters.NumberConverter
- All Implemented Interfaces:
- ParameterConverters.ParameterConverter
- Enclosing class:
- ParameterConverters
public static class ParameterConverters.NumberConverter
- extends Object
- implements ParameterConverters.ParameterConverter
Converts values to numbers, supporting any subclass of Number
(including generic Number type), and it unboxed counterpart, using a
NumberFormat
to parse to a Number
and to convert it to a
specific number type:
If no number format is provided, it defaults to
NumberFormat#getInstance(Locale.ENGLISH)
.
The localized instance NumberFormat.getInstance(Locale)
can be
used to convert numbers in specific locales.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ParameterConverters.NumberConverter
public ParameterConverters.NumberConverter()
ParameterConverters.NumberConverter
public ParameterConverters.NumberConverter(NumberFormat numberFormat)
accept
public boolean accept(Type type)
- Specified by:
accept
in interface ParameterConverters.ParameterConverter
convertValue
public Object convertValue(String value,
Type type)
- Specified by:
convertValue
in interface ParameterConverters.ParameterConverter
Copyright © 2003-2011. All Rights Reserved.