| 45 |
naveen |
1 |
/**
|
|
|
2 |
*
|
|
|
3 |
*/
|
|
|
4 |
package in.shop2020.metamodel.util;
|
|
|
5 |
|
|
|
6 |
import in.shop2020.metamodel.definitions.BulletDefinition;
|
|
|
7 |
import in.shop2020.metamodel.definitions.FeatureDefinition;
|
|
|
8 |
|
|
|
9 |
/**
|
| 51 |
naveen |
10 |
* Utility class that supports FeatureDefinition class. All related
|
|
|
11 |
* objects are fetched from database and aggregated here.
|
|
|
12 |
*
|
| 45 |
naveen |
13 |
* @author naveen
|
|
|
14 |
*
|
|
|
15 |
*/
|
|
|
16 |
public class ExpandedFeatureDefinition extends FeatureDefinition {
|
|
|
17 |
|
|
|
18 |
/**
|
|
|
19 |
*
|
|
|
20 |
*/
|
|
|
21 |
private static final long serialVersionUID = 1L;
|
|
|
22 |
|
|
|
23 |
/**
|
| 51 |
naveen |
24 |
* Expanded from BulletDefinition ID
|
| 45 |
naveen |
25 |
*/
|
|
|
26 |
private ExpandedBulletDefinition expandedBulletDefinition;
|
|
|
27 |
|
|
|
28 |
/**
|
| 51 |
naveen |
29 |
* Takes FeatureDefinition object as input and converts all references
|
|
|
30 |
* into corresponding detail objects
|
| 45 |
naveen |
31 |
*
|
| 51 |
naveen |
32 |
* @param featureDefintion Feature Definition object
|
| 45 |
naveen |
33 |
* @throws Exception
|
|
|
34 |
*/
|
|
|
35 |
public ExpandedFeatureDefinition(FeatureDefinition featureDefinition)
|
|
|
36 |
throws Exception {
|
|
|
37 |
super(featureDefinition.getID(), featureDefinition.getLabel());
|
|
|
38 |
|
|
|
39 |
// Copy rest of the properties
|
|
|
40 |
this.setAllowsBlank(featureDefinition.allowsBlank());
|
|
|
41 |
this.setDescription(featureDefinition.getDescription());
|
|
|
42 |
this.setBulletDefinition(featureDefinition.getBulletDefinition());
|
|
|
43 |
|
|
|
44 |
// Expand BulletDefinition
|
|
|
45 |
BulletDefinition bulletDef = featureDefinition.getBulletDefinition();
|
|
|
46 |
|
|
|
47 |
this.expandedBulletDefinition = new ExpandedBulletDefinition(bulletDef);
|
|
|
48 |
}
|
|
|
49 |
|
|
|
50 |
/**
|
| 51 |
naveen |
51 |
* @return the expandedBulletDefinition ExpandedBulletDefinition object
|
| 45 |
naveen |
52 |
*/
|
|
|
53 |
public ExpandedBulletDefinition getExpandedBulletDefinition() {
|
|
|
54 |
return expandedBulletDefinition;
|
|
|
55 |
}
|
|
|
56 |
|
|
|
57 |
/* (non-Javadoc)
|
|
|
58 |
* @see java.lang.Object#toString()
|
|
|
59 |
*/
|
|
|
60 |
@Override
|
|
|
61 |
public String toString() {
|
|
|
62 |
return "ExpandedFeatureDefinition [expandedBulletDefinition="
|
|
|
63 |
+ expandedBulletDefinition + ", allowsBlank()=" + allowsBlank()
|
|
|
64 |
+ ", getBulletDefinition()=" + getBulletDefinition()
|
|
|
65 |
+ ", getDescription()=" + getDescription() + ", getLabel()="
|
|
|
66 |
+ getLabel() + ", getID()=" + getID() + "]";
|
|
|
67 |
}
|
|
|
68 |
|
|
|
69 |
}
|