Subversion Repositories SmartDukaan

Rev

Rev 1061 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
10 shop2020 1
/**
2
 * 
3
 */
4
package in.shop2020.metamodel.definitions;
5
 
6
/**
49 naveen 7
 * Singleton Catalog instance. Provides single point access to all entities and 
8
 * definitions in shop2020 content model
10 shop2020 9
 * 
10
 * @author naveen
11
 *
12
 */
13
public class Catalog {
14
	private static final Catalog catalog = new Catalog();
15
	/**
49 naveen 16
	 * Reference to root of shop2020 category tree
10 shop2020 17
	 */
18
	private Category rootCategory;
19
 
20
	/**
49 naveen 21
	 * Reference to aggregator of all definition objects
10 shop2020 22
	 */
23
	private DefinitionsContainer defsContainer;
24
 
25
	/**
26
	 * A private Constructor prevents any other class from instantiating
27
	 */
28
	private Catalog() {
1050 rajveer 29
		this.defsContainer = new DefinitionsContainer();
30
		this.rootCategory = defsContainer.getCategory(10000);
10 shop2020 31
	}
32
 
33
	/**
34
	 * 
35
	 * @return 	Catalog 	single instance of Catalog
36
	 */
37
	public static final Catalog getInstance() {
38
		return catalog;
39
	}
40
 
41
	/**
42
	 *  
49 naveen 43
	 * @return rootCategory Root Category
44
	 * @throws Exception 
10 shop2020 45
	 */
49 naveen 46
	public Category getRootCategory() throws Exception {
10 shop2020 47
		return this.rootCategory;
48
	}
49
 
50
	/**
51
	 * 
49 naveen 52
	 * @return defsContainer Definitions Container
1050 rajveer 53
	 * @throws Exception 
10 shop2020 54
	 */
18 naveen 55
	public DefinitionsContainer getDefinitionsContainer() {		
10 shop2020 56
		return this.defsContainer;
57
	}
58
 
59
}