net.sf.morph.reflect.reflectors
Class ArrayReflector

java.lang.Object
  extended by net.sf.morph.reflect.reflectors.BaseReflector
      extended by net.sf.morph.reflect.reflectors.BaseContainerReflector
          extended by net.sf.morph.reflect.reflectors.ArrayReflector
All Implemented Interfaces:
net.sf.composite.Component, BeanReflector, ContainerReflector, DecoratedReflector, IndexedContainerReflector, InstantiatingReflector, MutableIndexedContainerReflector, Reflector, SizableReflector

public class ArrayReflector
extends BaseContainerReflector
implements ContainerReflector, IndexedContainerReflector, MutableIndexedContainerReflector, SizableReflector, BeanReflector, InstantiatingReflector

A container reflector for Arrays.

Since:
Nov 20, 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
 
Constructor Summary
ArrayReflector()
           
ArrayReflector(SizableReflector sourceReflector)
           
 
Method Summary
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.util.Iterator getIteratorImpl(java.lang.Object container)
          Implementation of ContainerReflector.getIterator(Object).
protected  java.lang.Class[] getReflectableClassesImpl()
          Implementation of Reflector.getReflectableClasses().
protected  int getSizeImpl(java.lang.Object container)
          Implementation of SizableReflector.getSize(Object).
 SizableReflector getSourceReflector()
           
protected  boolean isReflectableImpl(java.lang.Class clazz)
          The default implementation is correct, but this is faster because it doesn't require looping through all the reflectable classes
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).
 void setSourceReflector(SizableReflector sourceReflector)
           
 
Methods inherited from class net.sf.morph.reflect.reflectors.BaseReflector
add, addImpl, checkIndex, checkIsReflectable, createWrapperInvocationHandler, get, get, getContainedType, getImpl, getIterator, getPropertyNames, getPropertyNamesImpl, getReflectableCallCache, getReflectableClasses, getReflectorName, getSize, getType, getTypeImpl, getWrapper, getWrapperImpl, initialize, initializeImpl, isCachingIsReflectableCalls, isInitialized, isPerformingLogging, isReadable, isReadableImpl, isReflectable, isReflectable, isReflectableImpl, isStrictlyTyped, isValidIndex, isWrappingRuntimeExceptions, isWriteable, isWriteableImpl, newInstance, 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.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.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.BeanReflector
get, getPropertyNames, getType, isReadable, isWriteable, set
 
Methods inherited from interface net.sf.morph.reflect.InstantiatingReflector
newInstance
 

Constructor Detail

ArrayReflector

public ArrayReflector()

ArrayReflector

public ArrayReflector(SizableReflector sourceReflector)
Method Detail

getReflectableClassesImpl

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

Specified by:
getReflectableClassesImpl in class BaseReflector

getIteratorImpl

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

Specified by:
getIteratorImpl in class BaseContainerReflector
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

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

getContainedTypeImpl

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

Specified by:
getContainedTypeImpl in class BaseContainerReflector
Throws:
java.lang.Exception

isReflectableImpl

protected boolean isReflectableImpl(java.lang.Class clazz)
                             throws java.lang.Exception
The default implementation is correct, but this is faster because it doesn't require looping through all the reflectable classes

Overrides:
isReflectableImpl 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

getSourceReflector

public SizableReflector getSourceReflector()

setSourceReflector

public void setSourceReflector(SizableReflector sourceReflector)


Copyright © 2004-2008.