org.apache.commons.flatfile.morph
Class BaseEntityCollectionReflector

java.lang.Object
  extended by net.sf.morph.reflect.reflectors.BaseReflector
      extended by net.sf.morph.reflect.reflectors.BaseContainerReflector
          extended by org.apache.commons.flatfile.morph.BaseEntityCollectionReflector
All Implemented Interfaces:
net.sf.composite.Component, net.sf.morph.reflect.ContainerReflector, net.sf.morph.reflect.DecoratedReflector, net.sf.morph.reflect.Reflector
Direct Known Subclasses:
IndexedEntityCollectionReflector, NamedEntityCollectionReflector

public abstract class BaseEntityCollectionReflector
extends net.sf.morph.reflect.reflectors.BaseContainerReflector

Base EntityCollection reflector.

Version:
$Revision: 760708 $ $Date: 2009-03-31 17:54:04 -0500 (Tue, 31 Mar 2009) $

Field Summary
static String TYPE_OVERRIDE
          Property name prefix indicating to treat Entities as beans.
 
Fields inherited from class net.sf.morph.reflect.reflectors.BaseReflector
log
 
Constructor Summary
BaseEntityCollectionReflector()
           
 
Method Summary
protected  Class<?> getContainedTypeImpl(Class c)
          
protected  Entity getEntity(Object container, int index)
          Get the child entity at index index.
protected  Entity getEntity(Object bean, String propertyName)
          Get the named child entity.
protected  Object getImpl(Object container, int index)
          
protected  Object getImpl(Object bean, String propertyName)
          
protected  Iterator<Entity> getIteratorImpl(Object o)
          
protected  String[] getPropertyNamesImpl(Object bean)
          
protected  int getSizeImpl(Object o)
          
 net.sf.morph.transform.DecoratedConverter getToTextConverter()
          Get the to-text DecoratedConverter assigned.
protected  Class<?> getTypeImpl(Object bean, String propertyName)
          
protected abstract  boolean isEntity(Object bean, String propertyName)
          Learn whether the specified property refers to an Entity child.
protected  boolean isReadableImpl(Object bean, String propertyName)
          
 boolean isTrimStrings()
          Get the boolean trimStrings.
protected  boolean isWriteableImpl(Object bean, String propertyName)
          
protected  void setEntityValue(Entity e, Object value)
          Set the value of an Entity
protected  Object setImpl(Object container, int index, Object propertyValue)
          
protected  void setImpl(Object bean, String propertyName, Object value)
          
 void setToTextConverter(net.sf.morph.transform.DecoratedConverter toTextConverter)
          Set the to-text DecoratedConverter.
 void setTrimStrings(boolean trimStrings)
          Set the boolean trimStrings.
 
Methods inherited from class net.sf.morph.reflect.reflectors.BaseReflector
add, addImpl, checkIndex, checkIsReflectable, createWrapperInvocationHandler, get, get, getContainedType, getIterator, getPropertyNames, getReflectableCallCache, getReflectableClasses, getReflectableClassesImpl, getReflectorName, getSize, getType, getWrapper, getWrapperImpl, initialize, initializeImpl, isCachingIsReflectableCalls, isInitialized, isPerformingLogging, isReadable, isReflectable, isReflectable, isReflectableImpl, isReflectableImpl, isStrictlyTyped, isValidIndex, isWrappingRuntimeExceptions, isWriteable, newInstance, newInstanceImpl, newInstanceImpl, set, set, setCachingIsReflectableCalls, 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.ContainerReflector
getContainedType, getIterator
 
Methods inherited from interface net.sf.morph.reflect.Reflector
getReflectableClasses, getWrapper
 

Field Detail

TYPE_OVERRIDE

public static final String TYPE_OVERRIDE
Property name prefix indicating to treat Entities as beans.

See Also:
Constant Field Values
Constructor Detail

BaseEntityCollectionReflector

public BaseEntityCollectionReflector()
Method Detail

isTrimStrings

public boolean isTrimStrings()
Get the boolean trimStrings.

Returns:
boolean

