|
||||||||||
| 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.BaseBeanReflector
net.sf.morph.reflect.reflectors.ContextReflector
public class ContextReflector
A reflector that can expose the properties of any Context.
| 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 | |
|---|---|
ContextReflector()
|
|
| Method Summary | |
|---|---|
protected java.lang.Object |
getImpl(java.lang.Object bean,
java.lang.String propertyName)
Template method must be overridden. |
protected java.lang.String[] |
getPropertyNamesImpl(java.lang.Object bean)
Template method must be overridden. |
java.lang.Class[] |
getReflectableClassesImpl()
Implementation of Reflector.getReflectableClasses(). |
protected java.lang.Class |
getTypeImpl(java.lang.Object bean,
java.lang.String propertyName)
Template method must be overridden. |
protected boolean |
isReadableImpl(java.lang.Object bean,
java.lang.String propertyName)
Returns true because all properties of a context are
considered readable. |
protected boolean |
isWriteableImpl(java.lang.Object bean,
java.lang.String propertyName)
Returns true because all properties in a context are
assumed to be writeable. |
protected java.lang.Object |
newInstanceImpl(java.lang.Class clazz,
java.lang.Object parameters)
Implementation of InstantiatingReflector.newInstance(Class, Object). |
protected void |
setImpl(java.lang.Object bean,
java.lang.String propertyName,
java.lang.Object value)
Template method must be overridden. |
| 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.InstantiatingReflector |
|---|
newInstance |
| Methods inherited from interface net.sf.morph.reflect.Reflector |
|---|
getReflectableClasses, getWrapper |
| 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 |
|---|
public ContextReflector()
| Method Detail |
|---|
public java.lang.Class[] getReflectableClassesImpl()
BaseReflectorReflector.getReflectableClasses().
getReflectableClassesImpl in class BaseReflector
protected java.lang.String[] getPropertyNamesImpl(java.lang.Object bean)
throws java.lang.Exception
BaseBeanReflectorBeanReflector.getPropertyNames(Object).
Implementation automatically provided for
IndexedContainerReflectors. For other reflectors, throws an
UnsupportedOperationException.
getPropertyNamesImpl in class BaseBeanReflectorjava.lang.Exception
protected java.lang.Class getTypeImpl(java.lang.Object bean,
java.lang.String propertyName)
throws java.lang.Exception
BaseBeanReflectorBeanReflector.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 BaseBeanReflectorjava.lang.Exception
protected boolean isReadableImpl(java.lang.Object bean,
java.lang.String propertyName)
throws java.lang.Exception
true because all properties of a context are
considered readable. If the property isn't a defined property returned by
getPropertyNames, null is returned when the
BeanReflector.get(Object, String) method is
called.
isReadableImpl in class BaseReflectorjava.lang.Exception
protected boolean isWriteableImpl(java.lang.Object bean,
java.lang.String propertyName)
throws java.lang.Exception
true because all properties in a context are
assumed to be writeable. If they're not (e.g. - on an Object has been
exposed as a Context), an exception is thrown when the set method is
called on the context.
isWriteableImpl in class BaseReflectorjava.lang.Exception
protected java.lang.Object getImpl(java.lang.Object bean,
java.lang.String propertyName)
throws java.lang.Exception
BaseBeanReflectorBeanReflector.get(Object, String).
Implementation automatically provided for
IndexedContainerReflectors. For other reflectors, throws an
UnsupportedOperationException.
getImpl in class BaseBeanReflectorjava.lang.Exception
protected void setImpl(java.lang.Object bean,
java.lang.String propertyName,
java.lang.Object value)
throws java.lang.Exception
BaseBeanReflectorBeanReflector.set(Object, String, Object).
Implementation automatically provided for
MutableIndexedContainerReflectors. For other reflectors, throws an
UnsupportedOperationException.
setImpl in class BaseBeanReflectorjava.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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||