Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
24 naveen 1
/**
2
 * 
3
 */
4
package in.shop2020.metamodel.util;
5
 
6
import in.shop2020.metamodel.definitions.BulletDefinition;
7
import in.shop2020.metamodel.definitions.Catalog;
8
import in.shop2020.metamodel.definitions.DatatypeDefinition;
9
import in.shop2020.metamodel.definitions.DefinitionsContainer;
10
import in.shop2020.metamodel.definitions.Unit;
11
 
12
/**
13
 * @author naveen
14
 *
15
 */
16
public class ExpandedBulletDefinition extends BulletDefinition {
17
 
18
	/**
19
	 * 
20
	 */
21
	private static final long serialVersionUID = 1L;
22
 
23
	private DatatypeDefinition datatypeDefinition ; 
24
	private Unit unit;
25
 
26
	/**
27
	 * @param datatypeDefinitionID
28
	 * @throws Exception 
29
	 */
30
	public ExpandedBulletDefinition(BulletDefinition bulletDefinition) 
31
		throws Exception {
32
		super(bulletDefinition.getDatatypeDefinitionID());
33
 
34
		// Copy rest of the properties
35
		this.setDescription(bulletDefinition.getDescription());
36
		this.setUnitID(bulletDefinition.getUnitID());
37
 
38
		DefinitionsContainer defs = 
39
			Catalog.getInstance().getDefinitionsContainer();
40
 
41
		// Expand data type definition id
42
		this.datatypeDefinition = defs.getDatatypeDefinition(
43
				bulletDefinition.getDatatypeDefinitionID());
44
 
45
		// Expand unit id
46
		this.unit = defs.getUnit(bulletDefinition.getUnitID());
47
 
48
	}
49
 
50
	/**
51
	 * @return the datatypeDefinition
52
	 */
53
	public DatatypeDefinition getDatatypeDefinition() {
54
		return datatypeDefinition;
55
	}
56
 
57
	/**
58
	 * @return the unit
59
	 */
60
	public Unit getUnit() {
61
		return unit;
62
	}
63
 
64
}