Rev 33 | Rev 51 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
/****/package in.shop2020.metamodel.util;import java.util.ArrayList;import java.util.List;import in.shop2020.metamodel.core.Bullet;import in.shop2020.metamodel.core.Feature;import in.shop2020.metamodel.definitions.Catalog;import in.shop2020.metamodel.definitions.DefinitionsContainer;import in.shop2020.metamodel.definitions.FeatureDefinition;/*** @author naveen**/public class ExpandedFeature extends Feature {/****/private static final long serialVersionUID = 1L;/****/private FeatureDefinition featureDefinition;/****/private List<ExpandedBullet> expandedBullets;/**** @param feature* @throws Exception*/public ExpandedFeature(Feature feature) throws Exception {super(feature.getFeatureDefinitionID());// Copy rest of the propertiessuper.setBullets(feature.getBullets());super.setFreeformContent(feature.getFreeformContent());// Expand feature definition idDefinitionsContainer defs =Catalog.getInstance().getDefinitionsContainer();this.featureDefinition =defs.getFeatureDefinition(feature.getFeatureDefinitionID());// Expand bulletsif(this.getBullets() != null) {this.expandedBullets = new ArrayList<ExpandedBullet>();for(Bullet bullet : this.getBullets()) {ExpandedBullet expBullet = new ExpandedBullet(bullet,this.featureDefinition.getBulletDefinition());this.expandedBullets.add(expBullet);}}}/*** @return the featureDefinition*/public FeatureDefinition getFeatureDefinition() {return featureDefinition;}/*** @return the expandedBullets*/public List<ExpandedBullet> getExpandedBullets() {return expandedBullets;}/* (non-Javadoc)* @see java.lang.Object#toString()*/@Overridepublic String toString() {return "ExpandedFeature [expandedBullets=" + expandedBullets+ ", featureDefinition=" + featureDefinition + ", toString()="+ super.toString() + "]";}}