Project

General

Profile

Revision da39aca0

IDda39aca026dcb27e0feaf0bc6fb565b0e87dc98a
Parent 0d8c0513
Child e8b59a14

Added by Andreas Müller over 2 years ago

ref #6365 merge static methods from BotanicaName to TaxonNameBase

View differences:

cdmlib-ext/src/main/java/eu/etaxonomy/cdm/ext/ipni/IpniService.java
47 47
import eu.etaxonomy.cdm.model.name.NomenclaturalStatus;
48 48
import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType;
49 49
import eu.etaxonomy.cdm.model.name.Rank;
50
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
50 51
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
51 52
import eu.etaxonomy.cdm.model.reference.Reference;
52 53
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
......
464 465
			valueMap.put(parameterMap.get(i), splits[i]);
465 466
		}
466 467

  
467
		BotanicalName name = BotanicalName.NewInstance(null);
468
		BotanicalName name = TaxonNameBase.NewBotanicalInstance(null);
468 469

  
469 470
		//caches
470 471
		name.setNameCache(valueMap.get(FULL_NAME_WITHOUT_FAMILY_AND_AUTHORS), true);
......
513 514
		name.addAnnotation(annotation);
514 515

  
515 516
		//basionym
516
		BotanicalName basionym = BotanicalName.NewInstance(null);
517
		BotanicalName basionym = TaxonNameBase.NewBotanicalInstance(null);
517 518
		basionym.setTitleCache(valueMap.get(BASIONYM), true);
518 519
		name.addBasionym(basionym);
519 520

  
520 521
		//replaced synonym
521
		BotanicalName replacedSynoynm = BotanicalName.NewInstance(null);
522
		BotanicalName replacedSynoynm = TaxonNameBase.NewBotanicalInstance(null);
522 523
		replacedSynoynm.setTitleCache(valueMap.get(REPLACED_SYNONYM), true);
523 524
		name.addReplacedSynonym(replacedSynoynm, null, null, null);
