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
.log4j
.Logger
;
17 import eu
.etaxonomy
.cdm
.common
.CdmUtils
;
18 import eu
.etaxonomy
.cdm
.model
.common
.ExtensionType
;
19 import eu
.etaxonomy
.cdm
.model
.common
.Language
;
20 import eu
.etaxonomy
.cdm
.model
.common
.MarkerType
;
21 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
22 import eu
.etaxonomy
.cdm
.model
.description
.PresenceTerm
;
23 import eu
.etaxonomy
.cdm
.model
.location
.NamedArea
;
24 import eu
.etaxonomy
.cdm
.model
.location
.NamedAreaLevel
;
25 import eu
.etaxonomy
.cdm
.model
.location
.ReferenceSystem
;
26 import eu
.etaxonomy
.cdm
.model
.name
.NameTypeDesignationStatus
;
27 import eu
.etaxonomy
.cdm
.model
.name
.SpecimenTypeDesignationStatus
;
34 public class InputTransformerBase
implements IInputTransformer
{
35 @SuppressWarnings("unused")
36 private static final Logger logger
= Logger
.getLogger(InputTransformerBase
.class);
39 * @see eu.etaxonomy.cdm.io.common.mapping.IInputTransformer#getFeatureByKey(java.lang.String)
41 public Feature
getFeatureByKey(String key
) throws UndefinedTransformerMethodException
{
42 String warning
= "getFeatureByKey is not implemented in implementing transformer class";
43 throw new UndefinedTransformerMethodException(warning
);
47 * @see eu.etaxonomy.cdm.io.common.mapping.IInputTransformer#getFeatureUuid(java.lang.String)
49 public UUID
getFeatureUuid(String key
) throws UndefinedTransformerMethodException
{
50 String warning
= "getFeatureByKey is not implemented in implementing transformer class";
51 throw new UndefinedTransformerMethodException(warning
);
56 * @see eu.etaxonomy.cdm.io.common.mapping.IInputTransformer#getLanguageByKey(java.lang.String)
58 public Language
getLanguageByKey(String key
) throws UndefinedTransformerMethodException
{
59 String warning
= "getLanguageByKey is not implemented in implementing transformer class";
60 throw new UndefinedTransformerMethodException(warning
);
65 * @see eu.etaxonomy.cdm.io.common.mapping.IInputTransformer#getLanguageUuid(java.lang.String)
67 public UUID
getLanguageUuid(String key
) throws UndefinedTransformerMethodException
{
68 String warning
= "getLanguageByUuid is not implemented in implementing transformer class";
69 throw new UndefinedTransformerMethodException(warning
);
73 * @see eu.etaxonomy.cdm.io.common.mapping.IInputTransformer#getExtensionTypeByKey(java.lang.String)
75 public ExtensionType
getExtensionTypeByKey(String key
) throws UndefinedTransformerMethodException
{
76 String warning
= "getExtensionTypeByKey is not implemented in implementing transformer class";
77 throw new UndefinedTransformerMethodException(warning
);
81 * @see eu.etaxonomy.cdm.io.common.mapping.IInputTransformer#getExtensionTypeUuid(java.lang.String)
83 public UUID
getExtensionTypeUuid(String key
) throws UndefinedTransformerMethodException
{
84 String warning
= "getExtensionTypeUuid is not implemented in implementing transformer class";
85 throw new UndefinedTransformerMethodException(warning
);
89 * @see eu.etaxonomy.cdm.io.common.mapping.IInputTransformer#getMarkerTypeByKey(java.lang.String)
91 public MarkerType
getMarkerTypeByKey(String key
) throws UndefinedTransformerMethodException
{
92 String warning
= "getMarkerTypeByKey is not implemented in implementing transformer class";
93 throw new UndefinedTransformerMethodException(warning
);
97 * @see eu.etaxonomy.cdm.io.common.mapping.IInputTransformer#getMarkerTypeUuid(java.lang.String)
99 public UUID
getMarkerTypeUuid(String key
) throws UndefinedTransformerMethodException
{
100 String warning
= "getMarkerTypeUuid is not implemented in implementing transformer class";
101 throw new UndefinedTransformerMethodException(warning
);
105 * @see eu.etaxonomy.cdm.io.common.mapping.IInputTransformer#getNameTypeDesignationStatusByKey(java.lang.String)
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 * @see eu.etaxonomy.cdm.io.common.mapping.IInputTransformer#getNameTypeDesignationStatusUuid(java.lang.String)
115 public UUID
getNameTypeDesignationStatusUuid(String key
) throws UndefinedTransformerMethodException
{
116 String warning
= "getNameTypeDesignationStatusUuid is not implemented in implementing transformer class";
117 throw new UndefinedTransformerMethodException(warning
);
121 * @see eu.etaxonomy.cdm.io.common.mapping.IInputTransformer#getSpecimenTypeDesignationStatusByKey(java.lang.String)
123 public SpecimenTypeDesignationStatus
getSpecimenTypeDesignationStatusByKey(String key
) throws UndefinedTransformerMethodException
{
124 if (CdmUtils
.isEmpty(key
)){return null;
125 }else if (key
.matches("(?i)(T|Type)")){return SpecimenTypeDesignationStatus
.TYPE();
126 }else if (key
.matches("(?i)(HT|Holotype)")){return SpecimenTypeDesignationStatus
.HOLOTYPE();
127 }else if (key
.matches("(?i)(LT|Lectotype)")){return SpecimenTypeDesignationStatus
.LECTOTYPE();
128 }else if (key
.matches("(?i)(NT|Neotype)")){return SpecimenTypeDesignationStatus
.NEOTYPE();
129 }else if (key
.matches("(?i)(ST|Syntype)")){return SpecimenTypeDesignationStatus
.SYNTYPE();
130 }else if (key
.matches("(?i)(ET|Epitype)")){return SpecimenTypeDesignationStatus
.EPITYPE();
131 }else if (key
.matches("(?i)(IT|Isotype)")){return SpecimenTypeDesignationStatus
.ISOTYPE();
132 }else if (key
.matches("(?i)(ILT|Isolectotype)")){return SpecimenTypeDesignationStatus
.ISOLECTOTYPE();
133 }else if (key
.matches("(?i)(INT|Isoneotype)")){return SpecimenTypeDesignationStatus
.ISONEOTYPE();
134 }else if (key
.matches("(?i)(IET|Isoepitype)")){return SpecimenTypeDesignationStatus
.ISOEPITYPE();
135 }else if (key
.matches("(?i)(PT|Paratype)")){return SpecimenTypeDesignationStatus
.PARATYPE();
136 }else if (key
.matches("(?i)(PLT|Paralectotype)")){return SpecimenTypeDesignationStatus
.PARALECTOTYPE();
137 }else if (key
.matches("(?i)(PNT|Paraneotype)")){return SpecimenTypeDesignationStatus
.PARANEOTYPE();
138 }else if (key
.matches("(?i)(unsp.|Unspecified)")){return SpecimenTypeDesignationStatus
.UNSPECIFIC();
139 }else if (key
.matches("(?i)(2LT|Second Step Lectotype)")){return SpecimenTypeDesignationStatus
.SECOND_STEP_LECTOTYPE();
140 }else if (key
.matches("(?i)(2NT|Second Step Neotype)")){return SpecimenTypeDesignationStatus
.SECOND_STEP_NEOTYPE();
141 }else if (key
.matches("(?i)(OM|Original Material)")){return SpecimenTypeDesignationStatus
.ORIGINAL_MATERIAL();
142 }else if (key
.matches("(?i)(IcT|Iconotype)")){return SpecimenTypeDesignationStatus
.ICONOTYPE();
143 }else if (key
.matches("(?i)(PT|Phototype)")){return SpecimenTypeDesignationStatus
.PHOTOTYPE();
144 }else if (key
.matches("(?i)(IST|Isosyntype)")){return SpecimenTypeDesignationStatus
.ISOSYNTYPE();
151 * @see eu.etaxonomy.cdm.io.common.mapping.IInputTransformer#getSpecimenTypeDesignationStatusUuid(java.lang.String)
153 public UUID
getSpecimenTypeDesignationStatusUuid(String key
) throws UndefinedTransformerMethodException
{
154 String warning
= "getSpecimenTypeDesignationStatusUuid is not implemented in implementing transformer class";
155 throw new UndefinedTransformerMethodException(warning
);
160 * @see eu.etaxonomy.cdm.io.common.mapping.IInputTransformer#getPresenceTermByKey(java.lang.String)
162 public PresenceTerm
getPresenceTermByKey(String key
) throws UndefinedTransformerMethodException
{
163 String warning
= "getPresenceTermByKey is not implemented in implementing transformer class";
164 throw new UndefinedTransformerMethodException(warning
);
168 * @see eu.etaxonomy.cdm.io.common.mapping.IInputTransformer#getPresenceTermUuid(java.lang.String)
170 public UUID
getPresenceTermUuid(String key
) throws UndefinedTransformerMethodException
{
171 String warning
= "getPresenceTermUuid is not implemented in implementing transformer class";
172 throw new UndefinedTransformerMethodException(warning
);
176 * @see eu.etaxonomy.cdm.io.common.mapping.IInputTransformer#getNamedAreaByKey(java.lang.String)
179 public NamedArea
getNamedAreaByKey(String key
) throws UndefinedTransformerMethodException
{
180 String warning
= "getNamedAreaByKey is not implemented in implementing transformer class";
181 throw new UndefinedTransformerMethodException(warning
);
186 * @see eu.etaxonomy.cdm.io.common.mapping.IInputTransformer#getNamedAreaUuid(java.lang.String)
189 public UUID
getNamedAreaUuid(String key
) throws UndefinedTransformerMethodException
{
190 String warning
= "getNamedAreaUuid is not implemented in implementing transformer class";
191 throw new UndefinedTransformerMethodException(warning
);
196 * @see eu.etaxonomy.cdm.io.common.mapping.IInputTransformer#getNamedAreaLevelByKey(java.lang.String)
199 public NamedAreaLevel
getNamedAreaLevelByKey(String key
) throws UndefinedTransformerMethodException
{
200 String warning
= "getNamedAreaLevelByKey is not implemented in implementing transformer class";
201 throw new UndefinedTransformerMethodException(warning
);
205 * @see eu.etaxonomy.cdm.io.common.mapping.IInputTransformer#getNamedAreaLevelUuid(java.lang.String)
208 public UUID
getNamedAreaLevelUuid(String key
) throws UndefinedTransformerMethodException
{
209 String warning
= "getNamedAreaLevelUuid is not implemented in implementing transformer class";
210 throw new UndefinedTransformerMethodException(warning
);
214 public ReferenceSystem
getReferenceSystemByKey(String key
) throws UndefinedTransformerMethodException
{
215 if (CdmUtils
.isEmpty(key
)){return null;
216 }else if (key
.matches("(?i)(wgs84)")){return ReferenceSystem
.WGS84();
217 }else if (key
.matches("(?i)(googleearth)")){return ReferenceSystem
.GOOGLE_EARTH();
218 }else if (key
.matches("(?i)(gazetteer)")){return ReferenceSystem
.GAZETTEER();
220 String warning
= "getReferenceSystemByKey is not implemented in implementing transformer class";
221 throw new UndefinedTransformerMethodException(warning
);
226 public UUID
getReferenceSystemUuid(String key
) throws UndefinedTransformerMethodException
{
228 String warning
= "getReferenceSystemUuid is not implemented in implementing transformer class";
229 throw new UndefinedTransformerMethodException(warning
);