Subversion Repositories SmartDukaan

Rev

Rev 51 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

/**
 * 
 */
package in.shop2020.metamodel.util;

import in.shop2020.metamodel.definitions.BulletDefinition;
import in.shop2020.metamodel.definitions.FeatureDefinition;

/**
 * @author naveen
 *
 */
public class ExpandedFeatureDefinition extends FeatureDefinition {

        /**
         * 
         */
        private static final long serialVersionUID = 1L;
        
        /**
         * 
         */
        private ExpandedBulletDefinition expandedBulletDefinition;
        
        /**
         * 
         * @param featureDefintion
         * @throws Exception 
         */
        public ExpandedFeatureDefinition(FeatureDefinition featureDefinition) 
                throws Exception {
                super(featureDefinition.getID(), featureDefinition.getLabel());
                
                // Copy rest of the properties
                this.setAllowsBlank(featureDefinition.allowsBlank());
                this.setDescription(featureDefinition.getDescription());
                this.setBulletDefinition(featureDefinition.getBulletDefinition());
                
                // Expand BulletDefinition
                BulletDefinition bulletDef = featureDefinition.getBulletDefinition();
                
                this.expandedBulletDefinition = new ExpandedBulletDefinition(bulletDef);
        }

        /**
         * @return the expandedBulletDefinition
         */
        public ExpandedBulletDefinition getExpandedBulletDefinition() {
                return expandedBulletDefinition;
        }

        /* (non-Javadoc)
         * @see java.lang.Object#toString()
         */
        @Override
        public String toString() {
                return "ExpandedFeatureDefinition [expandedBulletDefinition="
                                + expandedBulletDefinition + ", allowsBlank()=" + allowsBlank()
                                + ", getBulletDefinition()=" + getBulletDefinition()
                                + ", getDescription()=" + getDescription() + ", getLabel()="
                                + getLabel() + ", getID()=" + getID() + "]";
        }

}