Docmosis API 4.5.0

com.docmosis.template.population
Class ReflectiveCollectionDataProvider

java.lang.Object
  extended bycom.docmosis.template.population.ReflectiveDataProvider
      extended bycom.docmosis.template.population.ReflectiveCollectionDataProvider
All Implemented Interfaces:
DataProvider, Serializable

public class ReflectiveCollectionDataProvider
extends ReflectiveDataProvider

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.docmosis.template.population.ReflectiveDataProvider
ReflectiveDataProvider.DataFormatManager
 
Field Summary
protected  Collection delegateCollection
           
 
Fields inherited from class com.docmosis.template.population.ReflectiveDataProvider
dataFormatManager, forgiving, METHOD_REFLECTION_HELPER, reflectedDelegate, reflectedDelegateClass
 
Constructor Summary
protected ReflectiveCollectionDataProvider(Object delegate, boolean forgiving, ReflectiveDataProvider.DataFormatManager dataFormatManager)
           
 
Method Summary
 boolean getBoolean(String fieldName)
          Get the boolean value from the reflected delegate.
 DataProvider getDataProvider(String fieldName, int idx)
          Get the data provider from the reflected delegate.
 int getDataProviderCount(String fieldName)
          Get the data provider count from the reflected delegate.
 InputStream getImage(String fieldName)
          Get the image from the reflected delegate.
 String getString(String fieldName)
          Get the String from the reflected delegate.
 boolean hasBooleanKey(String fieldName)
          Determine if the boolean key has been set.
 boolean hasDataProviderKey(String fieldName)
          Determine if the data provider key has been set.
 boolean hasImageKey(String fieldName)
          Determine if the image key has been set.
 boolean hasStringKey(String fieldName)
          Determine if the String key has been set.
 
Methods inherited from class com.docmosis.template.population.ReflectiveDataProvider
getDelegate, getInstance, getInstance, getWrappedInstance, isForgiving, isPrimitive, isPrimitiveArray, logCall, logCall, setDataFormatter, setDateFormat, setDateFormat, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

delegateCollection

protected Collection delegateCollection
Constructor Detail

ReflectiveCollectionDataProvider

protected ReflectiveCollectionDataProvider(Object delegate,
                                           boolean forgiving,
                                           ReflectiveDataProvider.DataFormatManager dataFormatManager)
Method Detail

getDataProvider

public DataProvider getDataProvider(String fieldName,
                                    int idx)
Description copied from class: ReflectiveDataProvider
Get the data provider from the reflected delegate. If a method based on the given fieldName can be reflected, this will return the result of calling that method. NOTE: if fieldName contains period ('.') characters, then this is considered to indicate a nested structure. This method will recursively descend through the reflected delegate attempting to obtain data. If a method along the way returns null, then reflection cannot delve any deeper and null will be returned.

Specified by:
getDataProvider in interface DataProvider
Specified by:
getDataProvider in class ReflectiveDataProvider
Returns:
the reflected value or null.

getDataProviderCount

public int getDataProviderCount(String fieldName)
Description copied from class: ReflectiveDataProvider
Get the data provider count from the reflected delegate. If a method based on the given fieldName can be reflected, this will return the result of calling that method. NOTE: if fieldName contains period ('.') characters, then this is considered to indicate a nested structure. This method will recursively descend through the reflected delegate attempting to obtain data. If a method along the way returns null, then reflection cannot delve any deeper and 0 will be returned.

Specified by:
getDataProviderCount in interface DataProvider
Specified by:
getDataProviderCount in class ReflectiveDataProvider
Returns:
the reflected value or 0.

hasDataProviderKey

public boolean hasDataProviderKey(String fieldName)
Description copied from class: ReflectiveDataProvider
Determine if the data provider key has been set. If a method based on the given fieldName can be reflected, this will return true, otherwise false. NOTE: if fieldName contains period ('.') characters, then this is considered to indicate a nested structure. This method will recursively descend through the reflected delegate attempting to answer the question. If a method along the way returns null, then reflection cannot delve any deeper and false will be returned.

