Refactor formatter framework
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / format / occurrences / SpecimenOrObservationBaseFormatter.java
1 // $Id$
2 /**
3 * Copyright (C) 2015 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10 package eu.etaxonomy.cdm.format.occurrences;
11
12 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
13
14 /**
15 * @author pplitzner
16 * @date Nov 30, 2015
17 *
18 */
19 public class SpecimenOrObservationBaseFormatter extends IdentifiableEntityFormatter {
20
21 public SpecimenOrObservationBaseFormatter(Object object, FormatKey[] formatKeys) {
22 super(object, formatKeys);
23 }
24
25 @Override
26 protected void initFormatKeys(Object object) {
27 super.initFormatKeys(object);
28 SpecimenOrObservationBase specimenOrObservationBase = (SpecimenOrObservationBase)object;
29 if(specimenOrObservationBase.getRecordBasis()!=null){
30 formatKeyMap.put(FormatKey.RECORD_BASIS, specimenOrObservationBase.getRecordBasis().toString());
31 }
32 if(specimenOrObservationBase.getKindOfUnit()!=null){
33 formatKeyMap.put(FormatKey.KIND_OF_UNIT, specimenOrObservationBase.getKindOfUnit().toString());
34 }
35 }
36
37 }