View Javadoc

1   package net.sourceforge.xmlfit.data;
2   
3   import net.sourceforge.xmlfit.data.impl.DataSourceFactoryImpl;
4   
5   /**
6    * Factory for the XMLFit DataSources.
7    */
8   public interface DataSourceFactory {
9   	
10  	/**
11  	 * The instance of the factory which will be use by XMLFit.
12  	 */
13  	// Design - Comment:
14  	// There never be more then one implementation so the default factory pattern is ok.
15  	// is not final because for testing we should be able to change the implementation.
16  	public static DataSourceFactory INSTANCE = DataSourceFactoryImpl.INSTANCE;
17  
18  	/**
19  	 * Create a DataSource for file, the file extension is used to selected the DataSource.
20  	 * Example: File with the name *.xml a instance of a XMLDataSourceImpl will be return.
21  	 * @param fileName the name of the DataSource file. For Example a XML File.
22  	 * @return a instance of a DataSource for the given file type.
23  	 */
24  	public DataSource createDataSource(String fileName);
25  	
26  }