3 * Copyright (C) 2009 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
.remote
.editor
;
13 import java
.beans
.PropertyEditorSupport
;
15 import org
.apache
.log4j
.Logger
;
16 import org
.springframework
.stereotype
.Component
;
18 import eu
.etaxonomy
.cdm
.model
.location
.TdwgArea
;
21 * @author a.kohlbecker
23 * TODO only TDWG areas supported for now
26 public class CdmTypePropertyEditor
extends PropertyEditorSupport
{
28 public static final Logger logger
= Logger
.getLogger(CdmTypePropertyEditor
.class);
30 public void setAsText(String text
) {
34 clazz
= Class
.forName(text
);
35 } catch (ClassNotFoundException e
) { /* IGNORE */ }
37 clazz
= Class
.forName("eu.etaxonomy.cdm.model.agent."+text
);
38 } catch (ClassNotFoundException e
) { /* IGNORE */ }
40 clazz
= Class
.forName("eu.etaxonomy.cdm.model.common."+text
);
41 } catch (ClassNotFoundException e
) { /* IGNORE */ }
43 clazz
= Class
.forName("eu.etaxonomy.cdm.model.description."+text
);
44 } catch (ClassNotFoundException e
) { /* IGNORE */ }
46 clazz
= Class
.forName("eu.etaxonomy.cdm.model.location."+text
);
47 } catch (ClassNotFoundException e
) { /* IGNORE */ }
49 clazz
= Class
.forName("eu.etaxonomy.cdm.model.media."+text
);
50 } catch (ClassNotFoundException e
) { /* IGNORE */ }
52 clazz
= Class
.forName("eu.etaxonomy.cdm.model.molecular."+text
);
53 } catch (ClassNotFoundException e
) { /* IGNORE */ }
55 clazz
= Class
.forName("eu.etaxonomy.cdm.model.name"+text
);
56 } catch (ClassNotFoundException e
) { /* IGNORE */ }
58 clazz
= Class
.forName("eu.etaxonomy.cdm.model.occurrence."+text
);
59 } catch (ClassNotFoundException e
) { /* IGNORE */ }
61 clazz
= Class
.forName("eu.etaxonomy.cdm.model.reference."+text
);
62 } catch (ClassNotFoundException e
) { /* IGNORE */ }
64 clazz
= Class
.forName("eu.etaxonomy.cdm.model.taxon."+text
);
65 } catch (ClassNotFoundException e
) { /* IGNORE */ }
70 logger
.error("Cannot find class for " + text
);