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.
10 package eu
.etaxonomy
.cdm
.remote
.json
.processor
.bean
;
12 import java
.util
.List
;
14 import net
.sf
.json
.JSONObject
;
15 import net
.sf
.json
.JsonConfig
;
16 import eu
.etaxonomy
.cdm
.model
.name
.NameTypeDesignation
;
17 import eu
.etaxonomy
.cdm
.model
.name
.SpecimenTypeDesignation
;
18 import eu
.etaxonomy
.cdm
.model
.name
.TypeDesignationBase
;
21 * @author a.kohlbecker
25 public class TypeDesignationBaseBeanProcessor
extends AbstractCdmBeanProcessor
<TypeDesignationBase
> {
28 * @see eu.etaxonomy.cdm.remote.json.processor.bean.AbstractCdmBeanProcessor#getIgnorePropNames()
31 public List
<String
> getIgnorePropNames() {
36 * @see eu.etaxonomy.cdm.remote.json.processor.bean.AbstractCdmBeanProcessor#processBeanSecondStep(eu.etaxonomy.cdm.model.common.CdmBase, net.sf.json.JSONObject, net.sf.json.JsonConfig)
39 public JSONObject
processBeanSecondStep(TypeDesignationBase bean
, JSONObject json
, JsonConfig jsonConfig
) {
40 json
.element("typeStatus", bean
.getTypeStatus(), jsonConfig
);
41 if(bean
.getClass().isAssignableFrom(SpecimenTypeDesignation
.class)){
42 json
.element("typeSpecimen", ((SpecimenTypeDesignation
)bean
).getTypeSpecimen(), jsonConfig
);
43 } else if (bean
.getClass().isAssignableFrom(NameTypeDesignation
.class)){
44 json
.element("typeName", ((NameTypeDesignation
)bean
).getTypeName(), jsonConfig
);
45 json
.element("citation", ((NameTypeDesignation
)bean
).getCitation(), jsonConfig
);