minor
authorn.hoffmann <n.hoffmann@localhost>
Mon, 18 Apr 2011 13:27:16 +0000 (13:27 +0000)
committern.hoffmann <n.hoffmann@localhost>
Mon, 18 Apr 2011 13:27:16 +0000 (13:27 +0000)
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/entitycreator/OccurrenceCreator.java

index 2f1449f27ee251eb32d34093c4614a0e35195cba..cba6a807eacc46306c9d01ae5931fbfdc5c0560f 100644 (file)
@@ -1,12 +1,12 @@
 // $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.
-*/
+ * 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.bulkeditor.input.entitycreator;
 
@@ -26,47 +26,46 @@ import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
 
 /**
- * <p>OccurrenceCreator class.</p>
- *
+ * <p>
+ * OccurrenceCreator class.
+ * </p>
+ * 
  * @author n.hoffmann
  * @created Jun 16, 2010
  * @version 1.0
  */
-public class OccurrenceCreator implements IEntityCreator<SpecimenOrObservationBase> {
+public class OccurrenceCreator implements
+               IEntityCreator<SpecimenOrObservationBase> {
        private static final Logger logger = Logger
                        .getLogger(OccurrenceCreator.class);
 
        /** {@inheritDoc} */
+       @Override
        public SpecimenOrObservationBase createEntity(String text) {
                return createEntity(Specimen.class, text);
        }
 
        /** {@inheritDoc} */
+       @Override
        public SpecimenOrObservationBase createEntity(Object key, String text) {
                SpecimenOrObservationBase specimenOrObservation = null;
-               
-               if (FieldObservation.class.equals(((Class) key))) {
+
+               if (FieldObservation.class.equals((key))) {
                        specimenOrObservation = FieldObservation.NewInstance();
-               }
-               else if (DerivedUnit.class.equals(((Class) key))) {
+               } else if (DerivedUnit.class.equals((key))) {
                        specimenOrObservation = DerivedUnit.NewInstance();
-               }
-               else if (LivingBeing.class.equals(((Class) key))) {
+               } else if (LivingBeing.class.equals((key))) {
                        specimenOrObservation = LivingBeing.NewInstance();
-               }
-               else if (Observation.class.equals(((Class) key))) {
+               } else if (Observation.class.equals((key))) {
                        specimenOrObservation = Observation.NewInstance();
-               }
-               else if (Specimen.class.equals(((Class) key))) {
+               } else if (Specimen.class.equals((key))) {
                        specimenOrObservation = Specimen.NewInstance();
-               }
-               else if (DnaSample.class.equals(((Class) key))) {
+               } else if (DnaSample.class.equals((key))) {
                        specimenOrObservation = DnaSample.NewInstance();
-               }
-               else if (Fossil.class.equals(((Class) key))) {
+               } else if (Fossil.class.equals((key))) {
                        specimenOrObservation = Fossil.NewInstance();
                }
-               
+
                if (specimenOrObservation != null) {
                        specimenOrObservation.setTitleCache(text);
                }
@@ -74,19 +73,29 @@ public class OccurrenceCreator implements IEntityCreator<SpecimenOrObservationBa
        }
 
        /**
-        * <p>getKeyLabelPairs</p>
-        *
+        * <p>
+        * getKeyLabelPairs
+        * </p>
+        * 
         * @return a {@link java.util.Map} object.
         */
+       @Override
        public Map<Object, String> getKeyLabelPairs() {
                Map<Object, String> result = new HashMap<Object, String>();
-               result.put(FieldObservation.class, "Field Observation");
-               result.put(DerivedUnit.class, "Derived Unit");
-               result.put(LivingBeing.class, "Living Being");
-               result.put(Observation.class, "Observation");
+
                result.put(Specimen.class, "Specimen");
-               result.put(DnaSample.class, "Dna Sample");
+               result.put(Observation.class, "Observation");
+               result.put(LivingBeing.class, "Living Being");
                result.put(Fossil.class, "Fossil");
+               result.put(DerivedUnit.class, "Derived Unit");
+
+               // Omitted at the moment see #2266
+               // result.put(DnaSample.class, "Dna Sample");
+
+               // Omitted see #2266
+               // result.put(FieldObservation.class, "Field Observation");
+               // result.put(Observation.class, "Observation");
+
                return result;
        }
 }