Specified by:
hasDataProviderKey in interface DataProvider
Specified by:
hasDataProviderKey in class ReflectiveDataProvider
Parameters:
fieldName - the name of the field to use for reflection
Returns:
true if a method can be reflected to return a value.

getBoolean

public boolean getBoolean(String fieldName)
Description copied from class: ReflectiveDataProvider
Get the boolean value from the reflected delegate. If a method based on the given fieldName can be reflected, this will return the result of calling that method. NOTE: if fieldName contains period ('.') characters, then this is considered to indicate a nested structure. This method will recursively descend through the reflected delegate attempting to obtain data. If a method along the way returns null, then reflection cannot delve any deeper and false will be returned.

Specified by:
getBoolean in interface DataProvider
Specified by:
getBoolean in class ReflectiveDataProvider
Returns:
the boolean value or false.

getImage

public InputStream getImage(String fieldName)
Description copied from class: ReflectiveDataProvider
Get the image from the reflected delegate. If a method based on the given fieldName can be reflected, this will return the result of calling that method. NOTE: if fieldName contains period ('.') characters, then this is considered to indicate a nested structure. This method will recursively descend through the reflected delegate attempting to obtain data. If a method along the way returns null, then reflection cannot delve any deeper and null will be returned.

Specified by:
getImage in interface DataProvider
Specified by:
getImage in class ReflectiveDataProvider
Returns:
the reflected value or null.

getString

public String getString(String fieldName)
Description copied from class: ReflectiveDataProvider
Get the String from the reflected delegate. If a method based on the given fieldName can be reflected, this will return the result of calling that method. NOTE: if fieldName contains period ('.') characters, then this is considered to indicate a nested structure. This method will recursively descend through the reflected delegate attempting to obtain data. If a method along the way returns null, then reflection cannot delve any deeper and null will be returned.

Specified by:
getString in interface DataProvider
Specified by:
getString in class ReflectiveDataProvider
Returns:
the reflected value or null.

hasBooleanKey

public boolean hasBooleanKey(String fieldName)
Description copied from class: ReflectiveDataProvider
Determine if the boolean key has been set. If a method based on the given fieldName can be reflected, this will return true, otherwise false. NOTE: if fieldName contains period ('.') characters, then this is considered to indicate a nested structure. This method will recursively descend through the reflected delegate attempting to answer the question. If a method along the way returns null, then reflection cannot delve any deeper and false will be returned.

Specified by:
hasBooleanKey in interface DataProvider
Specified by:
hasBooleanKey in class ReflectiveDataProvider
Parameters:
fieldName - the name of the field to use for reflection
Returns:
true if a method can be reflected to return a value.

hasImageKey

public boolean hasImageKey(String fieldName)
Description copied from class: ReflectiveDataProvider
Determine if the image key has been set. If a method based on the given fieldName can be reflected, this will return true, otherwise false. NOTE: if fieldName contains period ('.') characters, then this is considered to indicate a nested structure. This method will recursively descend through the reflected delegate attempting to answer the question. If a method along the way returns null, then reflection cannot delve any deeper and false will be returned.

Specified by:
hasImageKey in interface DataProvider
Specified by:
hasImageKey in class ReflectiveDataProvider
Parameters:
fieldName - the name of the field to use for reflection
Returns:
true if a method can be reflected to return a value.

hasStringKey

public boolean hasStringKey(String fieldName)
Description copied from class: ReflectiveDataProvider
Determine if the String key has been set. If a method based on the given fieldName can be reflected, this will return true, otherwise false. NOTE: if fieldName contains period ('.') characters, then this is considered to indicate a nested structure. This method will recursively descend through the reflected delegate attempting to answer the question. If a method along the way returns null, then reflection cannot delve any deeper and false will be returned.

Specified by:
hasStringKey in interface DataProvider
Specified by:
hasStringKey in class ReflectiveDataProvider
Parameters:
fieldName - the name of the field to use for reflection
Returns:
true if a method can be reflected to return a value.

Docmosis API 4.5.0

Copyright © 2014 Docmosis Pty Ltd. All Rights Reserved.