Docmosis API 4.5.0

com.docmosis.template.population
Class SQLDataProvider

java.lang.Object
  extended bycom.docmosis.template.population.MemoryDataProvider
      extended bycom.docmosis.template.population.SQLDataProvider
All Implemented Interfaces:
Cleanable, DataProvider, MutableDataProvider, Serializable

public class SQLDataProvider
extends MemoryDataProvider

Currently the SQL Data Provider doesn't support Image Data being provided by the database.

See Also:
Serialized Form

Constructor Summary
SQLDataProvider()
           
 
Method Summary
 SQLDataItem getDataItem(String key)
           
 String getString(String key)
          Get the value for the given string key.
 boolean hasDataItem(String key)
           
 boolean hasStringKey(String key)
          Determine if this dataprovider has a value for the key.
 void setDataItem(String key, SQLDataItem value)
          Sets the given value for the given key.
 String toDebugString(int level)
           
 String toString()
           
 
Methods inherited from class com.docmosis.template.population.MemoryDataProvider
addDataProvider, cleanup, finalize, getBoolean, getBooleanKeys, getDataProvider, getDataProviderCount, getDataProviderKeys, getImage, getImageKeys, getRealKey, getStringKeys, hasBooleanKey, hasDataProviderKey, hasImageKey, setBoolean, setFalse, setImage, setImage, setString, setTrue, toDebugString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SQLDataProvider

public SQLDataProvider()
Method Detail

setDataItem

public void setDataItem(String key,
                        SQLDataItem value)
Sets the given value for the given key. NOTE: nesting of keys is not supported for set methods. See class description for more information.

Parameters:
key - the key to look for.
value - the value to set.
Throws:
IllegalArgumentException - if the value not a String.

getDataItem

public SQLDataItem getDataItem(String key)

hasDataItem

public boolean hasDataItem(String key)

getString

public String getString(String key)
Get the value for the given string key. Since this class is both a MemoryDataProvider and an SQLDataProvider it can have data plugged in as either Strings or as SQLDataItems. When retrieving, we check to see if we have the item in the SQL results before checking in the memory results.

Specified by:
getString in interface DataProvider
Overrides:
getString in class MemoryDataProvider
Parameters:
key - the key to find the value.
Returns:
a string value.

hasStringKey

public boolean hasStringKey(String key)
Determine if this dataprovider has a value for the key.

Specified by:
hasStringKey in interface DataProvider
Overrides:
hasStringKey in class MemoryDataProvider

toString

public String toString()
Overrides:
toString in class MemoryDataProvider

toDebugString

public String toDebugString(int level)
Overrides:
toDebugString in class MemoryDataProvider

Docmosis API 4.5.0

Copyright © 2014 Docmosis Pty Ltd. All Rights Reserved.