|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.morph.reflect.reflectors.BaseReflector
net.sf.morph.reflect.reflectors.BaseCompositeReflector
net.sf.morph.reflect.reflectors.SimpleDelegatingReflector
public class SimpleDelegatingReflector
Reflector that can be used to combine multiple bean reflectors. By default, a new instance of this reflector will include all reflectors defined in Morph except the MapReflector (the MapBeanReflector is used instead).
| 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 | |
|---|---|
SimpleDelegatingReflector()
Construct a new SimpleDelegatingReflector. |
|
SimpleDelegatingReflector(Reflector[] components)
Construct a new SimpleDelegatingReflector. |
|
SimpleDelegatingReflector(Reflector[] components,
boolean appendDefaultComponents)
Construct a new SimpleDelegatingReflector. |
|
| Method Summary | |
|---|---|
protected boolean |
addImpl(java.lang.Object container,
java.lang.Object value)
Implementation of GrowableContainer.add(Object). |
protected Reflector[] |
createDefaultComponents()
|
protected BeanReflector |
getBeanReflector(java.lang.Object bean)
|
java.lang.Object[] |
getComponents()
|
protected java.lang.Class |
getContainedTypeImpl(java.lang.Class clazz)
Implementation of ContainerReflector.getContainedType(Class). |
protected ContainerReflector |
getContainerReflector(java.lang.Object bean)
|
protected ContainerReflector |
getContainerReflectorForClass(java.lang.Class reflectedClass)
|
protected GrowableContainerReflector |
getGrowableContainerReflector(java.lang.Object bean)
|
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 IndexedContainerReflector |
getIndexedContainerReflector(java.lang.Object bean)
|
protected InstantiatingReflector |
getInstantiatingReflectorForClass(java.lang.Class clazz)
|
protected java.util.Iterator |
getIteratorImpl(java.lang.Object container)
Implementation of ContainerReflector.getIterator(Object). |
protected MutableIndexedContainerReflector |
getMutableIndexedContainerReflector(java.lang.Object bean)
|
protected java.lang.String[] |
getPropertyNamesImpl(java.lang.Object bean)
Implementation of BeanReflector.getPropertyNames(Object). |
protected java.lang.Class[] |
getReflectableClassesImpl()
Implementation of Reflector.getReflectableClasses(). |
protected Reflector |
getReflector(java.lang.Class reflectorType,
java.lang.Class reflectedType)
|
protected SizableReflector |
getSizableReflector(java.lang.Object bean)
|
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)
Implementation of BeanReflector.getType(Object, String). |
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, 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 |
|---|
public SimpleDelegatingReflector()
public SimpleDelegatingReflector(Reflector[] components)
components -
public SimpleDelegatingReflector(Reflector[] components,
boolean appendDefaultComponents)
components - appendDefaultComponents - if true, the components returned from createDefaultComponents() will be added.| Method Detail |
|---|
protected Reflector[] createDefaultComponents()
protected void initializeImpl()
throws java.lang.Exception
BaseReflectorBaseReflector.initialize().
initializeImpl in class BaseReflectorjava.lang.Exceptionprotected java.lang.Class[] getReflectableClassesImpl()
BaseReflectorReflector.getReflectableClasses().
getReflectableClassesImpl in class BaseReflector
protected java.lang.Object getImpl(java.lang.Object bean,
java.lang.String propertyName)
throws java.lang.Exception
BaseReflectorBeanReflector.get(Object, String).
Implementation automatically provided for
IndexedContainerReflectors. For other reflectors, throws an
UnsupportedOperationException.
getImpl in class BaseReflectorjava.lang.Exception
protected java.lang.String[] getPropertyNamesImpl(java.lang.Object bean)
throws java.lang.Exception
BaseReflectorBeanReflector.getPropertyNames(Object).
Implementation automatically provided for
IndexedContainerReflectors. For other reflectors, throws an
UnsupportedOperationException.
getPropertyNamesImpl in class BaseReflectorjava.lang.Exception
protected java.lang.Class getTypeImpl(java.lang.Object bean,
java.lang.String propertyName)
throws java.lang.Exception
BaseReflectorBeanReflector.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).
getTypeImpl in class BaseReflectorjava.lang.Exception
protected boolean isReadableImpl(java.lang.Object bean,
java.lang.String propertyName)
throws java.lang.Exception
BaseReflectorBeanReflector.isReadable(Object, String).
Default implementation assumes that all properties of the bean specified
by BeanReflector.getPropertyNames(Object) are readable.
isReadableImpl in class BaseReflectorjava.lang.Exception
protected boolean isWriteableImpl(java.lang.Object bean,
java.lang.String propertyName)
throws java.lang.Exception
BaseReflectorBeanReflector.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.
isWriteableImpl in class BaseReflectorjava.lang.Exception
protected void setImpl(java.lang.Object bean,
java.lang.String propertyName,
java.lang.Object value)
throws java.lang.Exception
BaseReflectorBeanReflector.set(Object, String, Object).
Implementation automatically provided for
MutableIndexedContainerReflectors. For other reflectors, throws an
UnsupportedOperationException.
setImpl in class BaseReflectorjava.lang.Exception
protected java.util.Iterator getIteratorImpl(java.lang.Object container)
throws java.lang.Exception
BaseReflectorContainerReflector.getIterator(Object).
getIteratorImpl in class BaseReflectorjava.lang.Exception
protected java.lang.Class getContainedTypeImpl(java.lang.Class clazz)
throws java.lang.Exception
BaseReflectorContainerReflector.getContainedType(Class).
getContainedTypeImpl in class BaseReflectorjava.lang.Exception
protected int getSizeImpl(java.lang.Object container)
throws java.lang.Exception
BaseReflectorSizableReflector.getSize(Object).
getSizeImpl in class BaseReflectorjava.lang.Exception
protected boolean addImpl(java.lang.Object container,
java.lang.Object value)
throws java.lang.Exception
BaseReflectorGrowableContainer.add(Object).
addImpl in class BaseReflectorjava.lang.Exception
protected java.lang.Object getImpl(java.lang.Object container,
int index)
throws java.lang.Exception
BaseReflectorIndexedContainerReflector.get(Object, int).
getImpl in class BaseReflectorjava.lang.Exception
protected java.lang.Object setImpl(java.lang.Object container,
int index,
java.lang.Object propertyValue)
throws java.lang.Exception
BaseReflectorMutableIndexedContainerReflector.set(Object, int, Object).
setImpl in class BaseReflectorjava.lang.Exception
protected java.lang.Object newInstanceImpl(java.lang.Class clazz,
java.lang.Object parameters)
throws java.lang.Exception
BaseReflectorInstantiatingReflector.newInstance(Class, Object).
Default implementation returns a new instance of the given class by
calling Class#newInstance()).
newInstanceImpl in class BaseReflectorjava.lang.Exception
public boolean isReflectableImpl(java.lang.Class reflectedType,
java.lang.Class reflectorType)
throws ReflectionException
BaseReflectorBaseReflector.isReflectable(Class, Class).
isReflectableImpl in class BaseReflectorReflectionException
protected Reflector getReflector(java.lang.Class reflectorType,
java.lang.Class reflectedType)
protected BeanReflector getBeanReflector(java.lang.Object bean)
protected ContainerReflector getContainerReflector(java.lang.Object bean)
protected ContainerReflector getContainerReflectorForClass(java.lang.Class reflectedClass)
protected GrowableContainerReflector getGrowableContainerReflector(java.lang.Object bean)
protected SizableReflector getSizableReflector(java.lang.Object bean)
protected IndexedContainerReflector getIndexedContainerReflector(java.lang.Object bean)
protected MutableIndexedContainerReflector getMutableIndexedContainerReflector(java.lang.Object bean)
protected InstantiatingReflector getInstantiatingReflectorForClass(java.lang.Class clazz)
public java.lang.Object[] getComponents()
getComponents in class BaseCompositeReflector
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||