serial Version ID for HomGroup
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / name / BotanicalName.java
index ffba41cb7ac6a0226365fd2d7575132214f0a5df..56958f2c3198b6116a13de18dc809a54aec19b32 100644 (file)
@@ -52,13 +52,14 @@ import eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl;
 @Configurable
 public class BotanicalName extends NonViralName<BotanicalName> implements Cloneable /*, IMergable*/ {
        private static final long serialVersionUID = 6818651572463497727L;
+       @SuppressWarnings("unused")
        private static final Logger logger = Logger.getLogger(BotanicalName.class);
        
        //Only for fungi: to indicate that the type of the name is asexual or not
     @XmlElement(name ="IsAnamorphic")
        private boolean anamorphic;
 
-       static private INonViralNameParser nameParser = new NonViralNameParserImpl();
+       static private INonViralNameParser<?> nameParser = new NonViralNameParserImpl();
        
        // ************* CONSTRUCTORS *************/    
        //needed by hibernate
@@ -226,7 +227,7 @@ public class BotanicalName extends NonViralName<BotanicalName> implements Clonea
                if (nameParser == null){
                        nameParser = new NonViralNameParserImpl();
                }
-               return (BotanicalName)nameParser.parseFullName(fullNameString, NomenclaturalCode.ICBN,  rank);
+               return (BotanicalName)nameParser.parseFullName(fullNameString, NomenclaturalCode.ICNAFP,  rank);
        }
        
        /**
@@ -260,7 +261,7 @@ public class BotanicalName extends NonViralName<BotanicalName> implements Clonea
                if (nameParser == null){
                        nameParser = new NonViralNameParserImpl();
                }
-               return (BotanicalName)nameParser.parseReferencedName(fullNameAndReferenceString, NomenclaturalCode.ICBN, rank);
+               return (BotanicalName)nameParser.parseReferencedName(fullNameAndReferenceString, NomenclaturalCode.ICNAFP, rank);
        }
 
 //***********************      
@@ -309,7 +310,7 @@ public class BotanicalName extends NonViralName<BotanicalName> implements Clonea
         */
        @Override
        public NomenclaturalCode getNomenclaturalCode(){
-               return NomenclaturalCode.ICBN;
+               return NomenclaturalCode.ICNAFP;
        }
 
        
@@ -317,6 +318,7 @@ public class BotanicalName extends NonViralName<BotanicalName> implements Clonea
         * Checks if this name is an autonym.<BR>
         * An autonym is a taxon name that has equal specific and infra specific epithets.<BR>
         * {@link http://ibot.sav.sk/icbn/frameset/0010Ch2Sec1a006.htm#6.8. Vienna Code ยง6.8}
+        * or a taxon name that has equal generic and infrageneric epithets (A22.2)
         * @return true, if name has Rank, Rank is below species and species epithet equals infraSpeciesEpithtet, else false
         */
        @Override
@@ -324,6 +326,9 @@ public class BotanicalName extends NonViralName<BotanicalName> implements Clonea
                if (this.getRank() != null && this.getSpecificEpithet() != null && this.getInfraSpecificEpithet() != null && 
                                this.getRank().isInfraSpecific() && this.getSpecificEpithet().trim().equals(this.getInfraSpecificEpithet().trim())){
                        return true;
+               }else if (this.getRank() != null && this.getGenusOrUninomial() != null && this.getInfraGenericEpithet() != null && 
+                               this.getRank().isInfraGeneric() && this.getGenusOrUninomial().trim().equals(this.getInfraGenericEpithet().trim())){
+                       return true;
                }else{
                        return false;
                }