import org.hibernate.annotations.CascadeType;
import eu.etaxonomy.cdm.model.agent.Agent;
+import eu.etaxonomy.cdm.model.agent.INomenclaturalAuthor;
+import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
-import eu.etaxonomy.cdm.strategy.BotanicNameCacheStrategy;
-import eu.etaxonomy.cdm.strategy.ZooNameCacheStrategy;
+import eu.etaxonomy.cdm.strategy.cache.BotanicNameDefaultCacheStrategy;
+import eu.etaxonomy.cdm.strategy.parser.TaxonNameParserBotanicalNameImpl;
import java.util.*;
+import javax.naming.NameParser;
import javax.persistence.*;
/**
private boolean isAnamorphic;
private Set<HybridRelationship> hybridRelationships = new HashSet();
+ /**
+ * @param rank
+ * @return
+ */
+ public static BotanicalName NewInstance(Rank rank){
+ return new BotanicalName(rank, null);
+ }
+
+
+ /**
+ * @param rank
+ * @param homotypicalGroup
+ * @return
+ */
+ public static BotanicalName NewInstance(Rank rank, HomotypicalGroup homotypicalGroup){
+ return new BotanicalName(rank, homotypicalGroup);
+ }
+
+ public static BotanicalName NewInstance(Rank rank, String genusOrUninomial, String specificEpithet, String infraSpecificEpithet, TeamOrPersonBase combinationAuthorTeam, INomenclaturalReference nomenclaturalReference, String nomenclMicroRef, HomotypicalGroup homotypicalGroup) {
+ return new BotanicalName(rank, genusOrUninomial, specificEpithet, infraSpecificEpithet, combinationAuthorTeam, nomenclaturalReference, nomenclMicroRef, homotypicalGroup);
+ }
+
+ /**
+ * Returns a parsed Name
+ * @param fullName
+ * @return
+ */
+ public static BotanicalName PARSED_NAME(String fullNameString){
+ return PARSED_NAME(fullNameString, Rank.GENUS());
+ }
+
+ /**
+ * Returns a parsed Name
+ * @param fullName
+ * @return
+ */
+ public static BotanicalName PARSED_NAME(String fullNameString, Rank rank){
+ if (nameParser == null){
+ nameParser = new TaxonNameParserBotanicalNameImpl();
+ }
+ return (BotanicalName)nameParser.parseFullName(fullNameString, rank);
+ }
+
+ /**
+ * Returns a parsed Name
+ * @param fullName
+ * @return
+ */
+ public static BotanicalName PARSED_REFERENCE(String fullNameAndReferenceString){
+ return PARSED_REFERENCE(fullNameAndReferenceString, Rank.GENUS());
+ }
+
+ /**
+ * Returns a parsed Name
+ * @param fullName
+ * @return
+ */
+ public static BotanicalName PARSED_REFERENCE(String fullNameAndReferenceString, Rank rank){
+ if (nameParser == null){
+ nameParser = new TaxonNameParserBotanicalNameImpl();
+ }
+ return (BotanicalName)nameParser.parseFullReference(fullNameAndReferenceString, rank);
+ }
+
//needed by hibernate
protected BotanicalName(){
super();
- this.cacheStrategy = BotanicNameCacheStrategy.NewInstance();
+ this.cacheStrategy = BotanicNameDefaultCacheStrategy.NewInstance();
}
- public BotanicalName(Rank rank) {
- super(rank);
- this.cacheStrategy = BotanicNameCacheStrategy.NewInstance();
+ protected BotanicalName(Rank rank, HomotypicalGroup homotypicalGroup) {
+ super(rank, homotypicalGroup);
+ this.cacheStrategy = BotanicNameDefaultCacheStrategy.NewInstance();
}
- public BotanicalName(Rank rank, String genusOrUninomial, String specificEpithet, String infraSpecificEpithet, Agent combinationAuthorTeam, INomenclaturalReference nomenclaturalReference, String nomenclMicroRef) {
- super(rank, genusOrUninomial, specificEpithet, infraSpecificEpithet, combinationAuthorTeam, nomenclaturalReference, nomenclMicroRef);
- this.cacheStrategy = BotanicNameCacheStrategy.NewInstance();
+ protected BotanicalName(Rank rank, String genusOrUninomial, String specificEpithet, String infraSpecificEpithet, TeamOrPersonBase combinationAuthorTeam, INomenclaturalReference nomenclaturalReference, String nomenclMicroRef, HomotypicalGroup homotypicalGroup) {
+ super(rank, genusOrUninomial, specificEpithet, infraSpecificEpithet, combinationAuthorTeam, nomenclaturalReference, nomenclMicroRef, homotypicalGroup);
+ this.cacheStrategy = BotanicNameDefaultCacheStrategy.NewInstance();
}