Class PointConverter
java.lang.Object
org.apache.commons.beanutils2.converters.AbstractConverter<Point>
org.apache.commons.beanutils2.converters.PointConverter
- Since:
- 2.0.0
-
Constructor Summary
ConstructorDescriptionConstruct aPoint
Converter that throws aConversionException
if an error occurs.PointConverter
(Point defaultValue) Constructs aConverter
that will return the specified default value if a conversion error occurs. -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> T
convertToType
(Class<T> type, Object value) Converts the specified input object into an output object of the specified type.Gets the default type thisConverter
handles.Methods inherited from class org.apache.commons.beanutils2.converters.AbstractConverter
conversionException, convert, convertArray, convertToString, getDefault, handleError, handleMissing, isUseDefault, setDefaultValue, toLowerCase, toString, toString, toTrim
-
Constructor Details
-
PointConverter
public PointConverter()Construct aPoint
Converter that throws aConversionException
if an error occurs. -
PointConverter
Constructs aConverter
that will return the specified default value if a conversion error occurs.- Parameters:
defaultValue
- The default value to be returned if the value to be converted is missing or an error occurs converting the value.
-
-
Method Details
-
convertToType
Converts the specified input object into an output object of the specified type.- Specified by:
convertToType
in classAbstractConverter<Point>
- Type Parameters:
T
- Target type of the conversion.- Parameters:
type
- Data type to which this value should be converted.value
- TheString
property value to convert.- Returns:
- A
Point
represented by the x and y coordinate of the input. - Throws:
NullPointerException
- If the value is null.IllegalArgumentException
- If the configuration value is an invalid representation of aPoint
.NumberFormatException
- If a one of coordinates cannot be parsed to anInteger
.Throwable
- if an error occurs converting to the specified type
-
getDefaultType
Gets the default type thisConverter
handles.- Specified by:
getDefaultType
in classAbstractConverter<Point>
- Returns:
- The default type this
Converter
handles. - Since:
- 2.0.0
-