org.databene.commons.converter
Class PropertyExtractor<B,P>

java.lang.Object
  extended by org.databene.commons.converter.AbstractConverter<S,T>
      extended by org.databene.commons.converter.ThreadSafeConverter<B,P>
          extended by org.databene.commons.converter.PropertyExtractor<B,P>
All Implemented Interfaces:
java.lang.Cloneable, Converter<B,P>, ThreadAware

public class PropertyExtractor<B,P>
extends ThreadSafeConverter<B,P>

Converter implementation that reads a property form a JavaBean.

Created at 15.07.2009 23:19:18

Since:
0.5.0
Author:
Volker Bergmann

Field Summary
 
Fields inherited from class org.databene.commons.converter.AbstractConverter
sourceType, targetType
 
Constructor Summary
PropertyExtractor(java.lang.Class<B> beanType, java.lang.String propertyName, java.lang.Class<P> targetType)
           
 
Method Summary
 P convert(B sourceValue)
          Concerts an object of type S to an object of type T
 
Methods inherited from class org.databene.commons.converter.ThreadSafeConverter
clone, isParallelizable, isThreadSafe
 
Methods inherited from class org.databene.commons.converter.AbstractConverter
getSourceType, getTargetType
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyExtractor

public PropertyExtractor(java.lang.Class<B> beanType,
                         java.lang.String propertyName,
                         java.lang.Class<P> targetType)
Method Detail

convert

public P convert(B sourceValue)
          throws ConversionException
Description copied from interface: Converter
Concerts an object of type S to an object of type T

Parameters:
sourceValue - the object to convert
Returns:
the converted object
Throws:
ConversionException - if the conversion fails


Copyright © 2010. All Rights Reserved.