setTrimStrings

public void setTrimStrings(boolean trimStrings)
Set the boolean trimStrings.

Parameters:
trimStrings - boolean

getContainedTypeImpl

protected Class<?> getContainedTypeImpl(Class c)
                                 throws Exception

Specified by:
getContainedTypeImpl in class net.sf.morph.reflect.reflectors.BaseContainerReflector
Throws:
Exception

getIteratorImpl

protected Iterator<Entity> getIteratorImpl(Object o)
                                    throws Exception

Specified by:
getIteratorImpl in class net.sf.morph.reflect.reflectors.BaseContainerReflector
Throws:
Exception

getSizeImpl

protected int getSizeImpl(Object o)
                   throws Exception

Overrides:
getSizeImpl in class net.sf.morph.reflect.reflectors.BaseReflector
Throws:
Exception

getTypeImpl

protected Class<?> getTypeImpl(Object bean,
                               String propertyName)
                        throws Exception

Overrides:
getTypeImpl in class net.sf.morph.reflect.reflectors.BaseReflector
Throws:
Exception

getImpl

protected Object getImpl(Object container,
                         int index)
                  throws Exception

Overrides:
getImpl in class net.sf.morph.reflect.reflectors.BaseReflector
Throws:
Exception

getImpl

protected Object getImpl(Object bean,
                         String propertyName)
                  throws Exception

Overrides:
getImpl in class net.sf.morph.reflect.reflectors.BaseReflector
Throws:
Exception

setImpl

protected void setImpl(Object bean,
                       String propertyName,
                       Object value)
                throws Exception

Overrides:
setImpl in class net.sf.morph.reflect.reflectors.BaseReflector
Throws:
Exception

setImpl

protected Object setImpl(Object container,
                         int index,
                         Object propertyValue)
                  throws Exception

Overrides:
setImpl in class net.sf.morph.reflect.reflectors.BaseReflector
Throws:
Exception

setEntityValue

protected void setEntityValue(Entity e,
                              Object value)
                       throws Exception
Set the value of an Entity

Parameters:
value - Object Set the value of e by converting value to a byte[]
e - Entity
Throws:
Exception - on error

getPropertyNamesImpl

protected String[] getPropertyNamesImpl(Object bean)
                                 throws Exception

Overrides:
getPropertyNamesImpl in class net.sf.morph.reflect.reflectors.BaseReflector
Throws:
Exception

isEntity

protected abstract boolean isEntity(Object bean,
                                    String propertyName)
                             throws Exception
Learn whether the specified property refers to an Entity child.

Parameters:
bean - to inspect
propertyName - to read
Returns:
boolean
Throws:
Exception - on error

getEntity

protected Entity getEntity(Object bean,
                           String propertyName)
                    throws Exception
Get the named child entity.

Parameters:
bean - to read
propertyName - to read
Returns:
Entity
Throws:
Exception - on error

getEntity

protected Entity getEntity(Object container,
                           int index)
                    throws Exception
Get the child entity at index index. Base implementation throws UnsupportedOperationException.

Parameters:
container - to read
index - to get
Returns:
Entity
Throws:
Exception - on error

isReadableImpl

protected boolean isReadableImpl(Object bean,
                                 String propertyName)
                          throws Exception

Overrides:
isReadableImpl in class net.sf.morph.reflect.reflectors.BaseReflector
Throws:
Exception

isWriteableImpl

protected boolean isWriteableImpl(Object bean,
                                  String propertyName)
                           throws Exception

Overrides:
isWriteableImpl in class net.sf.morph.reflect.reflectors.BaseReflector
Throws:
Exception

getToTextConverter

public net.sf.morph.transform.DecoratedConverter getToTextConverter()
Get the to-text DecoratedConverter assigned.

Returns:
the toTextConverter

setToTextConverter

public void setToTextConverter(net.sf.morph.transform.DecoratedConverter toTextConverter)
Set the to-text DecoratedConverter.

Parameters:
toTextConverter - to set


Copyright © 2008-2009 The Apache Software Foundation. All Rights Reserved.