net.sf.morph.reflect.reflectors
Class StubbornDelegatingReflector

java.lang.Object
  extended by net.sf.morph.reflect.reflectors.BaseReflector
      extended by net.sf.morph.reflect.reflectors.BaseCompositeReflector
          extended by net.sf.morph.reflect.reflectors.StubbornDelegatingReflector
All Implemented Interfaces:
java.lang.Cloneable, net.sf.composite.Component, net.sf.composite.Composite, net.sf.composite.SpecializableComposite, net.sf.composite.StrictlyTypedComposite, BeanReflector, CompositeReflector, ContainerReflector, DecoratedReflector, GrowableContainerReflector, IndexedContainerReflector, InstantiatingReflector, MutableIndexedContainerReflector, Reflector, SizableReflector
Direct Known Subclasses:
ServletRequestReflector

public class StubbornDelegatingReflector
extends BaseCompositeReflector
implements DecoratedReflector, net.sf.composite.StrictlyTypedComposite, net.sf.composite.SpecializableComposite, BeanReflector, ContainerReflector, GrowableContainerReflector, IndexedContainerReflector, InstantiatingReflector, MutableIndexedContainerReflector, CompositeReflector, java.lang.Cloneable

Since:
Morph 1.1 (Oct 25, 2007)
Author:
Matt Sgarlata

Field Summary
 
Fields inherited from class net.sf.morph.reflect.reflectors.BaseReflector
log
 
Fields inherited from interface net.sf.morph.reflect.BeanReflector
IMPLICIT_PROPERTY_CLASS, IMPLICIT_PROPERTY_PROPERTY_NAMES, IMPLICIT_PROPERTY_THIS
 
Constructor Summary
StubbornDelegatingReflector()
          Construct a new SimpleDelegatingReflector.
StubbornDelegatingReflector(java.lang.Object[] components)
          Construct a new SimpleDelegatingReflector.
 
Method Summary
protected  boolean addImpl(java.lang.Object container, java.lang.Object value)
          Implementation of GrowableContainer.add(Object).
protected  java.lang.Class getContainedTypeImpl(java.lang.Class clazz)
          Implementation of ContainerReflector.getContainedType(Class).
protected  java.lang.Object getImpl(java.lang.Object container, int index)
          Implementation of IndexedContainerReflector.get(Object, int).
protected  java.lang.Object getImpl(java.lang.Object bean, java.lang.String propertyName)
          Implementation of BeanReflector.get(Object, String).
protected  java.util.Iterator getIteratorImpl(java.lang.Object container)
          Implementation of ContainerReflector.getIterator(Object).
protected  java.lang.String[] getPropertyNamesImpl(java.lang.Object bean)
          Implementation of BeanReflector.getPropertyNames(Object).
protected  java.lang.Class[] getReflectableClassesImpl()
          Implementation of Reflector.getReflectableClasses().
protected  int getSizeImpl(java.lang.Object container)
          Implementation of SizableReflector.getSize(Object).
protected  java.lang.Class getTypeImpl(java.lang.Object bean, java.lang.String propertyName)
          Default implementation finds the first reflector that returns a non-null value for the given property and returns the type of that value.
protected  void initializeImpl()
          Implementation of BaseReflector.initialize().
protected  boolean isReadableImpl(java.lang.Object bean, java.lang.String propertyName)
          Implementation of BeanReflector.isReadable(Object, String).
 boolean isReflectableImpl(java.lang.Class reflectedType, java.lang.Class reflectorType)
          Implementation of BaseReflector.isReflectable(Class, Class).
protected  boolean isWriteableImpl(java.lang.Object bean, java.lang.String propertyName)
          Implementation of BeanReflector.isWriteable(Object, String).
protected  java.lang.Object newInstanceImpl(java.lang.Class clazz, java.lang.Object parameters)
          Implementation of InstantiatingReflector.newInstance(Class, Object).
protected  java.lang.Object setImpl(java.lang.Object container, int index, java.lang.Object propertyValue)
          Implementation of MutableIndexedContainerReflector.set(Object, int, Object).
protected  void setImpl(java.lang.Object bean, java.lang.String propertyName, java.lang.Object value)
          Implementation of BeanReflector.set(Object, String, Object).
 
