matching is now configurable in the editor
authorn.hoffmann <n.hoffmann@localhost>
Thu, 28 Jan 2010 14:19:43 +0000 (14:19 +0000)
committern.hoffmann <n.hoffmann@localhost>
Thu, 28 Jan 2010 14:19:43 +0000 (14:19 +0000)
.gitattributes
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/parser/MatchStrategyConfigurator.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/AbstractMatchingPreferences.java [new file with mode: 0644]
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/NonViralNameMatchingPreference.java [new file with mode: 0644]
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/ReferenceMatchingPreference.java [new file with mode: 0644]
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/TeamOrPersonMatchingPreference.java [new file with mode: 0644]

index caeaf21a52f48f677374f0d30f79fdb89cc47c60..82ce50aa13bfbda44a01ac9ff61729229d419e72 100644 (file)
@@ -620,6 +620,10 @@ taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/NomenclaturalCod
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java -text
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/TaxonomicEditorGeneralPreferences.java -text
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/TaxonomicPreferences.java -text
+taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/AbstractMatchingPreferences.java -text
+taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/NonViralNameMatchingPreference.java -text
+taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/ReferenceMatchingPreference.java -text
+taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/TeamOrPersonMatchingPreference.java -text
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/AbstractMenuPreferences.java -text
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/DistributionStatusMenuPreferences.java -text
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/ExtensionTypeMenuPreferences.java -text
index d757b8fdd6411f5a0312b265319203c40e6f6e7d..0b81e3c1c325721c0cbbc0f1964d02df522e1475 100644 (file)
@@ -13,10 +13,10 @@ package eu.etaxonomy.taxeditor.parser;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
 import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.model.reference.ReferenceBase;
