3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.cdm
.io
.common
.mapping
;
13 import java
.util
.UUID
;
15 import org
.apache
.commons
.lang
.StringUtils
;
16 import org
.apache
.log4j
.Logger
;
18 import eu
.etaxonomy
.cdm
.common
.CdmUtils
;
19 import eu
.etaxonomy
.cdm
.model
.common
.ExtensionType
;
20 import eu
.etaxonomy
.cdm
.model
.common
.Language
;
21 import eu
.etaxonomy
.cdm
.model
.common
.MarkerType
;
22 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
23 import eu
.etaxonomy
.cdm
.model
.description
.PresenceAbsenceTermBase
;
24 import eu
.etaxonomy
.cdm
.model
.description
.PresenceTerm
;
25 import eu
.etaxonomy
.cdm
.model
.description
.State
;
26 import eu
.etaxonomy
.cdm
.model
.location
.NamedArea
;
27 import eu
.etaxonomy
.cdm
.model
.location
.NamedAreaLevel
;
28 import eu
.etaxonomy
.cdm
.model
.location
.ReferenceSystem
;
29 import eu
.etaxonomy
.cdm
.model
.name
.NameTypeDesignationStatus
;
30 import eu
.etaxonomy
.cdm
.model
.name
.Rank
;
31 import eu
.etaxonomy
.cdm
.model
.name
.SpecimenTypeDesignationStatus
;
38 public class InputTransformerBase
implements IInputTransformer
{
39 @SuppressWarnings("unused")
40 private static final Logger logger
= Logger
.getLogger(InputTransformerBase
.class);
43 public Feature
getFeatureByKey(String key
) throws UndefinedTransformerMethodException
{
44 String warning
= "getFeatureByKey is not implemented in implementing transformer class";
45 throw new UndefinedTransformerMethodException(warning
);
49 public UUID
getFeatureUuid(String key
) throws UndefinedTransformerMethodException
{
50 String warning
= "getFeatureByKey is not implemented in implementing transformer class";
51 throw new UndefinedTransformerMethodException(warning
);
57 public State
getStateByKey(String key
) throws UndefinedTransformerMethodException
{
58 String warning
= "getStateByKey is not implemented in implementing transformer class";
59 throw new UndefinedTransformerMethodException(warning
);
63 public UUID
getStateUuid(String key
) throws UndefinedTransformerMethodException
{
64 String warning
= "getStateByKey is not implemented in implementing transformer class";
65 throw new UndefinedTransformerMethodException(warning
);
70 public Language
getLanguageByKey(String key
) throws UndefinedTransformerMethodException
{
71 String warning
= "getLanguageByKey is not implemented in implementing transformer class";
72 throw new UndefinedTransformerMethodException(warning
);
77 public UUID
getLanguageUuid(String key
) throws UndefinedTransformerMethodException
{
78 String warning
= "getLanguageByUuid is not implemented in implementing transformer class";
79 throw new UndefinedTransformerMethodException(warning
);
83 public ExtensionType
getExtensionTypeByKey(String key
) throws UndefinedTransformerMethodException
{
84 String warning
= "getExtensionTypeByKey is not implemented in implementing transformer class";
85 throw new UndefinedTransformerMethodException(warning
);
89 public UUID
getExtensionTypeUuid(String key
) throws UndefinedTransformerMethodException
{
90 String warning
= "getExtensionTypeUuid is not implemented in implementing transformer class";
91 throw new UndefinedTransformerMethodException(warning
);
95 public MarkerType
getMarkerTypeByKey(String key
) throws UndefinedTransformerMethodException
{
96 String warning
= "getMarkerTypeByKey is not implemented in implementing transformer class";
97 throw new UndefinedTransformerMethodException(warning
);
101 public UUID
getMarkerTypeUuid(String key
) throws UndefinedTransformerMethodException
{
102 String warning
= "getMarkerTypeUuid is not implemented in implementing transformer class";
103 throw new UndefinedTransformerMethodException(warning
);
107 public NameTypeDesignationStatus
getNameTypeDesignationStatusByKey(String key
) throws UndefinedTransformerMethodException
{
108 String warning
= "getNameTypeDesignationStatusByKey is not implemented in implementing transformer class";
109 throw new UndefinedTransformerMethodException(warning
);
113 public UUID
getNameTypeDesignationStatusUuid(String key
) throws UndefinedTransformerMethodException
{
114 String warning
= "getNameTypeDesignationStatusUuid is not implemented in implementing transformer class";
115 throw new UndefinedTransformerMethodException(warning
);
119 public SpecimenTypeDesignationStatus
getSpecimenTypeDesignationStatusByKey(String key
) throws UndefinedTransformerMethodException
{
120 if (StringUtils
.isBlank(key
)){return null;
121 }else if (key
.matches("(?i)(T|Type)")){return SpecimenTypeDesignationStatus
.TYPE();
122 }else if (key
.matches("(?i)(HT|Holotype)")){return SpecimenTypeDesignationStatus
.HOLOTYPE();
123 }else if (key
.matches("(?i)(LT|Lectotype)")){return SpecimenTypeDesignationStatus
.LECTOTYPE();
124 }else if (key
.matches("(?i)(NT|Neotype)")){return SpecimenTypeDesignationStatus
.NEOTYPE();
125 }else if (key
.matches("(?i)(ST|Syntype)")){return SpecimenTypeDesignationStatus
.SYNTYPE();
126 }else if (key
.matches("(?i)(ET|Epitype)")){return SpecimenTypeDesignationStatus
.EPITYPE();
127 }else if (key
.matches("(?i)(IT|Isotype)")){return SpecimenTypeDesignationStatus
.ISOTYPE();
128 }else if (key
.matches("(?i)(ILT|Isolectotype)")){return SpecimenTypeDesignationStatus
.ISOLECTOTYPE();
129 }else if (key
.matches("(?i)(INT|Isoneotype)")){return SpecimenTypeDesignationStatus
.ISONEOTYPE();
130 }else if (key
.matches("(?i)(IET|Isoepitype)")){return SpecimenTypeDesignationStatus
.ISOEPITYPE();
131 }else if (key
.matches("(?i)(PT|Paratype)")){return SpecimenTypeDesignationStatus
.PARATYPE();
132 }else if (key
.matches("(?i)(PLT|Paralectotype)")){return SpecimenTypeDesignationStatus
.PARALECTOTYPE();
133 }else if (key
.matches("(?i)(PNT|Paraneotype)")){return SpecimenTypeDesignationStatus
.PARANEOTYPE();
134 }else if (key
.matches("(?i)(unsp.|Unspecified)")){return SpecimenTypeDesignationStatus
.UNSPECIFIC();
135 }else if (key
.matches("(?i)(2LT|Second Step Lectotype)")){return SpecimenTypeDesignationStatus
.SECOND_STEP_LECTOTYPE();
136 }else if (key
.matches("(?i)(2NT|Second Step Neotype)")){return SpecimenTypeDesignationStatus
.SECOND_STEP_NEOTYPE();
137 }else if (key
.matches("(?i)(OM|Original Material)")){return SpecimenTypeDesignationStatus
.ORIGINAL_MATERIAL();
138 }else if (key
.matches("(?i)(IcT|Iconotype)")){return SpecimenTypeDesignationStatus
.ICONOTYPE();
139 }else if (key
.matches("(?i)(PT|Phototype)")){return SpecimenTypeDesignationStatus
.PHOTOTYPE();
140 }else if (key
.matches("(?i)(IST|Isosyntype)")){return SpecimenTypeDesignationStatus
.ISOSYNTYPE();
147 public UUID
getSpecimenTypeDesignationStatusUuid(String key
) throws UndefinedTransformerMethodException
{
148 String warning
= "getSpecimenTypeDesignationStatusUuid is not implemented in implementing transformer class";
149 throw new UndefinedTransformerMethodException(warning
);
154 public PresenceAbsenceTermBase
getPresenceTermByKey(String key
) throws UndefinedTransformerMethodException
{
155 String warning
= "getPresenceTermByKey is not implemented in implementing transformer class";
156 throw new UndefinedTransformerMethodException(warning
);
160 public UUID
getPresenceTermUuid(String key
) throws UndefinedTransformerMethodException
{
161 String warning
= "getPresenceTermUuid is not implemented in implementing transformer class";
162 throw new UndefinedTransformerMethodException(warning
);
166 public NamedArea
getNamedAreaByKey(String key
) throws UndefinedTransformerMethodException
{
167 String warning
= "getNamedAreaByKey is not implemented in implementing transformer class";
168 throw new UndefinedTransformerMethodException(warning
);
173 public UUID
getNamedAreaUuid(String key
) throws UndefinedTransformerMethodException
{
174 String warning
= "getNamedAreaUuid is not implemented in implementing transformer class";
175 throw new UndefinedTransformerMethodException(warning
);
179 public NamedAreaLevel
getNamedAreaLevelByKey(String key
) throws UndefinedTransformerMethodException
{
180 String warning
= "getNamedAreaLevelByKey is not implemented in implementing transformer class";
181 throw new UndefinedTransformerMethodException(warning
);
185 public UUID
getNamedAreaLevelUuid(String key
) throws UndefinedTransformerMethodException
{
186 String warning
= "getNamedAreaLevelUuid is not implemented in implementing transformer class";
187 throw new UndefinedTransformerMethodException(warning
);
191 public ReferenceSystem
getReferenceSystemByKey(String key
) throws UndefinedTransformerMethodException
{
192 if (CdmUtils
.isBlank(key
)){return null;
193 }else if (key
.matches("(?i)(wgs84)")){return ReferenceSystem
.WGS84();
194 }else if (key
.matches("(?i)(googleearth)")){return ReferenceSystem
.GOOGLE_EARTH();
195 }else if (key
.matches("(?i)(gazetteer)")){return ReferenceSystem
.GAZETTEER();
196 }else if (key
.matches("(?i)(map)")){return ReferenceSystem
.MAP();
198 String warning
= "getReferenceSystemByKey is not implemented in implementing transformer class";
199 throw new UndefinedTransformerMethodException(warning
);
204 public UUID
getReferenceSystemUuid(String key
) throws UndefinedTransformerMethodException
{
206 String warning
= "getReferenceSystemUuid is not implemented in implementing transformer class";
207 throw new UndefinedTransformerMethodException(warning
);
211 public Rank
getRankByKey(String key
) throws UndefinedTransformerMethodException
{
212 String warning
= "getRankByKey is not yet implemented in implementing transformer class";
213 throw new UndefinedTransformerMethodException(warning
);
217 public UUID
getRankUuid(String key
) throws UndefinedTransformerMethodException
{
218 String warning
= "getRankUuid is not implemented in implementing transformer class";
219 throw new UndefinedTransformerMethodException(warning
);