Revision 63d55cf4
Added by Andreas Müller almost 13 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/common/CdmImportBase.java | ||
---|---|---|
368 | 368 |
return namedAreaLevel; |
369 | 369 |
} |
370 | 370 |
|
371 |
|
|
372 |
protected Feature getFeature(STATE state, UUID uuid){ |
|
373 |
return getFeature(state, uuid, null, null, null); |
|
374 |
} |
|
375 |
|
|
371 | 376 |
/** |
372 |
* Returns a feature for a given uuid by first ... |
|
377 |
* Returns a feature for a given uuid by first checking if the uuid has already been used in this import, if not |
|
378 |
* checking if the feature exists in the database, if not creating it anew (with vocabulary etc.). |
|
379 |
* If label, text and labelAbbrev are all <code>null</code> no feature is created. |
|
373 | 380 |
* @param state |
374 | 381 |
* @param uuid |
375 | 382 |
* @param label |
... | ... | |
384 | 391 |
Feature feature = state.getFeature(uuid); |
385 | 392 |
if (feature == null){ |
386 | 393 |
feature = (Feature)getTermService().find(uuid); |
387 |
if (feature == null){ |
|
394 |
if (feature == null && ! hasNoLabel(label, text, labelAbbrev)){
|
|
388 | 395 |
feature = Feature.NewInstance(text, label, labelAbbrev); |
389 | 396 |
feature.setUuid(uuid); |
390 | 397 |
feature.setSupportsTextData(true); |
... | ... | |
399 | 406 |
return feature; |
400 | 407 |
} |
401 | 408 |
|
409 |
private boolean hasNoLabel(String label, String text, String labelAbbrev) { |
|
410 |
return label == null && text == null && labelAbbrev == null; |
|
411 |
} |
|
412 |
|
|
413 |
|
|
402 | 414 |
/** |
403 | 415 |
* Returns a presence term for a given uuid by first ... |
404 | 416 |
* @param state |
Also available in: Unified diff
no label features are not created