Class DoubleTransformer

  • All Implemented Interfaces:
    Transformer, Validator

    public final class DoubleTransformer
    extends AbstractDecimalTransformer<Double>

    A specialized number transformer implementation that deals with numbers of type java.lang.Double.

    This class implements the abstract methods defined by its super classes in a way suitable for java.lang.Double objects. It does not define any new properties or error messages. Refer to the documentation of NumberTransformerBase for a list of all supported properties and possible error messages.

    Version:
    $Id: DoubleTransformer.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Constructor Detail

      • DoubleTransformer

        public DoubleTransformer()
    • Method Detail

      • convert

        protected Double convert​(Number n)
        Converts the specified number into a java.lang.Double. A range check will be performed.
        Specified by:
        convert in class NumberTransformerBase<Double>
        Parameters:
        n - the number to be converted
        Returns:
        the converted number
        Throws:
        IllegalArgumentException - if the number cannot be converted into a Double
      • fetchProperty

        protected Double fetchProperty​(org.apache.commons.configuration.Configuration config,
                                       String property,
                                       Double defaultValue)
        Returns a configuration property of type Double.
        Specified by:
        fetchProperty in class NumberTransformerBase<Double>
        Parameters:
        config - the configuration
        property - the property
        defaultValue - the default value
        Returns:
        the value of the property