-import eu.etaxonomy.cdm.strategy.match.DefaultMatchStrategy;
 import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
 import eu.etaxonomy.cdm.strategy.match.MatchException;
 import eu.etaxonomy.cdm.strategy.match.MatchMode;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 
 /**
  * This class defines the MatchStrategies that will be used by the ParseHandler.
@@ -27,22 +27,13 @@ import eu.etaxonomy.cdm.strategy.match.MatchMode;
  */
 public class MatchStrategyConfigurator {
        
-       /**
-        * Singleton instance
-        */
-       private static MatchStrategyConfigurator instance = new MatchStrategyConfigurator();
-       
-       private IMatchStrategy nonViralNameMatchStrategy;
-       private IMatchStrategy teamOrPersonMatchStrategy;
-       private IMatchStrategy referenceMatchStrategy;
-       
        /**
         * 
         * @return
         * @throws MatchException
         */
        public static IMatchStrategy NonViralNameMatchStrategy() throws MatchException{
-               return instance.getNonViralNameMatchStrategy();
+               return PreferencesUtil.getMatchStrategy(NonViralName.class);
        }
        
        /**
@@ -51,7 +42,7 @@ public class MatchStrategyConfigurator {
         * @throws MatchException
         */
        public static IMatchStrategy TeamOrPersonMatchStrategy() throws MatchException{
-               return instance.getTeamOrPersonMatchStrategy();
+               return PreferencesUtil.getMatchStrategy(TeamOrPersonBase.class);
        }
        
        /**
@@ -60,69 +51,16 @@ public class MatchStrategyConfigurator {
         * @throws MatchException
         */
        public static IMatchStrategy ReferenceMatchStrategy() throws MatchException{
-               return instance.getReferenceMatchStrategy();
-       }
-
-       /**
-        * @param strategy the nonViralNameMatchStrategy to set
-        */
-       private void doSetNonViralNameMatchStrategy(IMatchStrategy strategy) {
-               this.nonViralNameMatchStrategy = strategy;
-       }
-       
-       /**
-        * @param strategy the nonViralNameMatchStrategy to set
-        */
-       public static void setNonViralNameMatchStrategy(IMatchStrategy strategy) {
-               instance.doSetNonViralNameMatchStrategy(strategy);
-       }
-       
-       /**
-        * @param strategy the teamOrPersonMatchStrategy to set
-        */
-       private void doSetTeamOrPersonMatchStrategy(IMatchStrategy strategy) {
-               this.teamOrPersonMatchStrategy = strategy;
-       }
-
-       /**
-        * @param strategy the teamOrPersonMatchStrategy to set
-        */
-       public static void setTeamOrPersonMatchStrategy(IMatchStrategy strategy) {
-               instance.doSetTeamOrPersonMatchStrategy(strategy);
-       }
-
-       /**
-        * @param strategy the referenceMatchStrategy to set
-        */
-       private void doSetReferenceMatchStrategy(IMatchStrategy strategy) {
-               this.referenceMatchStrategy = strategy;
-       }
-       
-       /**
-        * @param strategy the referenceMatchStrategy to set
-        */
-       public static void setReferenceMatchStrategy(IMatchStrategy strategy) {
-               instance.doSetReferenceMatchStrategy(strategy);
+               return PreferencesUtil.getMatchStrategy(ReferenceBase.class);
        }
 
-       /**
-        * @return the nonViralNameMatchStrategy
-        * @throws MatchException 
-        */
-       private IMatchStrategy getNonViralNameMatchStrategy() throws MatchException {
-               if(nonViralNameMatchStrategy == null){
-                       nonViralNameMatchStrategy = getDefaultNonViralNameMatchStrategy();
-               }
-               return nonViralNameMatchStrategy;
-       }
-       
        /**
         * 
         * @return
         * @throws MatchException
         */
        public static IMatchStrategy getDefaultNonViralNameMatchStrategy() throws MatchException{
-               DefaultMatchStrategy strategy = DefaultMatchStrategy.NewInstance(NonViralName.class);
+               IMatchStrategy strategy = PreferencesUtil.getDefaultMatchStrategy(NonViralName.class);
                
                strategy.setMatchMode("nomenclaturalReference", MatchMode.IGNORE);
                strategy.setMatchMode("combinationAuthorTeam", MatchMode.IGNORE);
@@ -133,41 +71,28 @@ public class MatchStrategyConfigurator {
                return strategy;
        }
 
-       /**
-        * @return the teamOrPersonMatchStrategy
-        */
-       private IMatchStrategy getTeamOrPersonMatchStrategy() throws MatchException{
-               if(teamOrPersonMatchStrategy == null){
-                       teamOrPersonMatchStrategy = getDefaultTeamOrPersonMatchStrategy();
-               }
-               return teamOrPersonMatchStrategy;
-       }
-       
        /**
         * 
         * @return
         */
        public static IMatchStrategy getDefaultTeamOrPersonMatchStrategy() throws MatchException{
-               IMatchStrategy strategy = DefaultMatchStrategy.NewInstance(TeamOrPersonBase.class);
+               IMatchStrategy strategy = PreferencesUtil.getDefaultMatchStrategy(TeamOrPersonBase.class);
                
                return strategy;
        }
        
 
-       /**
-        * @return the referenceMatchStrategy
-        */
-       private IMatchStrategy getReferenceMatchStrategy() throws MatchException{
-               if(referenceMatchStrategy == null){
-                       referenceMatchStrategy = getDefaultReferenceMatchStrategy();
-               }
-               return referenceMatchStrategy;
-       }
-       
        public static IMatchStrategy getDefaultReferenceMatchStrategy() throws MatchException{
-               DefaultMatchStrategy strategy = DefaultMatchStrategy.NewInstance(ReferenceBase.class);
+               IMatchStrategy strategy = PreferencesUtil.getDefaultMatchStrategy(ReferenceBase.class);
                
                return strategy;
        }
+
+       /**
+        * @param matchStrategy
+        */
+       public static void setMatchStrategy(IMatchStrategy matchStrategy) {
+               PreferencesUtil.setMatchStrategy(matchStrategy);
+       }
        
 }
diff --git a/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/AbstractMatchingPreferences.java b/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/AbstractMatchingPreferences.java
new file mode 100644 (file)
index 0000000..b386c3c
--- /dev/null
@@ -0,0 +1,249 @@
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.preference.matching;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
+import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
+import eu.etaxonomy.cdm.strategy.match.MatchException;
+import eu.etaxonomy.cdm.strategy.match.MatchMode;
+import eu.etaxonomy.taxeditor.parser.MatchStrategyConfigurator;
+
+/**
+ * @author n.hoffmann
+ * @created Jan 22, 2010
+ * @version 1.0
+ */
+public abstract class AbstractMatchingPreferences<T extends IdentifiableEntity> extends PreferencePage implements
+               IWorkbenchPreferencePage {
+       private static final Logger logger = Logger
+                       .getLogger(AbstractMatchingPreferences.class);
+
+       /**
+        * Fields that will be excluded from the display
+        */
+       private static final String ExcludePattern = "serialVersionUID|logger|allFields|ajc.*|id|updated|updatedBy|created|createdBy|uuid" +
+                               "|parsingProblem|problemStarts|problemEnds|PROTECTED|NOT_PROTECTED|propertyChangeSupport";
+
+       protected IMatchStrategy matchStrategy;
+       
+       protected Class<T> clazz;
+
+       private List<MatchMode> matchModeList;
+       
+       protected Map<String, Combo> matchModeCombos = new HashMap<String, Combo>();
+       
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+        */
+       @Override
+       protected Control createContents(Composite parent) {
+               final Composite composite = new Composite(parent, SWT.NULL);
+               GridLayout gridLayout = new GridLayout();
+               gridLayout.numColumns = 2;
+               composite.setLayout(gridLayout);
+               
+               
+               for(String fieldName : getFieldNames()){
+                       createFieldWidget(composite, fieldName);
+               }
+               
+               return composite;
+       }
+       
+       /**
+        * Creates a widget for a field consisting of the label and a combo
+        * 
+        * @see {@link #createMatchModeCombo(Composite, String, MatchMode)}
+        * @param composite
+        * @param fieldName
+        */
+       private void createFieldWidget(Composite parent, String fieldName) {
+               CLabel label = new CLabel(parent, SWT.NONE);
+               label.setText(fieldName);
+               
+               MatchMode matchMode = matchStrategy.getMatchMode(fieldName);
+               
+               createMatchModeCombo(parent, fieldName, matchMode);             
+       }       
+       
+       /**
+        * Creates a combo for a field with the currently selected match mode for that field preselected
+        * 
+        * @param parent
+        * @param matchMode
+        */
+       private void createMatchModeCombo(Composite parent, String fieldName, MatchMode selectedMatchMode) {
+               Combo matchModeCombo = new Combo(parent, SWT.NULL);
+               
+               for (MatchMode matchMode : getMatchModeList()) {
+                       matchModeCombo.add(matchMode.name());
+               }
+               
+               int index = getMatchModeList().indexOf(selectedMatchMode);
+               
+               matchModeCombo.select(index);
+               
+               matchModeCombo.addSelectionListener(new MatchModeComboSelectionListener(matchModeCombo, fieldName));
+               
+               matchModeCombos.put(fieldName, matchModeCombo);
+       }
+       
+       /**
+        * This listener updates the cache strategy when a value was changed in one of the combos
+        * 
+        * @author n.hoffmann
+        * @created Jan 28, 2010
+        * @version 1.0
+        */
+       private class MatchModeComboSelectionListener extends SelectionAdapter{
+               
+               private Combo matchModeCombo;
+               private String fieldName;
+
+               MatchModeComboSelectionListener(Combo matchModeCombo, String fieldName){
+                       this.matchModeCombo = matchModeCombo;
+                       this.fieldName = fieldName;
+               }
+               
+               /* (non-Javadoc)
+                * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+                */
+               @Override
+               public void widgetSelected(SelectionEvent e) {
+                       super.widgetSelected(e);
+                       MatchMode matchMode = getMatchModeList().get(matchModeCombo.getSelectionIndex());
+                       try {
+                               matchStrategy.setMatchMode(fieldName, matchMode);
+                       } catch (MatchException exception) {
+                               logger.error(e);
+                               throw new RuntimeException(exception);
+                       }
+               }
+       }
+
+       /**
+        * Transforms the MatchMode enum into a list.
+        * 
+        * @return
+        */
+       private List<MatchMode> getMatchModeList(){
+               if(matchModeList == null){
+                       matchModeList = Arrays.asList(MatchMode.values());
+               }
+               return matchModeList;
+       }
+
+       /**
+        * Get names of all declared fields
+        * 
+        * @return
+        */
+       private List<String> getFieldNames(){                           
+               List<Field> fields = new ArrayList<Field>();
+               
+               fields = getAllFields(fields, clazz);
+               List<String> fieldNames = new ArrayList<String>();
+               
+               for(Field field : fields){
+                       String fieldName = field.getName();
+                       if(! fieldName.matches(ExcludePattern)){
+                               fieldNames.add(fieldName);
+                       }
+               }
+               
+               return fieldNames;
+       }
+       
+       /**
+        * Get all declared fields including fields of the superclasses.
+        * 
+        * @param fields
+        * @param type
+        * @return
+        */
+       public static List<Field> getAllFields(List<Field> fields, Class<?> type) {
+        fields.addAll(Arrays.asList(type.getDeclaredFields()));
+
+           if (type.getSuperclass() != null) {
+               fields = getAllFields(fields, type.getSuperclass());
+           }
+
+           return fields;
+       }
+       
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.preference.PreferencePage#performApply()
+        */
+       @Override
+       protected void performApply() {
+               MatchStrategyConfigurator.setMatchStrategy(matchStrategy);
+               super.performApply();
+       }
+       
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
+        */
+       @Override
+       protected void performDefaults() {
+               try {
+                       // set match strategy to default
+                       matchStrategy = getDefaultMatchStrategy();
+                       
+                       // set combos to their default values
+                       for(String fieldName : matchModeCombos.keySet()){
+                               Combo combo = matchModeCombos.get(fieldName);
+                               MatchMode matchMode;
+                               if(matchStrategy.getMatchMode(fieldName) == null){
+                                       
+                                       matchMode = IMatchStrategy.defaultMatchMode;
+                                       
+                                       // TODO set default match modes for collections and other objects 
+                               }else{
+                                       matchMode = matchStrategy.getMatchMode(fieldName);
+                               }
+                               
+                               combo.select(matchModeList.indexOf(matchMode));
+                       }
+                       
+               } catch (MatchException e) {
+                       logger.error(e);
+                       throw new RuntimeException(e);
+               }
+               super.performDefaults();
+       }
+       
+       /**
+        * Returns the default match strategy for the respective class
+        * 
+        * @return
+        * @throws MatchException
+        */
+       protected abstract IMatchStrategy getDefaultMatchStrategy() throws MatchException;
+}
diff --git a/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/NonViralNameMatchingPreference.java b/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/NonViralNameMatchingPreference.java
new file mode 100644 (file)
index 0000000..eebb91a
--- /dev/null
@@ -0,0 +1,51 @@
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.preference.matching;
+
+import org.apache.log4j.Logger;
+import org.eclipse.ui.IWorkbench;
+
+import eu.etaxonomy.cdm.model.name.NonViralName;
+import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
+import eu.etaxonomy.cdm.strategy.match.MatchException;
+import eu.etaxonomy.taxeditor.parser.MatchStrategyConfigurator;
+
+/**
+ * @author n.hoffmann
+ * @created Jan 22, 2010
+ * @version 1.0
+ */
+public class NonViralNameMatchingPreference extends AbstractMatchingPreferences<NonViralName>{
+       private static final Logger logger = Logger
+                       .getLogger(NonViralNameMatchingPreference.class);
+
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+        */
+       public void init(IWorkbench workbench) {
+               clazz = NonViralName.class;
+               
+               try {
+                       matchStrategy = MatchStrategyConfigurator.NonViralNameMatchStrategy();
+               } catch (MatchException e) {
+                       logger.error(e);
+                       throw new RuntimeException(e);
+               }
+       }
+       
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.preference.matching.AbstractMatchingPreferences#getDefaultMatchStrategy()
+        */
+       @Override
+       protected IMatchStrategy getDefaultMatchStrategy() throws MatchException {
+               return MatchStrategyConfigurator.getDefaultNonViralNameMatchStrategy();
+       }
+}
diff --git a/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/ReferenceMatchingPreference.java b/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/ReferenceMatchingPreference.java
new file mode 100644 (file)
index 0000000..2fe30fd
--- /dev/null
@@ -0,0 +1,51 @@
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.preference.matching;
+
+import org.apache.log4j.Logger;
+import org.eclipse.ui.IWorkbench;
+
+import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
+import eu.etaxonomy.cdm.strategy.match.MatchException;
+import eu.etaxonomy.taxeditor.parser.MatchStrategyConfigurator;
+
+/**
+ * @author n.hoffmann
+ * @created Jan 22, 2010
+ * @version 1.0
+ */
+public class ReferenceMatchingPreference extends AbstractMatchingPreferences<ReferenceBase> {
+       private static final Logger logger = Logger
+                       .getLogger(ReferenceMatchingPreference.class);
+
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+        */
+       public void init(IWorkbench workbench) {
+               clazz = ReferenceBase.class;
+               
+               try {
+                       matchStrategy = MatchStrategyConfigurator.ReferenceMatchStrategy();
+               } catch (MatchException e) {
+                       logger.error(e);
+                       throw new RuntimeException(e);
+               }
+       }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.preference.matching.AbstractMatchingPreferences#getDefaultMatchStrategy()
+        */
+       @Override
+       protected IMatchStrategy getDefaultMatchStrategy() throws MatchException {
+               return MatchStrategyConfigurator.getDefaultReferenceMatchStrategy();
+       }
+}
diff --git a/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/TeamOrPersonMatchingPreference.java b/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/TeamOrPersonMatchingPreference.java
new file mode 100644 (file)
index 0000000..a68c676
--- /dev/null
@@ -0,0 +1,53 @@
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.preference.matching;
+
+import org.apache.log4j.Logger;
+import org.eclipse.ui.IWorkbench;
+
+import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
+import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
+import eu.etaxonomy.cdm.strategy.match.MatchException;
+import eu.etaxonomy.taxeditor.parser.MatchStrategyConfigurator;
+
+/**
+ * @author n.hoffmann
+ * @created Jan 22, 2010
+ * @version 1.0
+ */
+public class TeamOrPersonMatchingPreference extends
+               AbstractMatchingPreferences<TeamOrPersonBase> {
+       private static final Logger logger = Logger
+                       .getLogger(TeamOrPersonMatchingPreference.class);
+
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+        */
+       public void init(IWorkbench workbench) {
+
+               clazz = TeamOrPersonBase.class;
+               
+               try {
+                       matchStrategy = MatchStrategyConfigurator.TeamOrPersonMatchStrategy();
+               } catch (MatchException e) {
+                       logger.error(e);
+                       throw new RuntimeException(e);
+               }
+       }       
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.preference.matching.AbstractMatchingPreferences#getDefaultMatchStrategy()
+        */
+       @Override
+       protected IMatchStrategy getDefaultMatchStrategy() throws MatchException {
+               return  MatchStrategyConfigurator.getDefaultTeamOrPersonMatchStrategy();
+       }
+}