net.sf.morph.reflect.reflectors
Class CollectionReflector

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.CollectionReflector
All Implemented Interfaces:
net.sf.composite.Component, ContainerReflector, DecoratedReflector, GrowableContainerReflector, InstantiatingReflector, Reflector, SizableReflector
Direct Known Subclasses:
SetReflector

public class CollectionReflector
extends BaseContainerReflector
implements ContainerReflector, SizableReflector, InstantiatingReflector, GrowableContainerReflector

A reflector for Collections.

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.SizableReflector
IMPLICIT_PROPERTY_SIZE
 
Constructor Summary
CollectionReflector()
           
 
Method Summary
protected  boolean addImpl(java.lang.Object container, java.lang.Object value)
          Implementation of GrowableContainer.add(Object).
protected  java.util.Collection getCollection(java.lang.Object container)
           
protected  java.lang.Class getContainedTypeImpl(java.lang.Class clazz)
          TODO JDK 1.5 (generics) compatibility
protected  java.util.Iterator getIteratorImpl(java.lang.Object container)
          Implementation of ContainerReflector.getIterator(Object).
 java.lang.Class[] getReflectableClassesImpl()
          Implementation of Reflector.getReflectableClasses().
protected  int getSizeImpl(java.lang.Object container)
          Implementation of SizableReflector.getSize(Object).
protected  java.lang.Object newInstanceImpl(java.lang.Class clazz, java.lang.Object parameters)
          Implementation of InstantiatingReflector.newInstance(Class, Object).
 
Methods inherited from class net.sf.morph.reflect.reflectors.BaseReflector
add, checkIndex, checkIsReflectable, createWrapperInvocationHandler, get, get, getContainedType, getImpl, getImpl, getIterator, getPropertyNames, getPropertyNamesImpl, getReflectableCallCache, getReflectableClasses, getReflectorName, getSize, getType, getTypeImpl, getWrapper, getWrapperImpl, initialize, initializeImpl, isCachingIsReflectableCalls, isInitialized, isPerformingLogging, isReadable, isReadableImpl, isReflectable, isReflectable, isReflectableImpl, isReflectableImpl, isStrictlyTyped, isValidIndex, isWrappingRuntimeExceptions, isWriteable, isWriteableImpl, newInstance, newInstanceImpl, set, set, setCachingIsReflectableCalls, setImpl, 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.SizableReflector
getSize
 
Methods inherited from interface net.sf.morph.reflect.InstantiatingReflector
newInstance
 
Methods inherited from interface net.sf.morph.reflect.GrowableContainerReflector
add
 

Constructor Detail

CollectionReflector

public CollectionReflector()
Method Detail

getCollection

protected java.util.Collection getCollection(java.lang.Object container)

getReflectableClassesImpl

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

Specified by:
getReflectableClassesImpl in class BaseReflector

getContainedTypeImpl

protected java.lang.Class getContainedTypeImpl(java.lang.Class clazz)
                                        throws java.lang.Exception
TODO JDK 1.5 (generics) compatibility

Specified by:
getContainedTypeImpl 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

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

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

addImpl

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

Overrides:
addImpl in class BaseReflector


Copyright © 2004-2008.