PropertyConverterpublic final class DefaultConverter extends Object implements PropertyConverter
<type>(String)) if found,
otherwise, an attempt to call
the class' static valueOf(String) method. If both fails, a
ConversionException is thrown.| Constructor | Description |
|---|---|
DefaultConverter() |
Creates a
DefaultConverter. |
| Modifier and Type | Method | Description |
|---|---|---|
Object |
toObject(String pString,
Class pType,
String pFormat) |
Converts the string to an object of the given type.
|
String |
toString(Object pObject,
String pFormat) |
Converts the object to a string, using
pObject.toString(). |
public Object toObject(String pString, Class pType, String pFormat) throws ConversionException
toObject in interface PropertyConverterpString - the string to convertpType - the type to convert topFormat - ignored.ConversionException - if the type is null, or if the string cannot
be converted into the given type, using a string constructor or static
valueOf method.public String toString(Object pObject, String pFormat) throws ConversionException
pObject.toString().toString in interface PropertyConverterpObject - the object to convert.pFormat - ignored.null if pObject == nullConversionException - if the string could not be converted to the
specified type and format.Copyright © 2018. All rights reserved.