Class DimensionConverter
java.lang.Object
org.apache.commons.beanutils2.converters.AbstractConverter<Dimension>
org.apache.commons.beanutils2.converters.DimensionConverter
Converter implementation that handles conversion to and from Dimension.
 
 Accepts a single Integer value, or two Integer values separated by the character x.
 
 The dimensions must consist of non-negative Integer values only.
 
- Since:
- 2.0.0
- 
Constructor SummaryConstructorsConstructorDescriptionConstruct aDimensionConverter that throws aConversionExceptionif an error occurs.DimensionConverter(Dimension defaultValue) Constructs aConverterthat will return the specified default value if a conversion error occurs.
- 
Method SummaryModifier and TypeMethodDescriptionprotected <T> TconvertToType(Class<T> type, Object value) Converts the input object into an output object of the specified type.Gets the default type thisConverterhandles.Methods inherited from class org.apache.commons.beanutils2.converters.AbstractConverterconversionException, convert, convertArray, convertToString, getDefault, handleError, handleMissing, isUseDefault, setDefaultValue, toLowerCase, toString, toString, toTrim
- 
Constructor Details- 
DimensionConverterpublic DimensionConverter()Construct aDimensionConverter that throws aConversionExceptionif an error occurs.
- 
DimensionConverterConstructs aConverterthat 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- 
convertToTypeConverts the input object into an output object of the specified type.- Specified by:
- convertToTypein class- AbstractConverter<Dimension>
- Type Parameters:
- T- Target type of the conversion.
- Parameters:
- type- Data type to which this value should be converted.
- value- String property value to convert.
- Returns:
- A Dimensionwhich represents the configuration property value.
- Throws:
- NullPointerException- If the value is null.
- NumberFormatException- If the- Dimensionwidth or height is bigger than- Integer.MAX_VALUE.
- Throwable- if an error occurs converting to the specified type
 
- 
getDefaultTypeGets the default type thisConverterhandles.- Specified by:
- getDefaultTypein class- AbstractConverter<Dimension>
- Returns:
- The default type this Converterhandles.
- Since:
- 2.0.0
 
 
-