Class EnablerConverter

  • All Implemented Interfaces:
    org.apache.commons.beanutils.Converter

    public class EnablerConverter
    extends Object
    implements org.apache.commons.beanutils.Converter

    A specialized converter implementation for ElementEnabler objects.

    This converter class is a thin wrapper around the EnablerBuilder class. In its convert(Class, Object) method it expects a string representation of an ElementEnabler which is compatible with the specifications understood by the builder. It passes this string to the builder and uses it to create the enabler. The resulting ElementEnabler is returned.

    Implementation note: This class is stateless; therefore an instance can be shared between multiple components and invoked concurrently.

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

      • EnablerConverter

        public EnablerConverter()
    • Method Detail

      • convert

        public Object convert​(Class type,
                              Object value)
        Performs the type conversion. This implementation uses EnablerBuilder to create an ElementEnabler implementation from the string representation of the passed in object. For null values, or if the conversion fails, a ConversionException is thrown.
        Specified by:
        convert in interface org.apache.commons.beanutils.Converter
        Parameters:
        type - the target class of the conversion
        value - the object to be converted
        Returns:
        the converted object
        Throws:
        org.apache.commons.beanutils.ConversionException - if conversion is not possible