2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.propertysheet
.name
;
12 import org
.apache
.log4j
.Logger
;
14 import eu
.etaxonomy
.cdm
.model
.name
.ZoologicalName
;
17 * Property source for ZoologicalName entries.
23 public class ZoologicalNamePropertySource
extends NonViralNamePropertySource
{
24 private static final Logger logger
= Logger
25 .getLogger(ZoologicalNamePropertySource
.class);
27 private ZoologicalName zoologicalName
;
29 // Property unique keys
30 public static final String P_ID_PUBLICATIONYEAR
= "publicationyear";
31 // Property display keys
32 // public static final String P_PUBLICATIONYEAR = "099:Publication Year";
33 public static final String P_PUBLICATIONYEAR
= "Publication Year";
35 public ZoologicalNamePropertySource(ZoologicalName name
) {
37 this.zoologicalName
= name
;
38 addDescriptor(P_ID_PUBLICATIONYEAR
);
42 public Object
getPropertyValue(Object id
) {
43 if (id
.equals(P_ID_NOMENCLATURAL_CODE
)) {
46 if (id
.equals(P_ID_PUBLICATIONYEAR
)) {
47 String publicationYear
= Integer
.toString(zoologicalName
.getPublicationYear());
48 if (publicationYear
.equals("0")) {
51 return publicationYear
;
54 return super.getPropertyValue(id
);