Docmosis API 4.5.0

com.docmosis.template.population
Class KeyedReflectiveDataProvider

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

public class KeyedReflectiveDataProvider
extends Object
implements DataProvider, Serializable

See Also:
Serialized Form

Constructor Summary
KeyedReflectiveDataProvider(String key, Object o, boolean forgiving)
           
 
Method Summary
 boolean getBoolean(String key)
          Determine if the given key hs been set to true.
 DataProvider getDataProvider(String key, int index)
          Get the data provider contained within this data provider with the given key as a name, and an index.
 int getDataProviderCount(String key)
          Return the number of data providers contained within this data provider with the given key as a name.
 InputStream getImage(String key)
          Get an InputStream over the image with the given key.
 String getString(String key)
          Get the value for the given key
 boolean hasBooleanKey(String key)
          Determine if a value for the boolean key has been specified
 boolean hasDataProviderKey(String key)
          Determine if a data provider for the key has been specified (even if null)
 boolean hasImageKey(String key)
          Determine if the given image has been set (even if to null)
 boolean hasStringKey(String key)
          Determine if the given string has been set (even if to null)
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyedReflectiveDataProvider

public KeyedReflectiveDataProvider(String key,
                                   Object o,
                                   boolean forgiving)
Method Detail

getBoolean

public boolean getBoolean(String key)
Description copied from interface: DataProvider
Determine if the given key hs been set to true.

Specified by:
getBoolean in interface DataProvider
Parameters:
key - the key to lookup
Returns:
false if the key is not set or has not been set to true

getDataProvider

public DataProvider getDataProvider(String key,
                                    int index)
Description copied from interface: DataProvider
Get the data provider contained within this data provider with the given key as a name, and an index.

Specified by:
getDataProvider in interface DataProvider
Parameters:
key - the key (name) of the data provider to look for.
index - the index of the data provider.
Returns:
a data provider.

getDataProviderCount

public int getDataProviderCount(String key)
Description copied from interface: DataProvider
Return the number of data providers contained within this data provider with the given key as a name.

Specified by:
getDataProviderCount in interface DataProvider
Parameters:
key - the key (name) of the data providers to look for.
Returns:
the number of data providers.

getImage

public InputStream getImage(String key)
Description copied from interface: DataProvider
Get an InputStream over the image with the given key. The stream will be closed by the consumer when finished. Document generation may request the same image more than once (even if the stream has been partially read).

Specified by:
getImage in interface DataProvider
Parameters:
key - the key under which to locate the image.
Returns:
null if the image cannot be found

getString

public String getString(String key)
Description copied from interface: DataProvider
Get the value for the given key

Specified by:
getString in interface DataProvider
Parameters:
key - the to look up the value
Returns:
the String value or null

hasBooleanKey

public boolean hasBooleanKey(String key)
Description copied from interface: DataProvider
Determine if a value for the boolean key has been specified

Specified by:
hasBooleanKey in interface DataProvider
Parameters:
key - the key to lookup
Returns:
true if the boolean value has been set, regardless of what the value is.

hasDataProviderKey

public boolean hasDataProviderKey(String key)
Description copied from interface: DataProvider
Determine if a data provider for the key has been specified (even if null)

Specified by:
hasDataProviderKey in interface DataProvider
Parameters:
key - the key with which to lookup the data provider
Returns:
true if a data provider has been set for the given key, even if null

hasImageKey

public boolean hasImageKey(String key)
Description copied from interface: DataProvider
Determine if the given image has been set (even if to null)

Specified by:
hasImageKey in interface DataProvider
Parameters:
key - the key for the String
Returns:
true if the key has been set.

hasStringKey

public boolean hasStringKey(String key)
Description copied from interface: DataProvider
Determine if the given string has been set (even if to null)

Specified by:
hasStringKey in interface DataProvider
Parameters:
key - the key for the String
Returns:
true if the key has been set.

toString

public String toString()

Docmosis API 4.5.0

Copyright © 2014 Docmosis Pty Ltd. All Rights Reserved.