Rev 18 | Rev 323 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
/****/package in.shop2020.metamodel.definitions;/*** Singleton Catalog instance. Provides single point access to all entities and* definitions in shop2020 content model** @author naveen**/public class Catalog {private static final Catalog catalog = new Catalog();/*** Reference to root of shop2020 category tree*/private Category rootCategory;/*** Reference to aggregator of all definition objects*/private DefinitionsContainer defsContainer;/*** Reference to aggregator of all core objects*/private EntityContainer entContainer;/*** A private Constructor prevents any other class from instantiating*/private Catalog() {}/**** @return Catalog single instance of Catalog*/public static final Catalog getInstance() {return catalog;}/**** @return rootCategory Root Category* @throws Exception*/public Category getRootCategory() throws Exception {// lazily de-serialize from diskif(this.rootCategory == null) {DefinitionsContainer defs = this.getDefinitionsContainer();this.rootCategory = defs.getCategory(10000);}return this.rootCategory;}/**** @return defsContainer Definitions Container*/public DefinitionsContainer getDefinitionsContainer() {if(this.defsContainer == null) {this.defsContainer = new DefinitionsContainer();}return this.defsContainer;}/**** @return EntityContainer Core object's container*/public EntityContainer getEntityContainer() {if(this.entContainer == null) {this.entContainer = new EntityContainer();}return this.entContainer;}}