org.omnaest.utils.beans
Class MapToTypeAdapter<T,M extends Map<Object,Object>>

java.lang.Object
  extended by org.omnaest.utils.beans.MapToTypeAdapter<T,M>
Type Parameters:
T -
M -

public class MapToTypeAdapter<T,M extends Map<Object,Object>>
extends Object

This class creates a proxy implementation for a given class or interface type which is used as a facade to an underlying Map<String,?>.

Author:
Omnaest
See Also:
newInstance(Map, Class), TypeToPropertynameMapAdapter

Nested Class Summary
protected  class MapToTypeAdapter.ClassAdapterMethodInterceptor
          A MethodInterceptor implementation special for this MapToTypeAdapter
static interface MapToTypeAdapter.UnderlyingMapAware<M extends Map<String,Object>>
          This interface makes a derivative type aware of an underlying map implementation.
 
Field Summary
protected  T classAdapter
           
protected  boolean hasAccessToUnderlyingMap
           
protected  Map<Object,Object> map
           
 
Constructor Summary
protected MapToTypeAdapter()
           
protected MapToTypeAdapter(M map, Class<? extends T> clazz, boolean underlyingMapAware)
          Internal constructor.
 
Method Summary
protected  void initializeClassAdapter(Class<? extends T> clazz, boolean underlyingMapAware)
          Creates the stub
static
<T> T
newInstance(Map<? super String,Object> map, Class<? extends T> clazz)
          Factory methods to create a new MapToTypeAdapter for a given Map with the given Class as facade.
static
<T> T
newInstance(Map<? super String,Object> map, Class<? extends T> clazz, boolean underlyingMapAware)
          Factory methods to create a new MapToTypeAdapter for a given Map with the given Class as facade.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

protected Map<Object,Object> map

classAdapter

protected T classAdapter

hasAccessToUnderlyingMap

protected boolean hasAccessToUnderlyingMap
Constructor Detail

MapToTypeAdapter

protected MapToTypeAdapter()
See Also:
newInstance(Map, Class)

MapToTypeAdapter

protected MapToTypeAdapter(M map,
                           Class<? extends T> clazz,
                           boolean underlyingMapAware)
Internal constructor. See newInstance(Map, Class) instead.

Parameters:
map -
clazz -
underlyingMapAware -
Method Detail

newInstance

public static <T> T newInstance(Map<? super String,Object> map,
                                Class<? extends T> clazz,
                                boolean underlyingMapAware)
Factory methods to create a new MapToTypeAdapter for a given Map with the given Class as facade.

Parameters:
map -
clazz -
underlyingMapAware - : true > returned stub implements MapToTypeAdapter.UnderlyingMapAware
Returns:
new
See Also:
newInstance(Map, Class)

newInstance

public static <T> T newInstance(Map<? super String,Object> map,
                                Class<? extends T> clazz)
Factory methods to create a new MapToTypeAdapter for a given Map with the given Class as facade.

Parameters:
map -
clazz -
Returns:
new
See Also:
newInstance(Map, Class, boolean)

initializeClassAdapter

protected void initializeClassAdapter(Class<? extends T> clazz,
                                      boolean underlyingMapAware)
Creates the stub

Parameters:
clazz -
underlyingMapAware -


Copyright © 2011. All Rights Reserved.