net.sf.morph.reflect.reflectors
Class BaseBeanReflector

java.lang.Object
  extended by net.sf.morph.reflect.reflectors.BaseReflector
      extended by net.sf.morph.reflect.reflectors.BaseBeanReflector
All Implemented Interfaces:
net.sf.composite.Component, BeanReflector, DecoratedReflector, Reflector, SizableReflector
Direct Known Subclasses:
BaseServletReflector, ContextReflector, DynaBeanReflector, ObjectReflector, ResultSetReflector, VelocityContextReflector

public abstract class BaseBeanReflector
extends BaseReflector
implements BeanReflector

Convenient base class for BeanReflectors. Validates arguments and takes care of logging and exception handling.

Since:
Nov 14, 2004
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
 
Fields inherited from interface net.sf.morph.reflect.SizableReflector
IMPLICIT_PROPERTY_SIZE
 
Constructor Summary
BaseBeanReflector()
           
 
Method Summary
protected abstract  java.lang.Object getImpl(java.lang.Object bean, java.lang.String propertyName)
          Template method must be overridden.
protected abstract  java.lang.String[] getPropertyNamesImpl(java.lang.Object bean)
          Template method must be overridden.
protected abstract  java.lang.Class getTypeImpl(java.lang.Object bean, java.lang.String propertyName)
          Template method must be overridden.
protected abstract  void setImpl(java.lang.Object bean, java.lang.String propertyName, java.lang.Object value)
          Template method must be overridden.
 
Methods inherited from class net.sf.morph.reflect.reflectors.BaseReflector
add, addImpl, checkIndex, checkIsReflectable, createWrapperInvocationHandler, get, get, getContainedType, getContainedTypeImpl, getImpl, getIterator, getIteratorImpl, getPropertyNames, getReflectableCallCache, getReflectableClasses, getReflectableClassesImpl, getReflectorName, getSize, getSizeImpl, getType, getWrapper, getWrapperImpl, initialize, initializeImpl, isCachingIsReflectableCalls, isInitialized, isPerformingLogging, isReadable, isReadableImpl, isReflectable, isReflectable, isReflectableImpl, isReflectableImpl, isStrictlyTyped, isValidIndex, isWrappingRuntimeExceptions, isWriteable, isWriteableImpl, newInstance, newInstanceImpl, newInstanceImpl, set, set, setCachingIsReflectableCalls, setImpl, setInitialized, setReflectableCallCache, setReflectorName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.morph.reflect.BeanReflector
get, getPropertyNames, getType, isReadable, isWriteable, set
 
Methods inherited from interface net.sf.morph.reflect.SizableReflector
getSize
 

Constructor Detail

BaseBeanReflector

public BaseBeanReflector()
Method Detail

getPropertyNamesImpl

protected abstract java.lang.String[] getPropertyNamesImpl(java.lang.Object bean)
                                                    throws java.lang.Exception
Template method must be overridden. 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 abstract java.lang.Class getTypeImpl(java.lang.Object bean,
                                               java.lang.String propertyName)
                                        throws java.lang.Exception
Template method must be overridden. Implementation of BeanReflector.getType(Object, String). Default implementation provided. For IndexedContainerReflectors, returns the type by calling ContainerReflector.getContainedType(Class). For other reflectors, checks the type of the property by calling BaseReflector.get(Object, String).

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

getImpl

protected abstract java.lang.Object getImpl(java.lang.Object bean,
                                            java.lang.String propertyName)
                                     throws java.lang.Exception
Template method must be overridden. 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

setImpl

protected abstract void setImpl(java.lang.Object bean,
                                java.lang.String propertyName,
                                java.lang.Object value)
                         throws java.lang.Exception
Template method must be overridden. 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


Copyright © 2004-2008.