Project

General

Profile

« Previous | Next » 

Revision f104a204

Added by Andreas Müller almost 2 years ago

cleanup

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/distribution/excelupdate/ExcelDistributionUpdate.java
15 15
import java.util.Set;
16 16
import java.util.UUID;
17 17

  
18
import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
18
import org.apache.logging.log4j.LogManager;
19
import org.apache.logging.log4j.Logger;
19 20
import org.springframework.stereotype.Component;
20 21

  
21 22
import eu.etaxonomy.cdm.common.CdmUtils;
......
44 45
 *
45 46
 * @author a.mueller
46 47
 * @since 04.04.2017
47
 *
48 48
 */
49 49
@Component
50 50
public class ExcelDistributionUpdate
......
55 55

  
56 56
    private static final String AREA_MAP = "AreaMap";
57 57

  
58
    /**
59
     * {@inheritDoc}
60
     */
61 58
    @Override
62 59
    protected void analyzeRecord(Map<String, String> record, ExcelDistributionUpdateState state) {
63 60
        // nothing to do
64 61
    }
65 62

  
66
    /**
67
     * {@inheritDoc}
68
     */
69 63
    @Override
70 64
    protected void firstPass(ExcelDistributionUpdateState state) {
71 65
        Map<String, String> record = state.getOriginalRecord();
......
93 87
        }
94 88
    }
95 89

  
96
    /**
97
     * @param state
98
     * @param taxon
99
     * @param record
100
     * @param line
101
     */
102 90
    private void handleAreasForTaxon(ExcelDistributionUpdateState state, Taxon taxon, Map<String, String> record,
103 91
            String line) {
104 92
        ImportResult result = state.getResult();
......
156 144
        }
157 145
    }
158 146

  
159
    /**
160
     * @param taxon
161
     * @return
162
     */
163 147
    private String getTaxonLabel(Taxon taxon) {
164 148
        return taxon.getName() == null ? taxon.getTitleCache() : taxon.getName().getTitleCache();
165 149
    }
......
195 179
        return result;
196 180
    }
197 181

  
198
    /**
199
     * @param statusStr
200
     * @return
201
     */
202 182
    private PresenceAbsenceTerm getStatusByStatusStr(ExcelDistributionUpdateState state, String statusStr, String line) {
203 183
//        FIXME replace hardcoded;
204 184
        if ("A".equals(statusStr)) {
......
218 198
        return null;
219 199
    }
220 200

  
221
    /**
222
     * @param state
223
     * @param key
224
     * @param line
225
     * @return
226
     */
227 201
    private NamedArea getAreaByIdInVoc(ExcelDistributionUpdateState state, String id, String line) {
228 202
        //TODO remember in state
229 203
        Map<String, NamedArea> areaMap = (Map<String, NamedArea>)state.getStatusItem(AREA_MAP);
......
235 209
        return area;
236 210
    }
237 211

  
238
    /**
239
     * @param state
240
     * @return
241
     */
242 212
    private Map<String, NamedArea> createAreaMap(ExcelDistributionUpdateState state) {
243 213
        Map<String, NamedArea> result = new HashMap<>();
244 214
        TermVocabulary<?> voc = getVocabularyService().find(state.getConfig().getAreaVocabularyUuid());
......
252 222
        return result;
253 223
    }
254 224

  
255
    /**
256
     * @param keys
257
     * @return
258
     */
259 225
    private Set<String> removeNonAreaKeys(Set<String> keys) {
260 226
        Iterator<String> it = keys.iterator();
261 227
        while (it.hasNext()){
......
278 244
        return false;
279 245
    }
280 246

  
281
    /**
282
     * @param state
283
     * @param taxon
284
     * @param line
285
     * @return
286
     */
287 247
    private Map<NamedArea, Set<Distribution>> getExistingDistributions(
288 248
            ExcelDistributionUpdateState state, Taxon taxon,
289 249
            String line) {
......
306 266
        return result;
307 267
    }
308 268

  
309
    /**
310
     * {@inheritDoc}
311
     */
312 269
    @Override
313 270
    protected void secondPass(ExcelDistributionUpdateState state) {
314 271
        // nothing to do
315 272
    }
316 273

  
317
    /**
318
     * {@inheritDoc}
319
     */
320 274
    @Override
321 275
    protected boolean isIgnore(ExcelDistributionUpdateState state) {
322 276
        return false;
323 277
    }
278

  
324 279
    @Override
325 280
    protected boolean requiresNomenclaturalCode() {
326 281
        return false;
327 282
    }
328

  
329
}
283
}

Also available in: Unified diff