Class EnablerConverter
- java.lang.Object
-
- net.sf.jguiraffe.gui.builder.enablers.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 itsconvert(Class, Object)
method it expects a string representation of anElementEnabler
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 resultingElementEnabler
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 Summary
Constructors Constructor Description EnablerConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
convert(Class type, Object value)
Performs the type conversion.
-
-
-
Method Detail
-
convert
public Object convert(Class type, Object value)
Performs the type conversion. This implementation usesEnablerBuilder
to create anElementEnabler
implementation from the string representation of the passed in object. For null values, or if the conversion fails, aConversionException
is thrown.- Specified by:
convert
in interfaceorg.apache.commons.beanutils.Converter
- Parameters:
type
- the target class of the conversionvalue
- the object to be converted- Returns:
- the converted object
- Throws:
org.apache.commons.beanutils.ConversionException
- if conversion is not possible
-
-