Revision 379eb203
Added by Andreas Müller over 3 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/tcsrdf/TcsRdfReferenceImport.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.tcsrdf; |
11 | 10 |
|
12 | 11 |
import static eu.etaxonomy.cdm.io.common.ImportHelper.NO_OVERWRITE; |
... | ... | |
102 | 101 |
// "created_When", "updated_When", "created_Who", "updated_Who", "notes" |
103 | 102 |
// }; |
104 | 103 |
|
105 |
protected static CdmSingleAttributeXmlMapperBase[] unclearMappers = new CdmSingleAttributeXmlMapperBase[]{ |
|
106 |
|
|
107 |
}; |
|
108 |
|
|
109 |
|
|
104 |
protected static CdmSingleAttributeXmlMapperBase[] unclearMappers = new CdmSingleAttributeXmlMapperBase[]{}; |
|
110 | 105 |
|
111 | 106 |
private boolean makeStandardMapper(Statement resource, Reference ref, Set<String> omitAttributes){ |
112 | 107 |
if (omitAttributes == null){ |
113 |
omitAttributes = new HashSet<String>();
|
|
108 |
omitAttributes = new HashSet<>(); |
|
114 | 109 |
} |
115 |
boolean result = true; |
|
110 |
|
|
116 | 111 |
for (IRdfMapper mapper : standardMappers){ |
117 | 112 |
if (mapper instanceof CdmSingleAttributeMapperBase){ |
118 | 113 |
makeSingleAttributeMapper((CdmSingleAttributeRDFMapperBase)mapper, resource, ref, omitAttributes); |
... | ... | |
143 | 138 |
|
144 | 139 |
private boolean makeMultipleAttributeMapper(CdmOneToManyMapper<?,?,CdmTextElementMapper> mapper, Statement parentElement, Reference ref, Set<String> omitAttributes){ |
145 | 140 |
if (omitAttributes == null){ |
146 |
omitAttributes = new HashSet<String>();
|
|
141 |
omitAttributes = new HashSet<>(); |
|
147 | 142 |
} |
148 | 143 |
boolean result = true; |
149 | 144 |
String destinationAttribute = mapper.getSingleAttributeName(); |
150 |
List<Object> sourceValues = new ArrayList<Object>();
|
|
151 |
List<Class> classes = new ArrayList<Class>();
|
|
145 |
List<Object> sourceValues = new ArrayList<>(); |
|
146 |
List<Class> classes = new ArrayList<>(); |
|
152 | 147 |
for (CdmTextElementMapper singleMapper : mapper.getSingleMappers()){ |
153 | 148 |
String sourceAttribute = singleMapper.getSourceAttribute(); |
154 | 149 |
Object value = getValue(singleMapper, parentElement); |
... | ... | |
316 | 311 |
//referenceService.saveReferenceAll(referenceMap.objects()); |
317 | 312 |
logger.info("end makeReferences ...");*/ |
318 | 313 |
return; |
319 |
|
|
320 | 314 |
} |
321 | 315 |
|
322 |
/* (non-Javadoc) |
|
323 |
* @see eu.etaxonomy.cdm.io.common.CdmIoBase#isIgnore(eu.etaxonomy.cdm.io.common.IImportConfigurator) |
|
324 |
*/ |
|
325 | 316 |
@Override |
326 | 317 |
protected boolean isIgnore(TcsRdfImportState state){ |
327 | 318 |
return (state.getConfig().getDoReferences() == IImportConfigurator.DO_REFERENCES.NONE); |
328 | 319 |
} |
329 |
|
|
330 | 320 |
} |
Also available in: Unified diff
cleanup