org.pentaho.reporting.engine.classic.core.modules.parser.ext.factory.datasource
Class DataSourceCollector

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.modules.parser.ext.factory.datasource.DataSourceCollector
All Implemented Interfaces:
Serializable, ClassFactory, DataSourceFactory

public class DataSourceCollector
extends Object
implements DataSourceFactory

A DataSourceFactory created from a number of other factories.

Author:
Thomas Morgner
See Also:
Serialized Form

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

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 Iterator getFactories()
Returns an iterator that provides access to the factories.

Returns:
The iterator.

getDataSourceDescription

public ObjectDescription getDataSourceDescription(String name)
Returns a data source description.

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

getDataSourceName

public String getDataSourceName(ObjectDescription od)
Returns a data source name.

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

getDescriptionForClass

public ObjectDescription getDescriptionForClass(Class c)
Returns a description for the class.

Specified by:
getDescriptionForClass in interface ClassFactory
Parameters:
c - the class.
Returns:
The description.

getSuperClassObjectDescription

public ObjectDescription getSuperClassObjectDescription(Class d,
                                                        ObjectDescription knownSuperClass)
Returns a description for the super class.

Specified by:
getSuperClassObjectDescription in interface 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 Iterator getRegisteredClasses()
Returns an iterator that provides access to the registered classes.

Specified by:
getRegisteredClasses in interface ClassFactory
Returns:
The iterator.

configure

public void configure(org.pentaho.reporting.libraries.base.config.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 ClassFactory
Parameters:
config - the configuration, never null

getConfig

public org.pentaho.reporting.libraries.base.config.Configuration getConfig()
Returns the currently set configuration or null, if none was set.

Returns:
the configuration.

getRegisteredNames

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

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