net.windward.datasource
Interface DataSourceProvider

All Known Implementing Classes:
Dom4jDataSource, JdbcDataSource

public interface DataSourceProvider

This supplies a data source to Windward Reports. Implementation of this interface is necessary and sufficient to provide a data source to Windward Reports. This object lives for the lifetime of substituting data into a report.

Version:
2.0 2 January 2004

Method Summary
 void close()
          Called when processing is complete.
 java.lang.String dump()
          Display the entire dataset.
 DataSourceNode getRootNode()
          Returns the root node for this data set.
 TagAttributes[] getTagAttributes()
          Returns the allowed attributes for all tags.
 void log()
          Log all info about this datasource to debug.
 void setMap(java.util.Map map)
          Adds a map that is used for ${variable} substitution.
 void validateTag(BaseTag xmlTag)
          Verifys that a tag has all required attributes and no unknown attributes.
 

Method Detail

setMap

public void setMap(java.util.Map map)
Adds a map that is used for ${variable} substitution. The map should be string pairs and the key values cannot have any of the characters ${} in them. When ${key} is found in any tag, it is replaced with the matching value. The key and value strings are not evaluated in any way, it is just a text substitution. This replace occurs before any other evaluation of a tag so the value string can have ${variable} values that will then be evaluated.
This call sets the map so calling it a second time replaces the map passed in the first time. The map is copied so on return changes to the passed in map will not affect the data source.
Parameters:
map - The map of string pairs.

getRootNode

public DataSourceNode getRootNode()
                           throws DataSourceException
Returns the root node for this data set. Outside of forEach loops this is the node all tag requests will be evaluated against.
Returns:
The root node.
Throws:
DataSourceException - Could not retrieve the data. Generally wraps a SqlException or XpathException.

close

public void close()
           throws DataSourceException
Called when processing is complete. Used to close any resources opened by this object.
Throws:
DataSourceException - Could not retrieve the data. Generally wraps a SqlException or XpathException.

log

public void log()
Log all info about this datasource to debug.

dump

public java.lang.String dump()
                      throws DataSourceException
Display the entire dataset. This is used for debug level logging only.
Returns:
The entire dataset in a human readable format.
Throws:
DataSourceException - thrown if has any problems reading the dataset.

getTagAttributes

public TagAttributes[] getTagAttributes()
Returns the allowed attributes for all tags.
Returns:
The tag attributes.

validateTag

public void validateTag(BaseTag xmlTag)
                 throws TagException
Verifys that a tag has all required attributes and no unknown attributes.
Parameters:
xmlTag - The tag to check
Throws:
TagException - thrown if illegal parameters passed in.


Copyright © 2002 - 2008 Windward Reports - All Rights Reserved. java reporting software