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
.taxeditor
.bulkeditor
;
13 import java
.util
.HashMap
;
16 import org
.apache
.log4j
.Logger
;
18 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
19 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
20 import eu
.etaxonomy
.cdm
.model
.agent
.TeamOrPersonBase
;
21 import eu
.etaxonomy
.taxeditor
.annotatedlineeditor
.IEntityCreator
;
24 * <p>TeamOrPersonCreator class.</p>
30 public class TeamOrPersonCreator
implements IEntityCreator
<TeamOrPersonBase
> {
31 private static final Logger logger
= Logger
32 .getLogger(TeamOrPersonCreator
.class);
35 * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator#createEntity(java.lang.String)
38 public TeamOrPersonBase
createEntity(String text
) {
39 return createEntity(Person
.class, text
);
43 * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator#createEntity(java.lang.Class, java.lang.String)
46 public TeamOrPersonBase
createEntity(Object key
, String text
) {
47 TeamOrPersonBase teamOrPerson
= null;
48 if (Team
.class.equals(((Class
) key
))) {
49 teamOrPerson
= Team
.NewInstance();
51 if (Person
.class.equals(((Class
) key
))) {
52 teamOrPerson
= Person
.NewInstance();
54 if (teamOrPerson
!= null) {
55 teamOrPerson
.setTitleCache(text
);
61 * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator#getClassLabelPairs()
64 * <p>getKeyLabelPairs</p>
66 * @return a {@link java.util.Map} object.
68 public Map
<Object
, String
> getKeyLabelPairs() {
69 Map
<Object
, String
> result
= new HashMap
<Object
, String
>();
70 result
.put(Team
.class, "Author Team");
71 result
.put(Person
.class, "Author");