Revision 794be65e
Added by Andreas Müller almost 2 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/markup/MarkupDocumentImportNoComponent.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.cdm.io.markup; |
11 | 10 |
|
12 | 11 |
import java.net.MalformedURLException; |
... | ... | |
24 | 23 |
import javax.xml.stream.events.XMLEvent; |
25 | 24 |
|
26 | 25 |
import org.apache.commons.lang.StringUtils; |
27 |
import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger; |
|
26 |
import org.apache.logging.log4j.LogManager; |
|
27 |
import org.apache.logging.log4j.Logger; |
|
28 | 28 |
|
29 | 29 |
import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException; |
30 | 30 |
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase; |
... | ... | |
45 | 45 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
46 | 46 |
import eu.etaxonomy.cdm.model.taxon.TaxonNodeStatus; |
47 | 47 |
|
48 |
|
|
49 | 48 |
/** |
50 | 49 |
* @author a.mueller |
51 |
* |
|
52 | 50 |
*/ |
53 | 51 |
public class MarkupDocumentImportNoComponent extends MarkupImportBase { |
54 | 52 |
@SuppressWarnings("unused") |
... | ... | |
173 | 171 |
if (isMyEndingElement(next, parentEvent)) { |
174 | 172 |
Set<PolytomousKeyNode> keyNodesToSave = state.getPolytomousKeyNodesToSave(); |
175 | 173 |
//better save the key then the nodes |
176 |
Set<PolytomousKey> keySet = new HashSet<PolytomousKey>();
|
|
174 |
Set<PolytomousKey> keySet = new HashSet<>(); |
|
177 | 175 |
for (PolytomousKeyNode node : keyNodesToSave){ |
178 | 176 |
PolytomousKey key = node.getKey(); |
179 | 177 |
keySet.add(key); |
... | ... | |
207 | 205 |
return; |
208 | 206 |
} |
209 | 207 |
|
210 |
/** |
|
211 |
* @param taxon |
|
212 |
* @param lastTaxon |
|
213 |
*/ |
|
214 | 208 |
private TaxonNode doTaxonRelation(MarkupImportState state, Taxon taxon, Taxon lastTaxon, Location dataLocation) { |
215 | 209 |
|
216 | 210 |
if (state.isTaxonInClassification() == false){ |
... | ... | |
285 | 279 |
return node; |
286 | 280 |
} |
287 | 281 |
|
288 |
|
|
289 |
|
|
290 |
/** |
|
291 |
* @param state |
|
292 |
* @param dataLocation |
|
293 |
* @return |
|
294 |
*/ |
|
295 | 282 |
private Classification makeTree(MarkupImportState state, Location dataLocation) { |
296 | 283 |
Classification result = state.getTree(null); |
297 | 284 |
if (result == null) { |
... | ... | |
537 | 524 |
*/ |
538 | 525 |
private Taxon createTaxonAndName(MarkupImportState state, |
539 | 526 |
Map<String, Attribute> attributes, StartElement event) { |
527 |
|
|
540 | 528 |
INonViralName name; |
541 | 529 |
Rank rank = null; //Rank.SPECIES(); // default |
542 | 530 |
boolean isCultivar = checkAndRemoveAttributeValue(attributes, CLASS, "cultivated"); |
Also available in: Unified diff
cleanup