com.docmosis.template.population
Class SQLDataProvider

java.lang.Object
  extended by com.docmosis.template.population.MemoryDataProvider
      extended by com.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
 com.docmosis.template.population.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, com.docmosis.template.population.SQLDataItem value)
          Sets the given value for the given key.
 String toDebugString(int level)
           
 String toDebugString(int level, boolean showClass)
           
 String toString()
           
 String toStringPretty()
          Attempt to return a pretty String representation of the DataProvider
 
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,
                        com.docmosis.template.population.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 com.docmosis.template.population.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
Parameters:
key - the key for the String
Returns:
true if the key has been set.

toString

public String toString()
Overrides:
toString in class MemoryDataProvider

toDebugString

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

toDebugString

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

toStringPretty

public String toStringPretty()
Description copied from interface: DataProvider
Attempt to return a pretty String representation of the DataProvider

Specified by:
toStringPretty in interface DataProvider
Overrides:
toStringPretty in class MemoryDataProvider
Returns:
the String value or null


Copyright © 2014–2023 Docmosis Pty Ltd. All rights reserved.