net.sf.morph.context.contexts
Class ReflectorHierarchicalContext

java.lang.Object
  extended by net.sf.morph.context.contexts.BaseContext
      extended by net.sf.morph.context.contexts.BaseHierarchicalContext
          extended by net.sf.morph.context.contexts.ReflectorHierarchicalContext
All Implemented Interfaces:
java.util.Map, Context, DecoratedContext, DelegatingContext, HierarchicalContext
Direct Known Subclasses:
HttpServletContext, JspContext, MapContext

public class ReflectorHierarchicalContext
extends BaseHierarchicalContext
implements HierarchicalContext, DelegatingContext

A context that delegates property storage to some delegate and uses BeanReflectors to manipulate the information in the delegate. By default this class uses the SimpleDelegatingReflector, so contexts can be created out of any type for which the reflector can expose a BeanReflector.

Since:
Nov 21, 2004
Author:
Matt Sgarlata
See Also:
net.sf.morph.context.support.SimpleReflectorContext, HierarchicalContext

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
ReflectorHierarchicalContext()
          Creates a new, empty context.
ReflectorHierarchicalContext(Context parentContext)
          Creates a new, empty context with the specified parent.
ReflectorHierarchicalContext(java.lang.Object delegate)
           
ReflectorHierarchicalContext(java.lang.Object delegate, Context parentContext)
           
 
Method Summary
protected  void checkConfiguration()
           
 BeanReflector getBeanReflector()
           
 java.lang.Object getDelegate()
           
protected  java.lang.Object getHierarchicalImpl(java.lang.String propertyName)
           
protected  java.lang.String[] getPropertyNamesHierarchicalImpl()
           
 void setBeanReflector(BeanReflector beanReflector)
           
 void setDelegate(java.lang.Object reflected)
           
protected  void setHierarchicalImpl(java.lang.String propertyName, java.lang.Object propertyValue)
           
 
Methods inherited from class net.sf.morph.context.contexts.BaseHierarchicalContext
getImpl, getParentContext, getPropertyNamesImpl, setImpl, setParentContext
 
Methods inherited from class net.sf.morph.context.contexts.BaseContext
clear, containsKey, containsValue, entrySet, get, get, get, get, get, getContextMapBridge, getConverter, getLanguage, getLog, getPropertyNames, isEmpty, keySet, put, putAll, remove, set, set, setContextMapBridge, setConverter, setLanguage, setLog, size, values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.morph.context.HierarchicalContext
get, getParentContext, getPropertyNames, set, setParentContext
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

ReflectorHierarchicalContext

public ReflectorHierarchicalContext()
Creates a new, empty context.


ReflectorHierarchicalContext

public ReflectorHierarchicalContext(java.lang.Object delegate)

ReflectorHierarchicalContext

public ReflectorHierarchicalContext(Context parentContext)
Creates a new, empty context with the specified parent. Before this context is used, the


ReflectorHierarchicalContext

public ReflectorHierarchicalContext(java.lang.Object delegate,
                                    Context parentContext)
Method Detail

checkConfiguration

protected void checkConfiguration()

getPropertyNamesHierarchicalImpl

protected java.lang.String[] getPropertyNamesHierarchicalImpl()
                                                       throws java.lang.Exception
Specified by:
getPropertyNamesHierarchicalImpl in class BaseHierarchicalContext
Throws:
java.lang.Exception

getHierarchicalImpl

protected java.lang.Object getHierarchicalImpl(java.lang.String propertyName)
                                        throws java.lang.Exception
Specified by:
getHierarchicalImpl in class BaseHierarchicalContext
Throws:
java.lang.Exception

setHierarchicalImpl

protected void setHierarchicalImpl(java.lang.String propertyName,
                                   java.lang.Object propertyValue)
                            throws java.lang.Exception
Specified by:
setHierarchicalImpl in class BaseHierarchicalContext
Throws:
java.lang.Exception

getBeanReflector

public BeanReflector getBeanReflector()

setBeanReflector

public void setBeanReflector(BeanReflector beanReflector)

getDelegate

public java.lang.Object getDelegate()
Specified by:
getDelegate in interface DelegatingContext

setDelegate

public void setDelegate(java.lang.Object reflected)
Specified by:
setDelegate in interface DelegatingContext


Copyright © 2004-2008.