524 525

  
cdmlib-ext/src/main/java/eu/etaxonomy/cdm/ext/occurrence/gbif/GbifJsonOccurrenceParser.java
251 251
                            if (string.equals(NomenclaturalCode.ICZN.getTitleCache())){
252 252
                                name = TaxonNameBase.NewZoologicalInstance(rank);
253 253
                            } else if (string.equals(NomenclaturalCode.ICNAFP.getTitleCache())) {
254
                                name = BotanicalName.NewInstance(rank);
254
                                name = TaxonNameBase.NewBotanicalInstance(rank);
255 255
                            } else if (string.equals(NomenclaturalCode.ICNB.getTitleCache())){
256 256
                                name = TaxonNameBase.NewBacterialInstance(rank);
257 257
                            } else if (string.equals(NomenclaturalCode.ICNCP.getTitleCache())){
......
263 263
                        }else {
264 264
                            if (record.has(KINGDOM)){
265 265
                                if (record.getString(KINGDOM).equals(PLANTAE)){
266
                                    name = BotanicalName.NewInstance(rank);
266
                                    name = TaxonNameBase.NewBotanicalInstance(rank);
267 267
                                } else if (record.getString(KINGDOM).equals(ANIMALIA)){
268 268
                                    name = TaxonNameBase.NewZoologicalInstance(rank);
269 269
                                } else if (record.getString(KINGDOM).equals(FUNGI)){
270
                                    name = BotanicalName.NewInstance(rank);
270
                                    name = TaxonNameBase.NewBotanicalInstance(rank);
271 271
                                } else if (record.getString(KINGDOM).equals(BACTERIA)){
272 272
                                    name = TaxonNameBase.NewBacterialInstance(rank);
273 273
                                } else{
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/excel/taxa/NormalExplicitImport.java
504 504
        if (nc.isKindOf(NomenclaturalCode.ICZN)){
505 505
            name = TaxonNameBase.NewZoologicalInstance(taxonBase.getName().getRank());
506 506
        }else if (nc.isKindOf(NomenclaturalCode.ICNAFP)){
507
            name = BotanicalName.NewInstance(taxonBase.getName().getRank());
507
            name = TaxonNameBase.NewBotanicalInstance(taxonBase.getName().getRank());
508 508
        } else{
509 509
            name = TaxonNameBase.NewNonViralInstance(taxonBase.getName().getRank());
510 510
        }
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/specimen/SpecimenImportBase.java
160 160
            //create new taxon name
161 161

  
162 162
            if (state.getDataHolder().getNomenclatureCode().equals(NomenclaturalCode.ICNAFP)){
163
                taxonName = BotanicalName.NewInstance(rank);
163
                taxonName = TaxonNameBase.NewBotanicalInstance(rank);
164 164
            }else if (state.getDataHolder().getNomenclatureCode().equals(NomenclaturalCode.ICZN)){
165 165
                taxonName = TaxonNameBase.NewZoologicalInstance(rank);
166 166
            }else{
......
347 347
	                return taxonName;
348 348
	            }
349 349
	            else{
350
	                taxonName = BotanicalName.NewInstance(null);
350
	                taxonName = TaxonNameBase.NewBotanicalInstance(null);
351 351
	            }
352 352
	            taxonName.setFullTitleCache(fullName, true);
353 353
	            taxonName.setGenusOrUninomial(NB(getFromMap(atomisedMap, "Genus")));
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/specimen/excel/in/SpecimenCdmExcelImport.java
538 538
		if (StringUtils.isNotBlank(commonDetermination.determinedBy)){
539 539
			sec = ReferenceFactory.newGeneric();
540 540
			TeamOrPersonBase<?> determinedBy;
541
			BotanicalName dummyName = BotanicalName.NewInstance(Rank.SPECIES());
541
			BotanicalName dummyName = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
542 542
			try {
543 543
				parser.parseAuthors(dummyName, commonDetermination.determinedBy);
544 544
				determinedBy = dummyName.getCombinationAuthorship();
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/taxonx/TaxonXDescriptionImport.java
188 188

  
189 189
	private Taxon getTaxon(TaxonXImportConfigurator config){
190 190
		Taxon result;
191
//		result =  Taxon.NewInstance(BotanicalName.NewInstance(null), null);
191
//		result =  Taxon.NewInstance(TaxonNameBase.NewBotanicalInstance(null), null);
192 192
		ICommonService commonService = getCommonService();
193 193

  
194 194
		String originalSourceId = config.getOriginalSourceId();
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/taxonx/TaxonXNomenclatureImport.java
133 133

  
134 134
	private Taxon getTaxon(TaxonXImportConfigurator config){
135 135
		Taxon result;
136
//		result =  Taxon.NewInstance(BotanicalName.NewInstance(null), null);
136
//		result =  Taxon.NewInstance(TaxonNameBase.NewBotanicalInstance(null), null);
137 137
		//ICommonService commonService =config.getCdmAppController().getCommonService();
138 138
		ICommonService commonService = getCommonService();
139 139
		String originalSourceId = config.getOriginalSourceId();
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/taxonx2013/TaxonXTreatmentExtractor.java
1972 1972
                fullname =  getFullReference(name,nameTBF.getParsingProblems());
1973 1973
            }
1974 1974
            if (nomenclaturalCode.equals(NomenclaturalCode.ICNAFP)){
1975
                nameTBF = BotanicalName.NewInstance(null);
1975
                nameTBF = TaxonNameBase.NewBotanicalInstance(null);
1976 1976
            }
1977 1977
            if (nomenclaturalCode.equals(NomenclaturalCode.ICZN)){
1978 1978
                nameTBF = ZoologicalName.NewInstance(null);
......
2305 2305

  
2306 2306
                    NonViralName<?> nameToBeFilled = null;
2307 2307
                    if (nomenclaturalCode.equals(NomenclaturalCode.ICNAFP)){
2308
                        nameToBeFilled = BotanicalName.NewInstance(null);
2308
                        nameToBeFilled = TaxonNameBase.NewBotanicalInstance(null);
2309 2309
                    }
2310 2310
                    if (nomenclaturalCode.equals(NomenclaturalCode.ICZN)){
2311 2311
                        nameToBeFilled = ZoologicalName.NewInstance(null);
cdmlib-io/src/test/java/eu/etaxonomy/cdm/io/dwca/in/DatabaseMappingTest.java
22 22
import eu.etaxonomy.cdm.database.ICdmDataSource;
23 23
import eu.etaxonomy.cdm.io.dwca.in.IImportMapping.CdmKey;
24 24
import eu.etaxonomy.cdm.model.name.BotanicalName;
25
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
25 26

  
26 27
/**
27 28
 * @author a.mueller
......
76 77
		ICdmDataSource datasource = mapping.getDatabase();
77 78
		Assert.assertNotNull("Datasource should not be null", datasource);
78 79

  
79
		BotanicalName botName1 = BotanicalName.NewInstance(null);
80
		BotanicalName botName1 = TaxonNameBase.NewBotanicalInstance(null);
80 81
		int id = 23;
81 82
		botName1.setId(id);
82 83
		String sourceNS = "sourceNS";
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/BotanicalName.java
10 10
package eu.etaxonomy.cdm.model.name;
11 11

  
12 12

  
13
import java.util.Map;
14

  
15 13
import javax.persistence.Entity;
16 14
import javax.xml.bind.annotation.XmlAccessType;
17 15
import javax.xml.bind.annotation.XmlAccessorType;
......
24 22
import org.hibernate.search.annotations.Indexed;
25 23
import org.springframework.beans.factory.annotation.Configurable;
26 24

  
27
import eu.etaxonomy.cdm.common.CdmUtils;
28 25
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
29
import eu.etaxonomy.cdm.model.common.CdmBase;
30 26
import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
31 27
import eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy;
32
import eu.etaxonomy.cdm.strategy.parser.INonViralNameParser;
33
import eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl;
34 28

  
35 29
/**
36 30
 * The taxon name class for plants and fungi.
......
38 32
 * This class corresponds to: NameBotanical according to the ABCD schema.
39 33
 *
40 34
 * @author m.doering
41
 * @version 1.0
42 35
 * @created 08-Nov-2007 13:06:15
43 36
 */
44 37
@XmlAccessorType(XmlAccessType.FIELD)
45 38
@XmlType(name = "BotanicalName", propOrder = {
46
    "anamorphic"
39
        "anamorphic"
47 40
})
48 41
@XmlRootElement(name = "BotanicalName")
49 42
@Entity
......
52 45
@Configurable
53 46
public class BotanicalName
54 47
            extends NonViralName<BotanicalName>
55
            implements IBotanicalName /*, IMergable*/ {
56
	private static final long serialVersionUID = 6818651572463497727L;
57
	@SuppressWarnings("unused")
48
            /*, IMergable*/ {
49
    private static final long serialVersionUID = -3484146190510367749L;
50
    @SuppressWarnings("unused")
58 51
	private static final Logger logger = Logger.getLogger(BotanicalName.class);
59 52

  
60
	//Only for fungi: to indicate that the type of the name is asexual or not
53
//    IBotanicalName,
54

  
55
    //ICNAFP
56

  
57
    //Only for fungi: to indicate that the type of the name is asexual or not
61 58
    @XmlElement(name ="IsAnamorphic")
62
	private boolean anamorphic;
59
    private boolean anamorphic = false;
60

  
61
    // ************* ICNAFP Names
62

  
63
    /**
64
     * Returns the boolean value of the flag indicating whether the specimen
65
     * type of <i>this</i> botanical taxon name for a fungus is asexual (true) or not
66
     * (false). This applies only in case of fungi. The Article 59 of the ICBN
67
     * permits mycologists to give asexually reproducing fungi (anamorphs)
68
     * separate names from their sexual states (teleomorphs).
69
     *
70
     * @return  the boolean value of the isAnamorphic flag
71
     */
72
    public boolean isAnamorphic(){
73
        return this.anamorphic;
74
    }
63 75

  
64
	static private INonViralNameParser<?> nameParser = new NonViralNameParserImpl();
76
    /**
77
     * @see  #isAnamorphic()
78
     */
79
    public void setAnamorphic(boolean anamorphic){
80
        this.anamorphic = anamorphic;
81
    }
65 82

  
66 83
	// ************* CONSTRUCTORS *************/
67 84
	//needed by hibernate
......
122 139
	 * @param	homotypicalGroup  the homotypical group to which <i>this</i> botanical taxon name belongs
123 140
	 * @see 	#BotanicalName()
124 141
	 * @see 	#BotanicalName(Rank, HomotypicalGroup)
125
	 * @see		#NewInstance(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
142
	 * @see		#NewBotanicalInstance(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
126 143
	 * @see 	eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy
127 144
	 * @see 	eu.etaxonomy.cdm.strategy.cache.name.INonViralNameCacheStrategy
128 145
	 * @see 	eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy
......
133 150
	}
134 151

  
135 152

  
136
	//********* METHODS **************************************/
137

  
138
	/**
139
	 * Creates a new botanical taxon name instance
140
	 * only containing its {@link Rank rank} and
141
	 * the {@link eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy default cache strategy}.
142
	 *
143
	 * @param	rank	the rank to be assigned to <i>this</i> botanical taxon name
144
	 * @see 			#BotanicalName(Rank, HomotypicalGroup)
145
	 * @see 			#NewInstance(Rank, HomotypicalGroup)
146
	 * @see 			#NewInstance(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
147
	 * @see 			eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy
148
	 */
149
	public static BotanicalName NewInstance(Rank rank){
150
		return new BotanicalName(rank, null);
151
	}
152
	/**
153
	 * Creates a new botanical taxon name instance
154
	 * only containing its {@link Rank rank},
155
	 * its {@link HomotypicalGroup homotypical group} and
156
 	 * the {@link eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy default cache strategy}.
157
	 * The new botanical taxon name instance will be also added to the set of
158
	 * botanical taxon names belonging to this homotypical group.
159
	 *
160
	 * @param  rank  the rank to be assigned to <i>this</i> botanical taxon name
161
	 * @param  homotypicalGroup  the homotypical group to which <i>this</i> botanical taxon name belongs
162
	 * @see    #NewInstance(Rank)
163
	 * @see    #NewInstance(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
164
	 * @see    #BotanicalName(Rank, HomotypicalGroup)
165
	 * @see    eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy
166
	 */
167
	public static BotanicalName NewInstance(Rank rank, HomotypicalGroup homotypicalGroup){
168
		return new BotanicalName(rank, homotypicalGroup);
169
	}
170
	/**
171
	 * Creates a new botanical taxon name instance
172
	 * containing its {@link Rank rank},
173
	 * its {@link HomotypicalGroup homotypical group},
174
	 * its scientific name components, its {@link eu.etaxonomy.cdm.model.agent.TeamOrPersonBase author(team)},
175
	 * its {@link eu.etaxonomy.cdm.model.reference.INomenclaturalReference nomenclatural reference} and
176
	 * the {@link eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy default cache strategy}.
177
	 * The new botanical taxon name instance will be also added to the set of
178
	 * botanical taxon names belonging to this homotypical group.
179
	 *
180
	 * @param	rank  the rank to be assigned to <i>this</i> botanical taxon name
181
	 * @param	genusOrUninomial the string for <i>this</i> botanical taxon name
182
	 * 			if its rank is genus or higher or for the genus part
183
	 * 			if its rank is lower than genus
184
	 * @param	infraGenericEpithet  the string for the first epithet of
185
	 * 			<i>this</i> botanical taxon name if its rank is lower than genus
186
	 * 			and higher than species aggregate
187
	 * @param	specificEpithet  the string for the first epithet of
188
	 * 			<i>this</i> botanical taxon name if its rank is species aggregate or lower
189
	 * @param	infraSpecificEpithet  the string for the second epithet of
190
	 * 			<i>this</i> botanical taxon name if its rank is lower than species
191
	 * @param	combinationAuthorship  the author or the team who published <i>this</i> botanical taxon name
192
	 * @param	nomenclaturalReference  the nomenclatural reference where <i>this</i> botanical taxon name was published
193
	 * @param	nomenclMicroRef  the string with the details for precise location within the nomenclatural reference
194
	 * @param	homotypicalGroup  the homotypical group to which <i>this</i> botanical taxon name belongs
195
	 * @see 	#NewInstance(Rank)
196
	 * @see 	#NewInstance(Rank, HomotypicalGroup)
197
	 * @see		ZoologicalName#ZoologicalName(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
198
	 * @see 	eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy
199
	 */
200
	public static  BotanicalName NewInstance(Rank rank, String genusOrUninomial, String infraGenericEpithet, String specificEpithet, String infraSpecificEpithet, TeamOrPersonBase combinationAuthorship, INomenclaturalReference nomenclaturalReference, String nomenclMicroRef, HomotypicalGroup homotypicalGroup) {
201
		return new BotanicalName(rank, genusOrUninomial, infraGenericEpithet, specificEpithet, infraSpecificEpithet, combinationAuthorship, nomenclaturalReference, nomenclMicroRef, homotypicalGroup);
202
	}
203

  
204
	/**
205
	 * Returns a botanical taxon name based on parsing a string representing
206
	 * all elements (according to the ICBN) of a botanical taxon name (where
207
	 * the scientific name is an uninomial) including authorship but without
208
	 * nomenclatural reference. If the {@link Rank rank} is not "Genus" it should be
209
	 * set afterwards with the {@link TaxonNameBase#setRank(Rank) setRank} methode.
210
	 *
211
	 * @param	fullNameString  the string to be parsed
212
	 * @return					the new botanical taxon name
213
	 */
214
	public static BotanicalName PARSED_NAME(String fullNameString){
215
		return PARSED_NAME(fullNameString, Rank.GENUS());
216
	}
217

  
218
	/**
219
	 * Returns a botanical taxon name based on parsing a string representing
220
	 * all elements (according to the ICBN) of a botanical taxon name including
221
	 * authorship but without nomenclatural reference. The parsing result
222
	 * depends on the given rank of the botanical taxon name to be created.
223
	 *
224
	 * @param 	fullNameString  the string to be parsed
225
	 * @param   rank			the rank of the taxon name
226
	 * @return					the new botanical taxon name
227
	 */
228
	public static BotanicalName PARSED_NAME(String fullNameString, Rank rank){
229
		if (nameParser == null){
230
			nameParser = new NonViralNameParserImpl();
231
		}
232
		return (BotanicalName)nameParser.parseFullName(fullNameString, NomenclaturalCode.ICNAFP,  rank);
233
	}
234

  
235
	/**
236
	 * Returns a botanical taxon name based on parsing a string representing
237
	 * all elements (according to the ICBN) of a botanical taxon name (where
238
	 * the scientific name is an uninomial) including authorship and
239
	 * nomenclatural reference. Eventually a new {@link eu.etaxonomy.cdm.model.reference.INomenclaturalReference nomenclatural reference}
240
	 * instance will also be created. If the {@link Rank rank} is not "Genus" it should be
241
	 * set afterwards with the {@link TaxonNameBase#setRank(Rank) setRank} methode.
242
	 *
243
	 * @param	fullNameAndReferenceString  the string to be parsed
244
	 * @return								the new botanical taxon name
245
	 */
246
	public static BotanicalName PARSED_REFERENCE(String fullNameAndReferenceString){
247
		return PARSED_REFERENCE(fullNameAndReferenceString, Rank.GENUS());
248
	}
249

  
250
	/**
251
	 * Returns a botanical taxon name based on parsing a string representing
252
	 * all elements (according to the ICBN) of a botanical taxon name including
253
	 * authorship and nomenclatural reference. The parsing result depends on
254
	 * the given rank of the botanical taxon name to be created.
255
	 * Eventually a new {@link eu.etaxonomy.cdm.model.reference.INomenclaturalReference nomenclatural reference}
256
	 * instance will also be created.
257
	 *
258
	 * @param	fullNameAndReferenceString  the string to be parsed
259
	 * @param   rank						the rank of the taxon name
260
	 * @return								the new botanical taxon name
261
	 */
262
	public static BotanicalName PARSED_REFERENCE(String fullNameAndReferenceString, Rank rank){
263
		if (nameParser == null){
264
			nameParser = new NonViralNameParserImpl();
265
		}
266
		return (BotanicalName)nameParser.parseReferencedName(fullNameAndReferenceString, NomenclaturalCode.ICNAFP, rank);
267
	}
268

  
269
//***********************
270

  
271
	private static Map<String, java.lang.reflect.Field> allFields = null;
272
	@Override
273
    protected Map<String, java.lang.reflect.Field> getAllFields(){
274
    	if (allFields == null){
275
			allFields = CdmUtils.getAllFields(this.getClass(), CdmBase.class, false, false, false, true);
276
		}
277
    	return allFields;
278
    }
279

  
280 153
//*************************
281 154

  
282
	/**
283
	 * Returns the boolean value of the flag indicating whether the specimen
284
	 * type of <i>this</i> botanical taxon name for a fungus is asexual (true) or not
285
	 * (false). This applies only in case of fungi. The Article 59 of the ICBN
286
	 * permits mycologists to give asexually reproducing fungi (anamorphs)
287
	 * separate names from their sexual states (teleomorphs).
288
	 *
289
	 * @return  the boolean value of the isAnamorphic flag
290
	 */
291
	@Override
292
	public boolean isAnamorphic(){
293
		return this.anamorphic;
294
	}
295

  
296
	/**
297
	 * @see  #isAnamorphic()
298
	 */
299
	@Override
300
    public void setAnamorphic(boolean anamorphic){
301
		this.anamorphic = anamorphic;
302
	}
303 155

  
304 156

  
305 157
	/**
......
351 203
	@Override
352 204
	public Object clone() {
353 205
		BotanicalName result = (BotanicalName)super.clone();
354
		//no changes to: title, authorTeam, hasProblem, nomenclaturallyRelevant, uri
206
		//no changes to:
355 207
		return result;
356 208
	}
357 209

  
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/NomenclaturalCode.java
138 138

  
139 139
		switch (this){
140 140
		case ICNAFP:
141
			result = BotanicalName.NewInstance(rank);
141
			result = TaxonNameBase.NewBotanicalInstance(rank);
142 142
			break;
143 143
		case ICZN:
144 144
			result = TaxonNameBase.NewZoologicalInstance(rank);
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/TaxonNameBase.java
86 86
import eu.etaxonomy.cdm.strategy.match.MatchMode;
87 87
import eu.etaxonomy.cdm.strategy.merge.Merge;
88 88
import eu.etaxonomy.cdm.strategy.merge.MergeMode;
89
import eu.etaxonomy.cdm.strategy.parser.INonViralNameParser;
90
import eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl;
89 91
import eu.etaxonomy.cdm.strategy.parser.ParserProblem;
90 92
import eu.etaxonomy.cdm.validation.Level2;
91 93
import eu.etaxonomy.cdm.validation.Level3;
......
152 154
    "breed",
153 155
    "publicationYear",
154 156
    "originalPublicationYear"
157

  
158
//    "anamorphic",
155 159
})
156 160
@XmlRootElement(name = "TaxonNameBase")
157 161
@Entity
......
167 171
    private static final long serialVersionUID = -791164269603409712L;
168 172
    private static final Logger logger = Logger.getLogger(TaxonNameBase.class);
169 173

  
174
    static private INonViralNameParser<?> nameParser = new NonViralNameParserImpl();
175

  
170 176
    @XmlElement(name = "FullTitleCache")
171 177
    @Column(length=800, name="fullTitleCache")  //see #1592
172 178
    @Match(value=MatchMode.CACHE, cacheReplaceMode=ReplaceMode.ALL)
......
489 495
    @Min(0)
490 496
    private Integer originalPublicationYear;
491 497

  
498

  
492 499
// *************** FACTORY METHODS ********************************/
493 500

  
494 501
    /**
......
646 653
        return new ZoologicalName(rank, genusOrUninomial, infraGenericEpithet, specificEpithet, infraSpecificEpithet, combinationAuthorship, nomenclaturalReference, nomenclMicroRef, homotypicalGroup);
647 654
    }
648 655

  
656
    /**
657
     * Creates a new botanical taxon name instance
658
     * only containing its {@link Rank rank} and
659
     * the {@link eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy default cache strategy}.
660
     *
661
     * @param   rank    the rank to be assigned to <i>this</i> botanical taxon name
662
     * @see             #BotanicalName(Rank, HomotypicalGroup)
663
     * @see             #NewInstance(Rank, HomotypicalGroup)
664
     * @see             #NewBotanicalInstance(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
665
     * @see             eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy
666
     */
667
    public static BotanicalName NewBotanicalInstance(Rank rank){
668
        return new BotanicalName(rank, null);
669
    }
670
    /**
671
     * Creates a new botanical taxon name instance
672
     * only containing its {@link Rank rank},
673
     * its {@link HomotypicalGroup homotypical group} and
674
     * the {@link eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy default cache strategy}.
675
     * The new botanical taxon name instance will be also added to the set of
676
     * botanical taxon names belonging to this homotypical group.
677
     *
678
     * @param  rank  the rank to be assigned to <i>this</i> botanical taxon name
679
     * @param  homotypicalGroup  the homotypical group to which <i>this</i> botanical taxon name belongs
680
     * @see    #NewInstance(Rank)
681
     * @see    #NewBotanicalInstance(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
682
     * @see    #BotanicalName(Rank, HomotypicalGroup)
683
     * @see    eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy
684
     */
685
    public static BotanicalName NewBotanicalInstance(Rank rank, HomotypicalGroup homotypicalGroup){
686
        return new BotanicalName(rank, homotypicalGroup);
687
    }
688
    /**
689
     * Creates a new botanical taxon name instance
690
     * containing its {@link Rank rank},
691
     * its {@link HomotypicalGroup homotypical group},
692
     * its scientific name components, its {@link eu.etaxonomy.cdm.model.agent.TeamOrPersonBase author(team)},
693
     * its {@link eu.etaxonomy.cdm.model.reference.INomenclaturalReference nomenclatural reference} and
694
     * the {@link eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy default cache strategy}.
695
     * The new botanical taxon name instance will be also added to the set of
696
     * botanical taxon names belonging to this homotypical group.
697
     *
698
     * @param   rank  the rank to be assigned to <i>this</i> botanical taxon name
699
     * @param   genusOrUninomial the string for <i>this</i> botanical taxon name
700
     *          if its rank is genus or higher or for the genus part
701
     *          if its rank is lower than genus
702
     * @param   infraGenericEpithet  the string for the first epithet of
703
     *          <i>this</i> botanical taxon name if its rank is lower than genus
704
     *          and higher than species aggregate
705
     * @param   specificEpithet  the string for the first epithet of
706
     *          <i>this</i> botanical taxon name if its rank is species aggregate or lower
707
     * @param   infraSpecificEpithet  the string for the second epithet of
708
     *          <i>this</i> botanical taxon name if its rank is lower than species
709
     * @param   combinationAuthorship  the author or the team who published <i>this</i> botanical taxon name
710
     * @param   nomenclaturalReference  the nomenclatural reference where <i>this</i> botanical taxon name was published
711
     * @param   nomenclMicroRef  the string with the details for precise location within the nomenclatural reference
712
     * @param   homotypicalGroup  the homotypical group to which <i>this</i> botanical taxon name belongs
713
     * @see     #NewInstance(Rank)
714
     * @see     #NewInstance(Rank, HomotypicalGroup)
715
     * @see     ZoologicalName#ZoologicalName(Rank, String, String, String, String, TeamOrPersonBase, INomenclaturalReference, String, HomotypicalGroup)
716
     * @see     eu.etaxonomy.cdm.strategy.cache.name.BotanicNameDefaultCacheStrategy
717
     */
718
    public static  BotanicalName NewBotanicalInstance(Rank rank, String genusOrUninomial, String infraGenericEpithet, String specificEpithet, String infraSpecificEpithet, TeamOrPersonBase combinationAuthorship, INomenclaturalReference nomenclaturalReference, String nomenclMicroRef, HomotypicalGroup homotypicalGroup) {
719
        return new BotanicalName(rank, genusOrUninomial, infraGenericEpithet, specificEpithet, infraSpecificEpithet, combinationAuthorship, nomenclaturalReference, nomenclMicroRef, homotypicalGroup);
720
    }
721

  
722
// *********************** PARSER STATIC *******************************/
723

  
724

  
725
    /**
726
     * Returns a botanical taxon name based on parsing a string representing
727
     * all elements (according to the ICBN) of a botanical taxon name (where
728
     * the scientific name is an uninomial) including authorship but without
729
     * nomenclatural reference. If the {@link Rank rank} is not "Genus" it should be
730
     * set afterwards with the {@link TaxonNameBase#setRank(Rank) setRank} methode.
731
     *
732
     * @param   fullNameString  the string to be parsed
733
     * @return                  the new botanical taxon name
734
     */
735
    public static BotanicalName PARSED_BOTANICAL(String fullNameString){
736
        return PARSED_BOTANICAL(fullNameString, Rank.GENUS());
737
    }
738

  
739

  
740
    /**
741
     * Returns a botanical taxon name based on parsing a string representing
742
     * all elements (according to the ICBN) of a botanical taxon name including
743
     * authorship but without nomenclatural reference. The parsing result
744
     * depends on the given rank of the botanical taxon name to be created.
745
     *
746
     * @param   fullNameString  the string to be parsed
747
     * @param   rank            the rank of the taxon name
748
     * @return                  the new botanical taxon name
749
     */
750
    public static BotanicalName PARSED_BOTANICAL(String fullNameString, Rank rank){
751
        if (nameParser == null){
752
            nameParser = new NonViralNameParserImpl();
753
        }
754
        return (BotanicalName)nameParser.parseFullName(fullNameString, NomenclaturalCode.ICNAFP,  rank);
755
    }
756

  
757

  
758
    /**
759
     * Returns a botanical taxon name based on parsing a string representing
760
     * all elements (according to the ICBN) of a botanical taxon name (where
761
     * the scientific name is an uninomial) including authorship and
762
     * nomenclatural reference. Eventually a new {@link eu.etaxonomy.cdm.model.reference.INomenclaturalReference nomenclatural reference}
763
     * instance will also be created. If the {@link Rank rank} is not "Genus" it should be
764
     * set afterwards with the {@link TaxonNameBase#setRank(Rank) setRank} methode.
765
     *
766
     * @param   fullNameAndReferenceString  the string to be parsed
767
     * @return                              the new botanical taxon name
768
     */
769
    public static BotanicalName PARSED_BOTANICAL_REFERENCE(String fullNameAndReferenceString){
770
        return PARSED_BOTANICAL_REFERENCE(fullNameAndReferenceString, Rank.GENUS());
771
    }
772

  
773
    /**
774
     * Returns a botanical taxon name based on parsing a string representing
775
     * all elements (according to the ICBN) of a botanical taxon name including
776
     * authorship and nomenclatural reference. The parsing result depends on
777
     * the given rank of the botanical taxon name to be created.
778
     * Eventually a new {@link eu.etaxonomy.cdm.model.reference.INomenclaturalReference nomenclatural reference}
779
     * instance will also be created.
780
     *
781
     * @param   fullNameAndReferenceString  the string to be parsed
782
     * @param   rank                        the rank of the taxon name
783
     * @return                              the new botanical taxon name
784
     */
785
    public static BotanicalName PARSED_BOTANICAL_REFERENCE(String fullNameAndReferenceString, Rank rank){
786
        if (nameParser == null){
787
            nameParser = new NonViralNameParserImpl();
788
        }
789
        return (BotanicalName)nameParser.parseReferencedName(fullNameAndReferenceString, NomenclaturalCode.ICNAFP, rank);
790
    }
791

  
649 792
// ************* CONSTRUCTORS *************/
650 793
    /**
651 794
     * Class constructor: creates a new empty taxon name.
......
1404 1547
        this.originalPublicationYear = originalPublicationYear;
1405 1548
    }
1406 1549

  
1550

  
1407 1551
// **************** ADDER / REMOVE *************************/
1408 1552

  
1409 1553
    /**
......
3479 3623
            //binomHybrid, monomHybrid, trinomHybrid, hybridFormula,
3480 3624
            //acronym
3481 3625
            //subGenusAuthorship, nameApprobation
3626
            //anamorphic
3482 3627
            return result;
3483 3628
        } catch (CloneNotSupportedException e) {
3484 3629
            logger.warn("Object does not implement cloneable");
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/taxon/TaxonBaseDefaultCacheStrategy.java
91 91
    }
92 92

  
93 93
    private List<TaggedText> getNameTags(T taxonBase) {
94
        List<TaggedText> tags = new ArrayList<TaggedText>();
94
        List<TaggedText> tags = new ArrayList<>();
95 95
        TaxonNameBase<?,INameCacheStrategy<TaxonNameBase>> name = CdmBase.deproxy(taxonBase.getName());
96 96

  
97 97
        if (name != null){
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImpl.java
97 97
			boolean isCultivatedPlantName = false;
98 98
			if ( (isBotanicalName || isCultivatedPlantName) && ! isZoologicalName && !isBacteriologicalName){
99 99
				if (isBotanicalName){
100
					result = BotanicalName.NewInstance(rank);
100
					result = TaxonNameBase.NewBotanicalInstance(rank);
101 101
				}else{
102 102
					result = CultivarPlantName.NewInstance(rank);
103 103
				}
......
111 111
		} else {
112 112
			switch (code) {
113 113
			case ICNAFP:
114
				result = BotanicalName.NewInstance(rank);
114
				result = TaxonNameBase.NewBotanicalInstance(rank);
115 115
				break;
116 116
			case ICZN:
117 117
				result = TaxonNameBase.NewZoologicalInstance(rank);
cdmlib-model/src/test/java/eu/etaxonomy/cdm/aspectj/PropertyChangeTest.java
54 54

  
55 55
		@Test
56 56
		public void testPropertyChangeBoolean() {
57
			BotanicalName b = BotanicalName.NewInstance(Rank.SPECIES());
57
			BotanicalName b = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
58 58
			b.addPropertyChangeListener(this);
59 59
			b.setAnamorphic(true);
60 60
			assertEquals(b.isAnamorphic(), lastPropValue);
cdmlib-model/src/test/java/eu/etaxonomy/cdm/datagenerator/TaxonGenerator.java
17 17
import eu.etaxonomy.cdm.model.description.TextData;
18 18
import eu.etaxonomy.cdm.model.name.BotanicalName;
19 19
import eu.etaxonomy.cdm.model.name.Rank;
20
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
20 21
import eu.etaxonomy.cdm.model.reference.Reference;
21 22
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
22 23
import eu.etaxonomy.cdm.model.taxon.Synonym;
......
43 44
		citationRef.setTitleCache("Sp. lunarum", true);
44 45

  
45 46
        //genus taxon with Name, combinationAuthor,
46
		BotanicalName botName = BotanicalName.NewInstance(Rank.GENUS());
47
		BotanicalName botName = TaxonNameBase.NewBotanicalInstance(Rank.GENUS());
47 48
        botName.setTitleCache("Hieracium L.", true);
48 49
        botName.setGenusOrUninomial("Hieracium");
49 50
        botName.setCombinationAuthorship(Person.NewInstance());
......
51 52
        Taxon genusTaxon = Taxon.NewInstance(botName, sec);
52 53

  
53 54
        //a name that is the basionym of genusTaxon's name
54
        BotanicalName basionym = BotanicalName.NewInstance(Rank.GENUS());
55
        BotanicalName basionym = TaxonNameBase.NewBotanicalInstance(Rank.GENUS());
55 56
        basionym.setTitleCache("Hieracilla DC.", true);
56 57
        basionym.setGenusOrUninomial("Hieracilla");
57 58
        basionym.setCombinationAuthorship(deCandolle);
58 59
        botName.addBasionym(basionym, null, null, "216");
59 60

  
60 61
        //species taxon that is the child of genus taxon
61
        BotanicalName botSpecies = BotanicalName.NewInstance(Rank.SPECIES());
62
        BotanicalName botSpecies = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
62 63
        botSpecies.setTitleCache("Hieracium asturianum Pau", true);
63 64
        botSpecies.setGenusOrUninomial("Hieracium");
64 65
        botSpecies.setSpecificEpithet("asturianum");
......
67 68
        Taxon childTaxon = Taxon.NewInstance(botSpecies, sec);
68 69

  
69 70
        //homotypic synonym of childTaxon1
70
        BotanicalName botSpecies4= BotanicalName.NewInstance(Rank.SPECIES());
71
        BotanicalName botSpecies4= TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
71 72
        botSpecies4.setTitleCache("Hieracium gueri DC.", true);
72 73
        botSpecies4.setGenusOrUninomial("Hieracium");
73 74
        botSpecies4.setSpecificEpithet("gueri");
......
77 78

  
78 79

  
79 80
        //2nd child species taxon that is the child of genus taxon
80
        BotanicalName botSpecies2= BotanicalName.NewInstance(Rank.SPECIES());
81
        BotanicalName botSpecies2= TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
81 82
        botSpecies2.setTitleCache("Hieracium wolffii Zahn", true);
82 83
        botSpecies2.setGenusOrUninomial("Hieracium");
83 84
        botSpecies2.setSpecificEpithet("wolffii");
......
86 87
        Taxon childTaxon2 = Taxon.NewInstance(botSpecies2, sec);
87 88

  
88 89
        //heterotypic synonym of childTaxon2
89
        BotanicalName botSpecies3= BotanicalName.NewInstance(Rank.SPECIES());
90
        BotanicalName botSpecies3= TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
90 91
        botSpecies3.setTitleCache("Hieracium lupium DC.", true);
91 92
        botSpecies3.setGenusOrUninomial("Hieracium");
92 93
        botSpecies3.setSpecificEpithet("lupium");
......
95 96
        childTaxon2.addSynonym(heteroSynonym, SynonymType.HETEROTYPIC_SYNONYM_OF());
96 97

  
97 98
        //missaplied Name for childTaxon2
98
        BotanicalName missName= BotanicalName.NewInstance(Rank.SPECIES());
99
        BotanicalName missName= TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
99 100
        missName.setTitleCache("Hieracium lupium DC.", true);
100 101
        missName.setGenusOrUninomial("Hieracium");
101 102
        missName.setSpecificEpithet("lupium");
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/DatabaseInitialiser.java
15 15
import org.hibernate.Transaction;
16 16
import org.springframework.context.support.ClassPathXmlApplicationContext;
17 17

  
18
import eu.etaxonomy.cdm.model.name.BotanicalName;
19 18
import eu.etaxonomy.cdm.model.name.INonViralName;
20 19
import eu.etaxonomy.cdm.model.name.Rank;
20
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
21 21
//import eu.etaxonomy.cdm.model.reference.Journal;
22 22
import eu.etaxonomy.cdm.model.reference.IJournal;
23 23
import eu.etaxonomy.cdm.model.reference.Reference;
......
39 39
	public static Integer insertTaxon(String speciesname){
40 40
		logger.info("Populate database with a taxon");
41 41
		IJournal sec = ReferenceFactory.newJournal();
42
		INonViralName nvName = BotanicalName.NewInstance(Rank.SPECIES());
42
		INonViralName nvName = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
43 43
		Taxon tax = Taxon.NewInstance(nvName, (Reference)sec);
44 44
		nvName.setNameCache(speciesname);
45 45
		nvName.setTitleCache(speciesname, true);
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/common/AnnotationTest.java
25 25
import org.junit.Test;
26 26

  
27 27
import eu.etaxonomy.cdm.model.agent.Person;
28
import eu.etaxonomy.cdm.model.name.BotanicalName;
29 28
import eu.etaxonomy.cdm.model.name.Rank;
29
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
30 30
import eu.etaxonomy.cdm.test.unit.EntityTestBase;
31 31

  
32 32
/**
......
69 69
		commentator.setTitleCache("automatic importer", true);
70 70
		annotation1 = Annotation.NewInstance("anno1", Language.DEFAULT());
71 71
		annotation1.setCommentator(commentator);
72
		annotatedObject = BotanicalName.NewInstance(Rank.SPECIES());
72
		annotatedObject = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
73 73
		annotatedObject.addAnnotation(annotation1);
74 74
		linkbackUri = new URI("http://www.abc.de");
75 75
        annotation1.setLinkbackUri(linkbackUri);
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/common/IdentifiableEntityTest.java
197 197
		assertEquals(compareResult, equalsResult);
198 198

  
199 199
		//Abies alba x Pinus beta < Abies alba xinus
200
		BotanicalName abiesAlbaXinus = BotanicalName.NewInstance(Rank.SUBSPECIES());
200
		BotanicalName abiesAlbaXinus = TaxonNameBase.NewBotanicalInstance(Rank.SUBSPECIES());
201 201
		abiesAlbaXinus.setGenusOrUninomial("Abies");
202 202
		abiesAlbaXinus.setSpecificEpithet("alba");
203 203
		abiesAlbaXinus.setInfraSpecificEpithet("xinus");
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/common/MarkerTest.java
23 23
import org.junit.BeforeClass;
24 24
import org.junit.Test;
25 25

  
26
import eu.etaxonomy.cdm.model.name.BotanicalName;
27 26
import eu.etaxonomy.cdm.model.name.Rank;
27
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
28 28
import eu.etaxonomy.cdm.test.unit.EntityTestBase;
29 29

  
30 30
/**
......
63 63
		flag1 = true;
64 64
		markerType1 = MarkerType.TO_BE_CHECKED();
65 65
		marker1 = Marker.NewInstance(markerType1 ,  flag1);
66
		annotatedObject1 = BotanicalName.NewInstance(Rank.SPECIES());
66
		annotatedObject1 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
67 67
		annotatedObject1.addMarker(marker1);
68 68
	}
69 69

  
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/description/DescriptionElementTest.java
30 30
import eu.etaxonomy.cdm.model.common.TermType;
31 31
import eu.etaxonomy.cdm.model.common.TermVocabulary;
32 32
import eu.etaxonomy.cdm.model.media.Media;
33
import eu.etaxonomy.cdm.model.name.BotanicalName;
34 33
import eu.etaxonomy.cdm.model.name.Rank;
34
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
35 35
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
36 36
import eu.etaxonomy.cdm.model.reference.Reference;
37 37
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
......
96 96
		statisticalValue.setValue((float) 23.8);
97 97

  
98 98
		quantData.addStatisticalValue(statisticalValue);
99
		taxon = Taxon.NewInstance(BotanicalName.NewInstance(Rank.SPECIES(), "Abies", null, "alba", null, null, null, null, null), null);
99
		taxon = Taxon.NewInstance(TaxonNameBase.NewBotanicalInstance(Rank.SPECIES(), "Abies", null, "alba", null, null, null, null, null), null);
100 100
		taxonInteraction = TaxonInteraction.NewInstance();
101 101
		taxonInteraction.setTaxon2(taxon);
102 102
		langString = LanguageString.NewInstance("TestTaxonInteraction", Language.ENGLISH());
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/name/BotanicalNameTest.java
54 54
	@Test
55 55
	public final void testPARSED_NAME() {
56 56
		String fullName = "Abies alba subsp. beta (L.) Mill.";
57
		BotanicalName name = BotanicalName.PARSED_NAME(fullName);
57
		BotanicalName name = TaxonNameBase.PARSED_BOTANICAL(fullName);
58 58
		assertFalse(name.hasProblem());
59 59
		assertEquals("beta", name.getInfraSpecificEpithet());
60 60
	}
......
68 68
	@Test
69 69
	public final void testBotanicalNameRank() {
70 70
		Rank genus = Rank.GENUS();
71
		BotanicalName rankName = BotanicalName.NewInstance(genus);
71
		BotanicalName rankName = TaxonNameBase.NewBotanicalInstance(genus);
72 72
		assertNotNull(rankName);
73 73
		assertSame(genus, rankName.getRank());
74 74
		assertTrue(rankName.getRank().isGenus());
75
		BotanicalName nullRankName = BotanicalName.NewInstance(null);
75
		BotanicalName nullRankName = TaxonNameBase.NewBotanicalInstance(null);
76 76
		assertNotNull(nullRankName);
77 77
		assertNull(nullRankName.getRank());
78 78
	}
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/name/HomotypicalGroupTest.java
59 59
	 */
60 60
	@Before
61 61
	public void setUp() throws Exception {
62
		name1 = BotanicalName.NewInstance(Rank.SPECIES());
63
		name2 = BotanicalName.NewInstance(Rank.GENUS());
64
		name3 = BotanicalName.NewInstance(Rank.SUBSPECIES());
65
		name4 = BotanicalName.NewInstance(Rank.VARIETY());
62
		name1 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
63
		name2 = TaxonNameBase.NewBotanicalInstance(Rank.GENUS());
64
		name3 = TaxonNameBase.NewBotanicalInstance(Rank.SUBSPECIES());
65
		name4 = TaxonNameBase.NewBotanicalInstance(Rank.VARIETY());
66 66
	}
67 67

  
68 68
	/**
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/name/NonViralNameTest.java
283 283
		NonViralName<?> nonViralName1 = new NonViralName();
284 284
		assertEquals(0, nonViralName1.getHybridParentRelations().size());
285 285
		assertEquals(0, nonViralName1.getHybridChildRelations().size());
286
		BotanicalName femaleParent = BotanicalName.NewInstance(null);
286
		BotanicalName femaleParent = TaxonNameBase.NewBotanicalInstance(null);
287 287
		HybridRelationship hybridRelationship = new HybridRelationship(nonViralName1, femaleParent, HybridRelationshipType.FEMALE_PARENT(), null );
288 288
		assertEquals(1, nonViralName1.getHybridChildRelations().size());
289 289
		assertEquals(hybridRelationship, nonViralName1.getHybridChildRelations().iterator().next());
......
295 295
		NonViralName<?> nonViralName1 = new NonViralName();
296 296
		assertEquals(0, nonViralName1.getHybridParentRelations().size());
297 297
		assertEquals(0, nonViralName1.getHybridChildRelations().size());
298
		BotanicalName femaleParent = BotanicalName.NewInstance(null);
299
		BotanicalName maleParent = BotanicalName.NewInstance(null);
298
		BotanicalName femaleParent = TaxonNameBase.NewBotanicalInstance(null);
299
		BotanicalName maleParent = TaxonNameBase.NewBotanicalInstance(null);
300 300

  
301 301
		nonViralName1.addHybridParent(femaleParent, HybridRelationshipType.MALE_PARENT(), null);
302 302
		nonViralName1.addHybridParent(maleParent, HybridRelationshipType.MALE_PARENT(), null);
......
324 324
		NonViralName<?> botanicalName1 = new NonViralName();
325 325
		assertEquals(0, botanicalName1.getHybridParentRelations().size());
326 326
		assertEquals(0, botanicalName1.getHybridChildRelations().size());
327
		BotanicalName femaleParent = BotanicalName.NewInstance(null);
327
		BotanicalName femaleParent = TaxonNameBase.NewBotanicalInstance(null);
328 328
		NonViralName<?> maleParent = TaxonNameBase.NewNonViralInstance(null);
329 329
		ZoologicalName child = TaxonNameBase.NewZoologicalInstance(null);
330 330

  
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/name/TaxonNameBaseTest.java
261 261
	 */
262 262
	@Test
263 263
	public void testGetBasionym() {
264
		TaxonNameBase name1 = BotanicalName.NewInstance(null);
265
		TaxonNameBase basionym1 = BotanicalName.NewInstance(null);
266
		TaxonNameBase basionym2 = BotanicalName.NewInstance(null);
264
		TaxonNameBase name1 = TaxonNameBase.NewBotanicalInstance(null);
265
		TaxonNameBase basionym1 = TaxonNameBase.NewBotanicalInstance(null);
266
		TaxonNameBase basionym2 = TaxonNameBase.NewBotanicalInstance(null);
267 267

  
268 268
		assertEquals(null, name1.getBasionym());
269 269
		name1.addBasionym(basionym1);
......
318 318
	 */
319 319
	@Test
320 320
	public void testGetRank() {
321
		TaxonNameBase<?,?> name1 = BotanicalName.NewInstance(null);
321
		TaxonNameBase<?,?> name1 = TaxonNameBase.NewBotanicalInstance(null);
322 322
		assertNull("Rank shall be null", name1.getRank());
323 323
		name1.setRank(Rank.SPECIES());
324 324
		assertNotNull("Rank shall not be null", name1.getRank());
......
344 344
	 */
345 345
	@Test
346 346
	public void testGetAppendedPhrase() {
347
		TaxonNameBase<?,?> name1 = BotanicalName.NewInstance(null);
347
		TaxonNameBase<?,?> name1 = TaxonNameBase.NewBotanicalInstance(null);
348 348
		String appPhrase = "appPhrase";
349 349
		assertNull(name1.getAppendedPhrase());
350 350
		name1.setAppendedPhrase(appPhrase);
......
358 358
	 */
359 359
	@Test
360 360
	public void testGetSetNomenclaturalMicroReference() {
361
		TaxonNameBase<?,?> name1 = BotanicalName.NewInstance(null);
361
		TaxonNameBase<?,?> name1 = TaxonNameBase.NewBotanicalInstance(null);
362 362
		String microRef = "micro";
363 363
		assertNull(name1.getNomenclaturalMicroReference());
364 364
		name1.setNomenclaturalMicroReference(microRef);
......
372 372
	 */
373 373
	@Test
374 374
	public void testGetSetHasProblem() {
375
		TaxonNameBase<?,?> name1 = BotanicalName.NewInstance(null);
375
		TaxonNameBase<?,?> name1 = TaxonNameBase.NewBotanicalInstance(null);
376 376
		name1.setParsingProblem(0);
377 377
		assertFalse(name1.hasProblem());
378 378
		name1.setParsingProblem(1);
......
553 553

  
554 554
	@Test
555 555
	public void testMergeHomotypicGroups() {
556
		TaxonNameBase<?,?> name1 = BotanicalName.NewInstance(null);
557
		TaxonNameBase<?,?> name2 = BotanicalName.NewInstance(null);
558
		TaxonNameBase<?,?> name3 = BotanicalName.NewInstance(null);
559
		TaxonNameBase<?,?> name4 = BotanicalName.NewInstance(null);
556
		TaxonNameBase<?,?> name1 = TaxonNameBase.NewBotanicalInstance(null);
557
		TaxonNameBase<?,?> name2 = TaxonNameBase.NewBotanicalInstance(null);
558
		TaxonNameBase<?,?> name3 = TaxonNameBase.NewBotanicalInstance(null);
559
		TaxonNameBase<?,?> name4 = TaxonNameBase.NewBotanicalInstance(null);
560 560

  
561 561
		assertFalse(name1.getHomotypicalGroup().equals(name2.getHomotypicalGroup()));
562 562
		int numberOfTypifiedNames = name1.getHomotypicalGroup().getTypifiedNames().size();
......
594 594

  
595 595
	@Test
596 596
	public void testIsBasionymFor() {
597
		TaxonNameBase name1 = BotanicalName.NewInstance(null);
598
		TaxonNameBase name2 = BotanicalName.NewInstance(null);
599
		TaxonNameBase<?,?> name3 = BotanicalName.NewInstance(null);
600
		TaxonNameBase<?,?> name4 = BotanicalName.NewInstance(null);
597
		TaxonNameBase name1 = TaxonNameBase.NewBotanicalInstance(null);
598
		TaxonNameBase name2 = TaxonNameBase.NewBotanicalInstance(null);
599
		TaxonNameBase<?,?> name3 = TaxonNameBase.NewBotanicalInstance(null);
600
		TaxonNameBase<?,?> name4 = TaxonNameBase.NewBotanicalInstance(null);
601 601

  
602 602
		assertFalse(name2.isBasionymFor(name1));
603 603
		assertFalse(name1.isBasionymFor(name2));
......
611 611
	 */
612 612
	@Test
613 613
	public void testIsHomotypic() {
614
		TaxonNameBase<?,?> name1 = BotanicalName.NewInstance(null);
615
		TaxonNameBase<?,?> name2 = BotanicalName.NewInstance(null);
616
		TaxonNameBase<?,?> name3 = BotanicalName.NewInstance(null);
617
		TaxonNameBase<?,?> name4 = BotanicalName.NewInstance(null);
614
		TaxonNameBase<?,?> name1 = TaxonNameBase.NewBotanicalInstance(null);
615
		TaxonNameBase<?,?> name2 = TaxonNameBase.NewBotanicalInstance(null);
616
		TaxonNameBase<?,?> name3 = TaxonNameBase.NewBotanicalInstance(null);
617
		TaxonNameBase<?,?> name4 = TaxonNameBase.NewBotanicalInstance(null);
618 618
		name1.mergeHomotypicGroups(name2);
619 619
		name2.mergeHomotypicGroups(name4);
620 620

  
......
628 628

  
629 629
	@Test
630 630
	public void testMakeGroupsBasionym(){
631
		TaxonNameBase<?,?> name1 = BotanicalName.NewInstance(null);
632
		TaxonNameBase<?,?> name2 = BotanicalName.NewInstance(null);
633
		TaxonNameBase<?,?> name3 = BotanicalName.NewInstance(null);
634
		TaxonNameBase<?,?> name4 = BotanicalName.NewInstance(null);
631
		TaxonNameBase<?,?> name1 = TaxonNameBase.NewBotanicalInstance(null);
632
		TaxonNameBase<?,?> name2 = TaxonNameBase.NewBotanicalInstance(null);
633
		TaxonNameBase<?,?> name3 = TaxonNameBase.NewBotanicalInstance(null);
634
		TaxonNameBase<?,?> name4 = TaxonNameBase.NewBotanicalInstance(null);
635 635

  
636 636
		name1.mergeHomotypicGroups(name2);
637 637
		name1.mergeHomotypicGroups(name3);
......
648 648

  
649 649
	@Test
650 650
	public void testIsGroupsBasionym(){
651
		TaxonNameBase<?,?> name1 = BotanicalName.NewInstance(null);
652
		TaxonNameBase<?,?> name2 = BotanicalName.NewInstance(null);
653
		TaxonNameBase<?,?> name3 = BotanicalName.NewInstance(null);
654
		TaxonNameBase<?,?> name4 = BotanicalName.NewInstance(null);
651
		TaxonNameBase<?,?> name1 = TaxonNameBase.NewBotanicalInstance(null);
652
		TaxonNameBase<?,?> name2 = TaxonNameBase.NewBotanicalInstance(null);
653
		TaxonNameBase<?,?> name3 = TaxonNameBase.NewBotanicalInstance(null);
654
		TaxonNameBase<?,?> name4 = TaxonNameBase.NewBotanicalInstance(null);
655 655

  
656 656
		assertFalse(name1.isGroupsBasionym());
657 657

  
......
670 670

  
671 671
	@Test
672 672
	public void testRemoveBasionyms(){
673
		TaxonNameBase name1 = BotanicalName.NewInstance(null);
674
		TaxonNameBase basionym = BotanicalName.NewInstance(null);
675
		TaxonNameBase name3 = BotanicalName.NewInstance(null);
673
		TaxonNameBase name1 = TaxonNameBase.NewBotanicalInstance(null);
674
		TaxonNameBase basionym = TaxonNameBase.NewBotanicalInstance(null);
675
		TaxonNameBase name3 = TaxonNameBase.NewBotanicalInstance(null);
676 676

  
677 677
		name1.addBasionym(basionym);
678 678
		assertEquals(1, name1.getBasionyms().size());
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/occurrence/SpecimenTest.java
239 239
		PreservationMethod preservation = PreservationMethod.NewInstance();
240 240
		boolean protectedTitleCache = true;
241 241
		DefinedTerm sex = DefinedTerm.SEX_FEMALE();
242
		TaxonNameBase<?, ?> storedUnder = BotanicalName.NewInstance(Rank.GENUS());
242
		TaxonNameBase<?, ?> storedUnder = TaxonNameBase.NewBotanicalInstance(Rank.GENUS());
243 243
		String titleCache = "title";
244 244
		Calendar updated = Calendar.getInstance();
245 245
		Person updatedBy = Person.NewTitledInstance("updatedPerson");
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/taxon/ClassificationTest.java
98 98
		treeName1 = "Greuther, 1993";
99 99
		//refFactory = ReferenceFactory.newInstance();
100 100
		classification1 = Classification.NewInstance(treeName1);
101
		taxonName12 = BotanicalName.NewInstance(Rank.SPECIES());
102
		taxonName121 = BotanicalName.NewInstance(Rank.SUBSPECIES());
103
		taxonName1 = BotanicalName.NewInstance(Rank.GENUS());
101
		taxonName12 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
102
		taxonName121 = TaxonNameBase.NewBotanicalInstance(Rank.SUBSPECIES());
103
		taxonName1 = TaxonNameBase.NewBotanicalInstance(Rank.GENUS());
104 104
		taxonName2 = TaxonNameBase.NewZoologicalInstance(Rank.GENUS());
105
		taxonName3 = BotanicalName.NewInstance(Rank.SPECIES());
105
		taxonName3 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
106 106
		ref1 = ReferenceFactory.newJournal();
107 107
		ref2 = ReferenceFactory.newJournal();
108 108
		ref3 = ReferenceFactory.newJournal();
......
129 129
	 */
130 130
	@Test
131 131
	public void testAddRoot() {
132
		TaxonNameBase<?,?> synonymName = BotanicalName.NewInstance(Rank.SPECIES());
132
		TaxonNameBase<?,?> synonymName = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
133 133
		Synonym synonym = Synonym.NewInstance(synonymName, ref1);
134 134
		TaxonNode taxonNode1 = classification1.addChildTaxon(taxon1, null, null);
135 135
		taxonNode1.setSynonymToBeUsed(synonym);
......
230 230
	@Test
231 231
	public void testAddParentChild() {
232 232

  
233
		TaxonNameBase<?,?> synonymName = BotanicalName.NewInstance(Rank.SPECIES());
233
		TaxonNameBase<?,?> synonymName = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
234 234
		Synonym synonym = Synonym.NewInstance(synonymName, ref1);
235 235
		TaxonNode rootNode = classification1.addChildTaxon(taxon1, null, null);
236 236
		rootNode.setSynonymToBeUsed(synonym);
......
346 346
		//genericDao.getCdmBasesByFieldAndClass(clazz, field.getName(), value);
347 347

  
348 348

  
349
		BotanicalName name = BotanicalName.NewInstance(Rank.GENUS());
349
		BotanicalName name = TaxonNameBase.NewBotanicalInstance(Rank.GENUS());
350 350
		name.setTitleCache("A dummy name", true);
351 351
		result.add(name);
352 352
		Reference ref = ReferenceFactory.newBook();
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/taxon/HomotypicGroupTaxonComparatorTest.java
29 29
import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType;
30 30
import eu.etaxonomy.cdm.model.name.NonViralName;
31 31
import eu.etaxonomy.cdm.model.name.Rank;
32
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
32 33
//import eu.etaxonomy.cdm.model.reference.Book;
33 34
import eu.etaxonomy.cdm.model.reference.Reference;
34 35
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
......
87 88
        ref2.setDatePublished(TimePeriod.NewInstance(cal2));
88 89
        ref3.setDatePublished(TimePeriod.NewInstance(cal3));
89 90

  
90
        botName1 =  BotanicalName.NewInstance(Rank.SPECIES());
91
        botName2 =  BotanicalName.NewInstance(Rank.SPECIES());
92
        botName3 =  BotanicalName.NewInstance(Rank.SPECIES());
93
        botName4 =  BotanicalName.NewInstance(Rank.SPECIES());
94
        botName5 =  BotanicalName.NewInstance(Rank.SPECIES());
91
        botName1 =  TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
92
        botName2 =  TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
93
        botName3 =  TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
94
        botName4 =  TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
95
        botName5 =  TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
95 96

  
96 97
        setNameParts(botName1, "Aaa", "aaa");
97 98
        setNameParts(botName2, "Bbb", "bbb");
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/taxon/TaxonBaseTest.java
24 24
import eu.etaxonomy.cdm.model.name.BotanicalName;
25 25
import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
26 26
import eu.etaxonomy.cdm.model.name.Rank;
27
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
27 28
import eu.etaxonomy.cdm.model.name.ZoologicalName;
28 29
import eu.etaxonomy.cdm.model.reference.Reference;
29 30
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
......
58 59
	public void setUp() throws Exception {
59 60
		sec= ReferenceFactory.newBook();
60 61
		sec.setTitleCache("Schoenes saftiges Allg�u", true);
61
		name1 = ZoologicalName.NewZoologicalInstance(Rank.SPECIES(),"Panthera",null,"onca",null,null,null,"p.1467", null);
62
		name1 = TaxonNameBase.NewZoologicalInstance(Rank.SPECIES(),"Panthera",null,"onca",null,null,null,"p.1467", null);
62 63
		HomotypicalGroup homotypicalGroup = HomotypicalGroup.NewInstance();
63
		name2 = BotanicalName.NewInstance(Rank.SPECIES(),"Abies",null,"alba",null,null,null,"p.317", homotypicalGroup);
64
		name2 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES(),"Abies",null,"alba",null,null,null,"p.317", homotypicalGroup);
64 65
		// taxa
65 66
		taxon1 = Taxon.NewInstance(name1,sec);
66 67
		synonym1 = Synonym.NewInstance(name2,sec);
......
143 144

  
144 145
	public final void testClone(){
145 146

  
146
		BotanicalName test = BotanicalName.NewInstance(Rank.SPECIES());
147
		BotanicalName test = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
147 148
		String genus = "test";
148 149
		String infraGenericEpithet = "test";
149 150
		test.setGenusOrUninomial(genus);
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/taxon/TaxonComparatorTest.java
66 66
//		ref2.setDatePublished(TimePeriod.NewInstance(cal2));
67 67
        ref3.setDatePublished(TimePeriod.NewInstance(cal3));
68 68

  
69
        BotanicalName botName1 =  BotanicalName.NewInstance(null);
70
        BotanicalName botName2 =  BotanicalName.NewInstance(null);
71
        BotanicalName botName3 =  BotanicalName.NewInstance(null);
69
        BotanicalName botName1 =  TaxonNameBase.NewBotanicalInstance(null);
70
        BotanicalName botName2 =  TaxonNameBase.NewBotanicalInstance(null);
71
        BotanicalName botName3 =  TaxonNameBase.NewBotanicalInstance(null);
72 72
        ZoologicalName zooName1 = TaxonNameBase.NewZoologicalInstance(null);
73 73

  
74 74
        botName1.setNomenclaturalReference(ref1);
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/taxon/TaxonNodeByNameComparatorTest.java
18 18

  
19 19
import eu.etaxonomy.cdm.model.name.BotanicalName;
20 20
import eu.etaxonomy.cdm.model.name.Rank;
21
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
21 22
import eu.etaxonomy.cdm.model.reference.Reference;
22 23
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
23 24

  
......
29 30
public class TaxonNodeByNameComparatorTest {
30 31

  
31 32
    private static final Logger logger = Logger.getLogger(TaxonNodeByNameComparatorTest.class);
32
    
33
    
33

  
34

  
34 35
    /**
35 36
     * test method for {@link TaxonNodeByNameComparator#compare(eu.etaxonomy.cdm.model.taxon.TaxonNode
36 37
     * , eu.etaxonomy.cdm.model.taxon.TaxonNode) }
......
42 43

  
43 44
        Reference sec = ReferenceFactory.newBook();
44 45

  
45
        BotanicalName botname_1 = BotanicalName.NewInstance(Rank.SPECIES());
46
        BotanicalName botname_1 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
46 47
        String nameCache_1 = "Epilobium \u00D7aschersonianum Hausskn.";
47 48
        botname_1.setNameCache(nameCache_1, true);
48 49
        Taxon taxon_1 = Taxon.NewInstance(botname_1, sec);
49 50

  
50
        BotanicalName botname_2 = BotanicalName.NewInstance(Rank.SPECIES());
51
        BotanicalName botname_2 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
51 52
        String nameCache_2 = "\u00D7Epilobium \u00D7angustifolium";
52 53
        botname_2.setNameCache(nameCache_2, true);
53 54
        Taxon taxon_2 = Taxon.NewInstance(botname_2, sec);
54 55

  
55
        BotanicalName botname_3 = BotanicalName.NewInstance(Rank.SPECIES());
56
        BotanicalName botname_3 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
56 57
        String nameCache_3 = "Epilobium lamyi";
57 58
        botname_3.setNameCache(nameCache_3, true);
58 59
        Taxon taxon_3 = Taxon.NewInstance(botname_3, sec);
59 60

  
60
        BotanicalName botname_4 = BotanicalName.NewInstance(Rank.SPECIES());
61
        BotanicalName botname_4 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
61 62
        String nameCache_4 = "Epilobium tournefortii";
62 63
        botname_4.setNameCache(nameCache_4, true);
63 64
        Taxon taxon_4 = Taxon.NewInstance(botname_4, sec);
......
110 111

  
111 112
        Reference sec = ReferenceFactory.newBook();
112 113

  
113
        BotanicalName botname_1 = BotanicalName.NewInstance(Rank.SPECIES());
114
        BotanicalName botname_1 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
114 115
        String nameCache_1 = "Epilobium \u00D7aschersonianum Hausskn.";
115 116
        botname_1.setNameCache(nameCache_1, true);
116 117
        Taxon taxon_1 = Taxon.NewInstance(botname_1, sec);
117 118

  
118
        BotanicalName botname_2 = BotanicalName.NewInstance(Rank.SPECIES());
119
        BotanicalName botname_2 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
119 120
        String nameCache_2 = "\u00D7Epilobium \u00D7angustifolium";
120 121
        botname_2.setNameCache(nameCache_2, true);
121 122
        Taxon taxon_2 = Taxon.NewInstance(botname_2, sec);
......
137 138
        Assert.assertTrue(taxonNodeByNameComparator.compare(node1, node2) > 0);
138 139

  
139 140
    }
140
    
141

  
141 142
    /**
142 143
     * test method for {@link TaxonNodeByNameComparator#compare(eu.etaxonomy.cdm.model.taxon.TaxonNode
143 144
     * , eu.etaxonomy.cdm.model.taxon.TaxonNode) }
......
149 150

  
150 151
        Reference sec = ReferenceFactory.newBook();
151 152

  
152
        BotanicalName botname_1 = BotanicalName.NewInstance(Rank.SPECIES());
153
        BotanicalName botname_1 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
153 154
        String nameCache_1 = "Epilobium \u00D7aschersonianum Hausskn.";
154 155
        botname_1.setNameCache(nameCache_1, true);
155 156
        Taxon taxon_1 = Taxon.NewInstance(botname_1, sec);
156 157

  
157
        BotanicalName botname_2 = BotanicalName.NewInstance(Rank.SPECIES());
158
        BotanicalName botname_2 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
158 159
        String nameCache_2 = "\u00D7Epilobium \u00D7angustifolium";
159 160
        botname_2.setNameCache(nameCache_2, true);
160 161
        Taxon taxon_2 = Taxon.NewInstance(botname_2, sec);
161 162

  
162
        BotanicalName botname_3 = BotanicalName.NewInstance(Rank.SPECIES());
163
        BotanicalName botname_3 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
163 164
        String nameCache_3 = "Epilobium lamyi";
164 165
        botname_3.setNameCache(nameCache_3, true);
165 166
        Taxon taxon_3 = Taxon.NewInstance(botname_3, sec);
166 167

  
167
        BotanicalName botname_4 = BotanicalName.NewInstance(Rank.SPECIES());
168
        BotanicalName botname_4 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
168 169
        String nameCache_4 = "Epilobium tournefortii";
169 170
        botname_4.setNameCache(nameCache_4, true);
170 171
        Taxon taxon_4 = Taxon.NewInstance(botname_4, sec);
171
        
172
        BotanicalName botname_5 = BotanicalName.NewInstance(Rank.SPECIES());
172

  
173
        BotanicalName botname_5 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
173 174
        String nameCache_5= "Epilobium hirsutum L.";
174 175
        botname_5.setNameCache(nameCache_5, true);
175 176
        Taxon taxon_5 = Taxon.NewInstance(botname_5, sec);
......
180 181
        node2.addChildTaxon(taxon_4, sec, null);
181 182

  
182 183
        classification.getChildNodes();
183
        
184

  
184 185
        ArrayList<TaxonNode> taxonNodes = new ArrayList<TaxonNode>();
185 186
        taxonNodes.addAll(classification.getChildNodes());
186 187

  
187 188
        // order using default settings
188 189
        TaxonNaturalComparator taxonNodeComparator = new TaxonNaturalComparator();
189 190
       // Collections.sort(taxonNodes, taxonNodeComparator);
190
       
191

  
191 192
        int i = 0;
192 193
        logger.debug("order using default settings");
193 194
        logger.debug(((BotanicalName)taxonNodes.get(i).getTaxon().getName()).getNameCache());
......
198 199
        Assert.assertEquals(nameCache_3, ((BotanicalName)taxonNodes.get(i).getTaxon().getName()).getNameCache());
199 200
        logger.debug(((BotanicalName)taxonNodes.get(i++).getTaxon().getName()).getNameCache());
200 201
        Assert.assertEquals(nameCache_4, ((BotanicalName)taxonNodes.get(i).getTaxon().getName()).getNameCache());
201
       
202

  
202 203
        TaxonNode result = classification.addChildTaxon(taxon_5, 2, null, null);
203 204
        Assert.assertTrue(result.getSortIndex() == 2);
204
       
205

  
205 206
        i = 0;
206
    
207

  
207 208
        logger.debug(((BotanicalName)classification.getChildNodes().get(i).getTaxon().getName()).getNameCache());
208 209
        Assert.assertEquals(nameCache_1, ((BotanicalName)classification.getChildNodes().get(i).getTaxon().getName()).getNameCache());
209 210
        logger.debug(((BotanicalName)classification.getChildNodes().get(i++).getTaxon().getName()).getNameCache());
......
214 215
        Assert.assertEquals(nameCache_3, ((BotanicalName)classification.getChildNodes().get(i).getTaxon().getName()).getNameCache());
215 216

  
216 217
    }
217
    
218

  
218 219

  
219 220
}
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/taxon/TaxonNodeTest.java
77 77
		viewName1 = "Greuther, 1993";
78 78
		classification1 = Classification.NewInstance(viewName1);
79 79
		classification2 = Classification.NewInstance("Test View 2");
80
		taxonName1 = BotanicalName.NewInstance(Rank.SPECIES());
81
		taxonName1 = BotanicalName.NewInstance(Rank.SUBSPECIES());
82
		taxonName3 = BotanicalName.NewInstance(Rank.SPECIES());
80
		taxonName1 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
81
		taxonName1 = TaxonNameBase.NewBotanicalInstance(Rank.SUBSPECIES());
82
		taxonName3 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES());
83 83
		ref1 = ReferenceFactory.newJournal();
84 84
		ref2 = ReferenceFactory.newBook();
85 85
		ref3 = ReferenceFactory.newGeneric();
......
327 327
    	 *   `- Pinus pampa subsp. persicifolia
328 328
    	 */
329 329
    	Classification classification = Classification.NewInstance("Classification");
330
    	BotanicalName pinusName = BotanicalName.NewInstance(null);
330
    	BotanicalName pinusName = TaxonNameBase.NewBotanicalInstance(null);
331 331
    	pinusName.setGenusOrUninomial("Pinus");
332 332
    	Taxon pinus = Taxon.NewInstance(pinusName, null);
333
    	BotanicalName pinusPampaName = BotanicalName.NewInstance(null);
333
    	BotanicalName pinusPampaName = TaxonNameBase.NewBotanicalInstance(null);
334 334
    	pinusPampaName.setGenusOrUninomial("Pinus");
335 335
    	pinusPampaName.setSpecificEpithet("pampa");
336 336
    	Taxon pinusPampa = Taxon.NewInstance(pinusPampaName, null);
337
    	BotanicalName pinusPampaSubName = BotanicalName.NewInstance(null);
337
    	BotanicalName pinusPampaSubName = TaxonNameBase.NewBotanicalInstance(null);
338 338
    	pinusPampaSubName.setGenusOrUninomial("Pinus");
339 339
    	pinusPampaSubName.setSpecificEpithet("pampa");
340 340
    	pinusPampaSubName.setInfraSpecificEpithet("persicifolia");
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/taxon/TaxonTest.java
72 72
		misSec.setTitleCache("Stupid book", true);
73 73

  
74 74
		name1 = TaxonNameBase.NewZoologicalInstance(Rank.SPECIES(),"Panthera",null,"onca",null,linne,null,"p.1467", null);
75
		name2 = BotanicalName.NewInstance(Rank.SPECIES(),"Abies",null,"alba",null,linne,null,"p.317", null);
76
		name3 = BotanicalName.NewInstance(Rank.SUBSPECIES(),"Polygala",null,"vulgaris","alpina",linne,null,"p.191", null);
77
		name4 = BotanicalName.NewInstance(Rank.SPECIES(),"Cichoria",null,"carminata",null,linne,null,"p.14", null);
75
		name2 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES(),"Abies",null,"alba",null,linne,null,"p.317", null);
76
		name3 = TaxonNameBase.NewBotanicalInstance(Rank.SUBSPECIES(),"Polygala",null,"vulgaris","alpina",linne,null,"p.191", null);
77
		name4 = TaxonNameBase.NewBotanicalInstance(Rank.SPECIES(),"Cichoria",null,"carminata",null,linne,null,"p.14", null);
78 78
		rootT = Taxon.NewInstance(name1,sec);
79 79
		freeT = Taxon.NewInstance(name4,sec);
80 80
		// taxonomic children
......
186 186

  
187 187
    @Test
188 188
    public void testAddHomotypicSynonymName(){
189
        TaxonNameBase<?,?> taxonName = BotanicalName.NewInstance(null);
189
        TaxonNameBase<?,?> taxonName = TaxonNameBase.NewBotanicalInstance(null);
190 190
        Taxon taxon = Taxon.NewInstance(taxonName, null);
191
        TaxonNameBase<?,?> synonymName1 = BotanicalName.NewInstance(null);
191
        TaxonNameBase<?,?> synonymName1 = TaxonNameBase.NewBotanicalInstance(null);
192 192
        // add a synonym to the taxon
193 193
        Synonym synonym1 = taxon.addHomotypicSynonymName(synonymName1);
194 194
        // get the homotypic group of that synonym
......
199 199
    }
200 200
    @Test
201 201
    public void testAddHomotypicSynonym(){
202
        TaxonNameBase<?,?> taxonName = BotanicalName.NewInstance(null);
202
        TaxonNameBase<?,?> taxonName = TaxonNameBase.NewBotanicalInstance(null);
203 203
        Taxon taxon = Taxon.NewInstance(taxonName, null);
204
        TaxonNameBase<?,?> synonymName1 = BotanicalName.NewInstance(null);
204
        TaxonNameBase<?,?> synonymName1 = TaxonNameBase.NewBotanicalInstance(null);
205 205
        Synonym synonym = Synonym.NewInstance(synonymName1, null);
206 206
        // add a synonym to the taxon
207 207
        taxon.addHomotypicSynonym(synonym);
......
216 216

  
217 217
	@Test
218 218
	public void testAddRemoveSynonymInSameGroup(){
219
		TaxonNameBase<?,?> taxonName = BotanicalName.NewInstance(null);
219
		TaxonNameBase<?,?> taxonName = TaxonNameBase.NewBotanicalInstance(null);
220 220
		Taxon taxon = Taxon.NewInstance(taxonName, null);
221
		TaxonNameBase<?,?> synonymName1 = BotanicalName.NewInstance(null);
222
		TaxonNameBase<?,?> synonymName2 = BotanicalName.NewInstance(null);
221
		TaxonNameBase<?,?> synonymName1 = TaxonNameBase.NewBotanicalInstance(null);
222
		TaxonNameBase<?,?> synonymName2 = TaxonNameBase.NewBotanicalInstance(null);
223 223

  
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)