com.lexicalscope.fluentreflection.bean
Class BeanMap

java.lang.Object
  extended by com.lexicalscope.fluentreflection.bean.BeanMap

public class BeanMap
extends Object

Create a map by reflecting on bean properties If you do not need the configurability of this class, consider using net.sf.cglib.beans.BeanMap instead for performance reasons.

Author:
Tim Wood

Nested Class Summary
static interface BeanMap.KeySetCalculation
           
static interface BeanMap.PropertyNameConvertor
           
 
Constructor Summary
BeanMap()
           
 
Method Summary
static BeanMap.KeySetCalculation allProperties()
           
static BeanMap.KeySetCalculation allReadableProperties()
           
static BeanMap.KeySetCalculation allWriteableProperties()
           
static BeanMapBuilder beanMap()
           
static BeanMap.PropertyNameConvertor lowercasePropertyName()
           
static Map<String,Object> map(Object bean)
          A map of the properties in the bean.
static BeanMap.KeySetCalculation onlyReadWriteProperties()
           
static BeanMap.KeySetCalculation readablePropertiesOnly()
           
static BeanMap.KeySetCalculation writeablePropertiesOnly()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanMap

public BeanMap()
Method Detail

map

public static Map<String,Object> map(Object bean)
A map of the properties in the bean. Putting values into the map will update the underlying bean. Getting write only properties will return null. Setting read only properties is ignored. Removing keys from the map (or any operation that implies removing one or more keys) is not supported.

Parameters:
bean - the bean to expose as a map
Returns:
the bean wrapped in a map

beanMap

public static BeanMapBuilder beanMap()

onlyReadWriteProperties

public static BeanMap.KeySetCalculation onlyReadWriteProperties()

allReadableProperties

public static BeanMap.KeySetCalculation allReadableProperties()

allWriteableProperties

public static BeanMap.KeySetCalculation allWriteableProperties()

writeablePropertiesOnly

public static BeanMap.KeySetCalculation writeablePropertiesOnly()

readablePropertiesOnly

public static BeanMap.KeySetCalculation readablePropertiesOnly()

allProperties

public static BeanMap.KeySetCalculation allProperties()

lowercasePropertyName

public static BeanMap.PropertyNameConvertor lowercasePropertyName()


Copyright © 2011-2012 lexicalscope. All Rights Reserved.