Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
10 shop2020 1
/**
2
 * 
3
 */
4
package in.shop2020.metamodel.definitions;
5
 
6
/**
7
 * Singleton Catalog instance
8
 * 
9
 * @author naveen
10
 *
11
 */
12
public class Catalog {
13
	private static final Catalog catalog = new Catalog();
14
	/**
15
	 * 
16
	 */
17
	private Category rootCategory;
18
 
19
	/**
20
	 * 
21
	 */
22
	private DefinitionsContainer defsContainer;
23
 
24
	/**
25
	 * 
26
	 */
27
	private EntityContainer entContainer;
28
 
29
	/**
30
	 * A private Constructor prevents any other class from instantiating
31
	 */
32
	private Catalog() {
33
	}
34
 
35
	/**
36
	 * 
37
	 * @return 	Catalog 	single instance of Catalog
38
	 */
39
	public static final Catalog getInstance() {
40
		return catalog;
41
	}
42
 
43
	/**
44
	 *  
45
	 * @return rootCategory
46
	 */
47
	public Category getRootCategory() {
48
		// lazily de-serialize from disk
49
		// TODO
50
		return this.rootCategory;
51
	}
52
 
53
	/**
54
	 * 
55
	 * @return defsContainer
56
	 */
57
	public DefinitionsContainer getDefinitionsContainer() {
58
		// lazily de-serialize from disk
59
		// TODO
60
		this.defsContainer = new DefinitionsContainer();
61
		return this.defsContainer;
62
	}
63
 
64
	/**
65
	 * 
66
	 * @return EntityContainer
67
	 */
68
	public EntityContainer getEntityContainer() {
69
		// lazily de-serialize from disk
70
		// TODO
71
		this.entContainer = new EntityContainer();
72
		return this.entContainer;
73
	}
74
}