org.cojen.util
Class BeanPropertyMapFactory<B>

java.lang.Object
  extended by org.cojen.util.BeanPropertyMapFactory<B>

public abstract class BeanPropertyMapFactory<B>
extends Object

Provides a simple and efficient means of reading and writing bean properties via a map. Properties which declare throwing checked exceptions are excluded as are properties which are read-only or write-only.

Since:
2.1
Author:
Brian S O'Neill
See Also:
BeanPropertyAccessor

Constructor Summary
BeanPropertyMapFactory()
           
 
Method Summary
static SortedMap<String,Object> asMap(Object bean)
          Returns a fixed-size map backed by the given bean.
abstract  SortedMap<String,Object> createMap(B bean)
          Returns a fixed-size map backed by the given bean.
static
<B> BeanPropertyMapFactory<B>
forClass(Class<B> clazz)
          Returns a new or cached BeanPropertyMapFactory for the given class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanPropertyMapFactory

public BeanPropertyMapFactory()
Method Detail

forClass

public static <B> BeanPropertyMapFactory<B> forClass(Class<B> clazz)
Returns a new or cached BeanPropertyMapFactory for the given class.


asMap

public static SortedMap<String,Object> asMap(Object bean)
Returns a fixed-size map backed by the given bean. Map remove operations are unsupported, as is access to excluded properties.

Throws:
IllegalArgumentException - if bean is null

createMap

public abstract SortedMap<String,Object> createMap(B bean)
Returns a fixed-size map backed by the given bean. Map remove operations are unsupported, as are put operations on non-existent properties.

Throws:
IllegalArgumentException - if bean is null


Copyright © 2004-2008 Brian S O'Neill. All Rights Reserved.