Methods inherited from class net.sf.morph.reflect.reflectors.BaseCompositeReflector
clone, getComponents, getComponentType, getComponentValidator, getSpecializer, isPerformingLogging, isSpecializable, setComponents, setComponentValidator, setSpecializer, specialize, toString
 
Methods inherited from class net.sf.morph.reflect.reflectors.BaseReflector
add, checkIndex, checkIsReflectable, createWrapperInvocationHandler, get, get, getContainedType, getIterator, getPropertyNames, getReflectableCallCache, getReflectableClasses, getReflectorName, getSize, getType, getWrapper, getWrapperImpl, initialize, isCachingIsReflectableCalls, isInitialized, isReadable, isReflectable, isReflectable, isReflectableImpl, isStrictlyTyped, isValidIndex, isWrappingRuntimeExceptions, isWriteable, newInstance, newInstanceImpl, set, set, setCachingIsReflectableCalls, setInitialized, setReflectableCallCache, setReflectorName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.morph.reflect.DecoratedReflector
isReflectable
 
Methods inherited from interface net.sf.morph.reflect.Reflector
getReflectableClasses, getWrapper
 
Methods inherited from interface net.sf.composite.StrictlyTypedComposite
getComponentType
 
Methods inherited from interface net.sf.composite.SpecializableComposite
isSpecializable, specialize
 
Methods inherited from interface net.sf.morph.reflect.BeanReflector
get, getPropertyNames, getType, isReadable, isWriteable, set
 
Methods inherited from interface net.sf.morph.reflect.Reflector
getReflectableClasses, getWrapper
 
Methods inherited from interface net.sf.morph.reflect.Reflector
getReflectableClasses, getWrapper
 
Methods inherited from interface net.sf.morph.reflect.GrowableContainerReflector
add
 
Methods inherited from interface net.sf.morph.reflect.Reflector
getReflectableClasses, getWrapper
 
Methods inherited from interface net.sf.morph.reflect.Reflector
getReflectableClasses, getWrapper
 
Methods inherited from interface net.sf.morph.reflect.Reflector
getReflectableClasses, getWrapper
 
Methods inherited from interface net.sf.morph.reflect.InstantiatingReflector
newInstance
 
Methods inherited from interface net.sf.morph.reflect.MutableIndexedContainerReflector
set
 
Methods inherited from interface net.sf.morph.reflect.Reflector
getReflectableClasses, getWrapper
 
Methods inherited from interface net.sf.morph.reflect.Reflector
getReflectableClasses, getWrapper
 
Methods inherited from interface net.sf.morph.reflect.CompositeReflector
isReflectable
 

Constructor Detail

StubbornDelegatingReflector

public StubbornDelegatingReflector()
Construct a new SimpleDelegatingReflector.


StubbornDelegatingReflector

public StubbornDelegatingReflector(java.lang.Object[] components)
Construct a new SimpleDelegatingReflector.

Parameters:
components -
Method Detail

initializeImpl

protected void initializeImpl()
                       throws java.lang.Exception
Description copied from class: BaseReflector
Implementation of BaseReflector.initialize().

Overrides:
initializeImpl in class BaseReflector
Throws:
java.lang.Exception

getReflectableClassesImpl

protected java.lang.Class[] getReflectableClassesImpl()
Description copied from class: BaseReflector
Implementation of Reflector.getReflectableClasses().

Specified by:
getReflectableClassesImpl in class BaseReflector

getImpl

protected java.lang.Object getImpl(java.lang.Object bean,
                                   java.lang.String propertyName)
                            throws java.lang.Exception
Description copied from class: BaseReflector
Implementation of BeanReflector.get(Object, String). Implementation automatically provided for IndexedContainerReflectors. For other reflectors, throws an UnsupportedOperationException.

Overrides:
getImpl in class BaseReflector
Throws:
java.lang.Exception

getPropertyNamesImpl

protected java.lang.String[] getPropertyNamesImpl(java.lang.Object bean)
                                           throws java.lang.Exception
Description copied from class: BaseReflector
Implementation of BeanReflector.getPropertyNames(Object). Implementation automatically provided for IndexedContainerReflectors. For other reflectors, throws an UnsupportedOperationException.

Overrides:
getPropertyNamesImpl in class BaseReflector
Throws:
java.lang.Exception

getTypeImpl

protected java.lang.Class getTypeImpl(java.lang.Object bean,
                                      java.lang.String propertyName)
                               throws java.lang.Exception
