net.sf.mmm.util.cli.base
Class CliState.CliArgumentFormatter
java.lang.Object
net.sf.mmm.util.cli.base.CliState.CliArgumentFormatter
- All Implemented Interfaces:
- SimpleValueConverter<CliArgumentContainer,String>
- Enclosing class:
- CliState
protected static final class CliState.CliArgumentFormatter
- extends Object
- implements SimpleValueConverter<CliArgumentContainer,String>
This inner class converts a CliArgumentContainer to a
String.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INSTANCE
protected static final CliState.CliArgumentFormatter INSTANCE
- The singleton instance.
CliState.CliArgumentFormatter
protected CliState.CliArgumentFormatter()
convert
public String convert(CliArgumentContainer value,
Object valueSource,
Class<? extends String> targetClass)
throws ValueException
- This method converts the given
pojo to the
<TARGET>-type.
- Specified by:
convert in interface SimpleValueConverter<CliArgumentContainer,String>
- Parameters:
value - is the value to convert.valueSource - describes the source of the value. This may be the
filename where the value was read from, an XPath where the value was
located in an XML document, etc. It is used in exceptions thrown if
something goes wrong. This will help to find the problem easier.targetClass - is the type to convert the value to.
- Returns:
- the converted
value or null if the
conversion is NOT possible. The returned value has to be an
instance of the given
targetType.
- Throws:
ValueException - if the conversion failed (e.g. the given
value is illegal for the given
targetClass).
Copyright © 2001-2010 mmm-Team. All Rights Reserved.