Docmosis API 4.5.0

com.docmosis.template.population
Class DebugDataProvider

java.lang.Object
  extended bycom.docmosis.template.population.DebugDataProvider
All Implemented Interfaces:
DataProvider

public class DebugDataProvider
extends Object
implements DataProvider

This DataProvider implementation has been added to help with debugging or analysing the process of template population. It returns dummy values based for each call and logs what it is doing to the logger at DEBUG level. This class can be applied to the population of a new template to quickly get a list of the pattern of calls made to the data provider. The real data provider can then be based on this as desired.


Constructor Summary
DebugDataProvider()
           
 
Method Summary
 boolean getBoolean(String key)
          Log a call to this method and return true.
 DataProvider getDataProvider(String key, int index)
          Log a call to this method and return a new DebugDataProvider
 int getDataProviderCount(String key)
          Log a call to this method and return 1
 InputStream getImage(String key)
          Log a call to this method and return null.
 String getString(String key)
          Log a call to this method and return the given key.
 boolean hasBooleanKey(String key)
          Log a call to this method and return true.
 boolean hasDataProviderKey(String key)
          Log a call to this method and return true
 boolean hasImageKey(String key)
          Log a call to this method and return false.
 boolean hasStringKey(String key)
          Log a call to this method and return true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DebugDataProvider

public DebugDataProvider()
Method Detail

getDataProviderCount

public int getDataProviderCount(String key)
Log a call to this method and return 1

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

hasDataProviderKey

public boolean hasDataProviderKey(String key)
Log a call to this method and return true

Specified by:
hasDataProviderKey in interface DataProvider
Parameters:
key - the key with which to lookup the data provider
Returns:
true always

getDataProvider

public DataProvider getDataProvider(String key,
                                    int index)
Log a call to this method and return a new DebugDataProvider

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 new DebugDataProvider always

getImage

public InputStream getImage(String key)
Log a call to this method and return null.

Specified by:
getImage in interface DataProvider
Parameters:
key - the key under which to locate the image.
Returns:
null always

hasImageKey

public boolean hasImageKey(String key)
Log a call to this method and return false.

Specified by:
hasImageKey in interface DataProvider
Parameters:
key - the key for the String
Returns:
false always

getString

public String getString(String key)
Log a call to this method and return the given key.

Specified by:
getString in interface DataProvider
Parameters:
key - the to look up the value
Returns:
the given key always

hasStringKey

public boolean hasStringKey(String key)
Log a call to this method and return true.

Specified by:
hasStringKey in interface DataProvider
Parameters:
key - the key for the String
Returns:
true always

getBoolean

public boolean getBoolean(String key)
Log a call to this method and return true.

Specified by:
getBoolean in interface DataProvider
Parameters:
key - the key to lookup
Returns:
true always

hasBooleanKey

public boolean hasBooleanKey(String key)
Log a call to this method and return true.

Specified by:
hasBooleanKey in interface DataProvider
Parameters:
key - the key to lookup
Returns:
true always

Docmosis API 4.5.0

Copyright © 2014 Docmosis Pty Ltd. All Rights Reserved.