Default implementation finds the first reflector that returns a non-null value for the given property and returns the type of that value. If no non-null value could be found, returns the type that is returned by the first BeanReflector that is a component of this reflector.

Overrides:
getTypeImpl in class BaseReflector
Throws:
java.lang.Exception

isReadableImpl

protected boolean isReadableImpl(java.lang.Object bean,
                                 java.lang.String propertyName)
                          throws java.lang.Exception
Description copied from class: BaseReflector
Implementation of BeanReflector.isReadable(Object, String). Default implementation assumes that all properties of the bean specified by BeanReflector.getPropertyNames(Object) are readable.

Overrides:
isReadableImpl in class BaseReflector
Throws:
java.lang.Exception

isWriteableImpl

protected boolean isWriteableImpl(java.lang.Object bean,
                                  java.lang.String propertyName)
                           throws java.lang.Exception
Description copied from class: BaseReflector
Implementation of BeanReflector.isWriteable(Object, String). Default implementation assumes that all readable properties are also writeable. One exception to this is when this reflector is an IndexedContainerReflector but not a MutableIndexedContainerReflector, in which case no properties are considered writeable.

Overrides:
isWriteableImpl in class BaseReflector
Throws:
java.lang.Exception

setImpl

protected void setImpl(java.lang.Object bean,
                       java.lang.String propertyName,
                       java.lang.Object value)
                throws java.lang.Exception
Description copied from class: BaseReflector
Implementation of BeanReflector.set(Object, String, Object). Implementation automatically provided for MutableIndexedContainerReflectors. For other reflectors, throws an UnsupportedOperationException.

Overrides:
setImpl in class BaseReflector
Throws:
java.lang.Exception

getIteratorImpl

protected java.util.Iterator getIteratorImpl(java.lang.Object container)
                                      throws java.lang.Exception
Description copied from class: BaseReflector
Implementation of ContainerReflector.getIterator(Object).

Overrides:
getIteratorImpl in class BaseReflector
Throws:
java.lang.Exception

getContainedTypeImpl

protected java.lang.Class getContainedTypeImpl(java.lang.Class clazz)
                                        throws java.lang.Exception
Description copied from class: BaseReflector
Implementation of ContainerReflector.getContainedType(Class).

Overrides:
getContainedTypeImpl in class BaseReflector
Throws:
java.lang.Exception

getSizeImpl

protected int getSizeImpl(java.lang.Object container)
                   throws java.lang.Exception
Description copied from class: BaseReflector
Implementation of SizableReflector.getSize(Object).

Overrides:
getSizeImpl in class BaseReflector
Throws:
java.lang.Exception

addImpl

protected boolean addImpl(java.lang.Object container,
                          java.lang.Object value)
                   throws java.lang.Exception
Description copied from class: BaseReflector
Implementation of GrowableContainer.add(Object).

Overrides:
addImpl in class BaseReflector
Throws:
java.lang.Exception

getImpl

protected java.lang.Object getImpl(java.lang.Object container,
                                   int index)
                            throws java.lang.Exception
Description copied from class: BaseReflector
Implementation of IndexedContainerReflector.get(Object, int).

Overrides:
getImpl in class BaseReflector
Throws:
java.lang.Exception

setImpl

protected java.lang.Object setImpl(java.lang.Object container,
                                   int index,
                                   java.lang.Object propertyValue)
                            throws java.lang.Exception
Description copied from class: BaseReflector
Implementation of MutableIndexedContainerReflector.set(Object, int, Object).

Overrides:
setImpl in class BaseReflector
Throws:
java.lang.Exception

newInstanceImpl

protected java.lang.Object newInstanceImpl(java.lang.Class clazz,
                                           java.lang.Object parameters)
                                    throws java.lang.Exception
Description copied from class: BaseReflector
Implementation of InstantiatingReflector.newInstance(Class, Object). Default implementation returns a new instance of the given class by calling Class#newInstance()).

Overrides:
newInstanceImpl in class BaseReflector
Throws:
java.lang.Exception

isReflectableImpl

public boolean isReflectableImpl(java.lang.Class reflectedType,
                                 java.lang.Class reflectorType)
                          throws ReflectionException
Description copied from class: BaseReflector
Implementation of BaseReflector.isReflectable(Class, Class).

Overrides:
isReflectableImpl in class BaseReflector
Throws:
ReflectionException


Copyright © 2004-2008.