Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
205 naveen 1
/**
2
 * 
3
 */
4
package in.shop2020.metamodel.definitions;
5
 
6
import java.util.ArrayList;
7
import java.util.List;
8
 
9
/**
10
 * @author naveen
11
 *
12
 */
13
public class ExpandedCompositeDefinition extends CompositeDefinition {
14
 
15
	/**
16
	 * 
17
	 */
18
	private static final long serialVersionUID = 1L;
19
 
20
	/**
21
	 * 
22
	 */
23
	private List<ExpandedCompositePartDefinition> expandedConsitePartDefinitions;
24
 
25
	/**
26
	 * @param newID
27
	 * @param name
28
	 * @param separator
29
	 * @throws Exception 
30
	 */
31
	public ExpandedCompositeDefinition(CompositeDefinition compositeDefinition) 
32
		throws Exception{
33
 
34
		super(compositeDefinition.getID(), compositeDefinition.getName(), 
35
				compositeDefinition.getSeparator());
36
 
37
		List<CompositePartDefinition> compPartDefs = 
38
			compositeDefinition.getCompositePartDefinitions();
39
 
40
		// Copy rest of the fields
41
		this.setCompositePartDefinitions(compPartDefs);
42
 
43
		this.expandedConsitePartDefinitions = 
44
			new ArrayList<ExpandedCompositePartDefinition>();
45
 
46
		for(CompositePartDefinition compPartDef : compPartDefs) {
47
			ExpandedCompositePartDefinition expCompPartDef = 
48
				new ExpandedCompositePartDefinition(compPartDef);
49
 
50
			this.expandedConsitePartDefinitions.add(expCompPartDef);
51
		}
52
	}
53
 
54
	/**
55
	 * @return the expandedConsitePartDefinitions
56
	 */
57
	public List<ExpandedCompositePartDefinition> 
58
			getExpandedConsitePartDefinitions() {
59
		return expandedConsitePartDefinitions;
60
	}
61
}