View Javadoc

1   /*Copyright (C) 2004-... Stephane Gauchet for Hyphonem
2   
3    This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
4   
5    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
6   
7    You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
8    
9    Written by St�phane Gauchet
10   mail me at : sgauchet@free.fr
11   */
12  package fr.hyphonem.conges;
13  
14  import fr.hyphonem.conges.data.CalendarData;
15  import fr.hyphonem.conges.data.EmployeeData;
16  
17  /**
18   * @author Stephane Gauchet pour Hyphonem
19   */
20  public class AccessDataMng {
21  
22  	/**
23  	 * 
24  	 */
25  	public AccessDataMng() {
26  		super();
27  	}
28  
29  	String type = "XML";
30  
31  	/**
32  	 * @return AccessData
33  	 */
34  	public AccessData getInstance() {
35  		AccessData ad = null;
36  		if ("XML".equals(type)) {
37  			ad = new AccessDataXMLImpl();
38  		}
39  		return ad;
40  	}
41  
42  	/**
43  	 * @param ed
44  	 * @param dataDirPath
45  	 * @param fromDate
46  	 * @param toDate
47  	 * @return AccessData
48  	 */
49  	public AccessData getInstance(EmployeeData ed, String dataDirPath,
50  			String fromDate, String toDate) {
51  		AccessData ad = null;
52  		if ("XML".equals(type)) {
53  			ad = new AccessDataXMLImpl(ed, dataDirPath, fromDate, toDate);
54  		}
55  		return ad;
56  	}
57  
58  	/**
59  	 * @param ed
60  	 * @param cd
61  	 * @param dataDirPath
62  	 * @param fromDate
63  	 * @param toDate
64  	 * @return Accessdata
65  	 */
66  	public AccessData getInstance(EmployeeData ed, CalendarData cd,
67  			String dataDirPath, String fromDate, String toDate) {
68  		AccessData ad = null;
69  		if ("XML".equals(type)) {
70  			ad = new AccessDataXMLImpl(ed, cd, dataDirPath, fromDate, toDate);
71  		}
72  		return ad;
73  	}
74  
75  	/**
76  	 * @param dataPath
77  	 * @return Accessdata
78  	 */
79  	public AccessData getInstance(String dataPath) {
80  		AccessData ad = null;
81  		if ("XML".equals(type)) {
82  			ad = new AccessDataXMLImpl(dataPath);
83  		}
84  		return ad;
85  	}
86  }