com.jrefinery.report.io.ext.factory.datasource
Class DataSourceCollector

java.lang.Object
  |
  +--com.jrefinery.report.io.ext.factory.datasource.DataSourceCollector
All Implemented Interfaces:
org.jfree.xml.factory.objects.ClassFactory, DataSourceFactory

public class DataSourceCollector
extends java.lang.Object
implements DataSourceFactory

A DataSourceFactory created from a number of other factories.

Author:
Thomas Morgner

Constructor Summary
DataSourceCollector()
          Creates a new factory.
 
Method Summary
 void addFactory(DataSourceFactory factory)
          Adds a factory to the collection.
 void configure(org.jfree.util.Configuration config)
          Configures this factory.
 org.jfree.util.Configuration getConfig()
          Returns the currently set configuration or null, if none was set.
 org.jfree.xml.factory.objects.ObjectDescription getDataSourceDescription(java.lang.String name)
          Returns a data source description.
 java.lang.String getDataSourceName(org.jfree.xml.factory.objects.ObjectDescription od)
          Returns a data source name.
 org.jfree.xml.factory.objects.ObjectDescription getDescriptionForClass(java.lang.Class c)
          Returns a description for the class.
 java.util.Iterator getFactories()
          Returns an iterator that provides access to the factories.
 java.util.Iterator getRegisteredClasses()
          Returns an iterator that provides access to the registered classes.
 java.util.Iterator getRegisteredNames()
          Returns the names of all registered datasources as iterator.
 org.jfree.xml.factory.objects.ObjectDescription getSuperClassObjectDescription(java.lang.Class d, org.jfree.xml.factory.objects.ObjectDescription knownSuperClass)
          Returns a description for the super class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSourceCollector

public DataSourceCollector()
Creates a new factory.

Method Detail

addFactory

public void addFactory(DataSourceFactory factory)
Adds a factory to the collection.

Parameters:
factory - the factory.

getFactories

public java.util.Iterator getFactories()
Returns an iterator that provides access to the factories.

Returns:
The iterator.

getDataSourceDescription

public org.jfree.xml.factory.objects.ObjectDescription getDataSourceDescription(java.lang.String name)
Returns a data source description.

Specified by:
getDataSourceDescription in interface DataSourceFactory
Parameters:
name - the data source name.
Returns:
The description.

getDataSourceName

public java.lang.String getDataSourceName(org.jfree.xml.factory.objects.ObjectDescription od)
Returns a data source name.

Specified by:
getDataSourceName in interface DataSourceFactory
Parameters:
od - the object description.
Returns:
The name.

getDescriptionForClass

public org.jfree.xml.factory.objects.ObjectDescription getDescriptionForClass(java.lang.Class c)
Returns a description for the class.

Specified by:
getDescriptionForClass in interface org.jfree.xml.factory.objects.ClassFactory
Parameters:
c - the class.
Returns:
The description.

getSuperClassObjectDescription

public org.jfree.xml.factory.objects.ObjectDescription getSuperClassObjectDescription(java.lang.Class d,
                                                                                      org.jfree.xml.factory.objects.ObjectDescription knownSuperClass)
Returns a description for the super class.

Specified by:
getSuperClassObjectDescription in interface org.jfree.xml.factory.objects.ClassFactory
Parameters:
d - the class.
knownSuperClass - the last known super class for the given class or null if none was found yet.
Returns:
The object description suitable to create instances of the given class d.

getRegisteredClasses

public java.util.Iterator getRegisteredClasses()
Returns an iterator that provides access to the registered classes.

Specified by:
getRegisteredClasses in interface org.jfree.xml.factory.objects.ClassFactory
Returns:
The iterator.

configure

public void configure(org.jfree.util.Configuration config)
Configures this factory. The configuration contains several keys and their defined values. The given reference to the configuration object will remain valid until the report parsing or writing ends.

The configuration contents may change during the reporting.

Specified by:
configure in interface org.jfree.xml.factory.objects.ClassFactory
Parameters:
config - the configuration, never null

getConfig

public org.jfree.util.Configuration getConfig()
Returns the currently set configuration or null, if none was set.

Returns:
the configuration.

getRegisteredNames

public java.util.Iterator getRegisteredNames()
Returns the names of all registered datasources as iterator.

Specified by:
getRegisteredNames in interface DataSourceFactory
Returns:
the registered names.