Revision 1eaef993
Added by Andreas Müller over 6 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/dwca/in/GbifTypesAndSpecimen2CdmConverter.java | ||
---|---|---|
52 | 52 |
} |
53 | 53 |
|
54 | 54 |
@Override |
55 |
public IReader<MappedCdmBase> map(StreamItem item ){ |
|
56 |
List<MappedCdmBase> resultList = new ArrayList<MappedCdmBase>();
|
|
55 |
public IReader<MappedCdmBase<? extends CdmBase>> map(StreamItem item ){
|
|
56 |
List<MappedCdmBase<? extends CdmBase>> resultList = new ArrayList<>();
|
|
57 | 57 |
|
58 | 58 |
Reference sourceReference = state.getTransactionalSourceReference(); |
59 | 59 |
String sourceReferecenDetail = null; |
... | ... | |
91 | 91 |
if (typeStatus.isInstanceOf(SpecimenTypeDesignationStatus.class)){ |
92 | 92 |
SpecimenTypeDesignationStatus status = CdmBase.deproxy(typeStatus, SpecimenTypeDesignationStatus.class); |
93 | 93 |
name.addSpecimenTypeDesignation(specimen, status, null, null, null, false, true); |
94 |
MappedCdmBase<?> mcb = new MappedCdmBase(taxon);
|
|
94 |
MappedCdmBase<? extends CdmBase> mcb = new MappedCdmBase<>(taxon);
|
|
95 | 95 |
resultList.add(mcb); |
96 | 96 |
}else if (typeStatus.isInstanceOf(NameTypeDesignationStatus.class)){ |
97 | 97 |
String message = "NameTypeDesignation not yet implemented"; |
... | ... | |
103 | 103 |
} |
104 | 104 |
} |
105 | 105 |
|
106 |
MappedCdmBase<?> mcb = new MappedCdmBase(specimen);
|
|
106 |
MappedCdmBase<? extends CdmBase> mcb = new MappedCdmBase<>(specimen);
|
|
107 | 107 |
resultList.add(mcb); |
108 | 108 |
|
109 | 109 |
}else{ |
... | ... | |
112 | 112 |
} |
113 | 113 |
|
114 | 114 |
//return |
115 |
return new ListReader<MappedCdmBase>(resultList);
|
|
115 |
return new ListReader<>(resultList); |
|
116 | 116 |
} |
117 | 117 |
|
118 | 118 |
|
119 |
private Collection getCollection(DwcaDataImportStateBase state, StreamItem item, List<MappedCdmBase> resultList) { |
|
119 |
private Collection getCollection(DwcaDataImportStateBase state, StreamItem item, |
|
120 |
List<MappedCdmBase<? extends CdmBase>> resultList) { |
|
120 | 121 |
String institutionCode = item.get(TermUri.DWC_INSTITUTION_CODE); |
121 | 122 |
String collectionCode = item.get(TermUri.DWC_COLLECTION_CODE); |
122 | 123 |
//institution |
123 | 124 |
Institution institution = getInstitutionByInstitutionCode(item, institutionCode); |
124 | 125 |
if (institution != null){ |
125 |
MappedCdmBase mcb = new MappedCdmBase(item.term, item.get(TermUri.DWC_INSTITUTION_CODE), institution);
|
|
126 |
MappedCdmBase<? extends CdmBase> mcb = new MappedCdmBase<>(item.term, item.get(TermUri.DWC_INSTITUTION_CODE), institution);
|
|
126 | 127 |
resultList.add(mcb); |
127 | 128 |
} |
128 | 129 |
//collection |
129 | 130 |
Collection collection = getCollectionByCollectionCode(item, collectionCode, institution); |
130 | 131 |
if (collection != null){ |
131 |
MappedCdmBase mcb = new MappedCdmBase(item.term, item.get(TermUri.DWC_COLLECTION_CODE), collection);
|
|
132 |
MappedCdmBase<? extends CdmBase> mcb = new MappedCdmBase<>(item.term, item.get(TermUri.DWC_COLLECTION_CODE), collection);
|
|
132 | 133 |
resultList.add(mcb); |
133 | 134 |
} |
134 | 135 |
return collection; |
... | ... | |
280 | 281 |
|
281 | 282 |
@Override |
282 | 283 |
public Set<String> requiredSourceNamespaces() { |
283 |
Set<String> result = new HashSet<String>();
|
|
284 |
Set<String> result = new HashSet<>(); |
|
284 | 285 |
result.add(TermUri.DWC_TAXON.toString()); |
285 | 286 |
result.add(TermUri.DWC_LOCATION_ID.toString()); |
286 | 287 |
return result; |
Also available in: Unified diff
cleanup