solving problems with homonyms renderization at the portal
[cdmlib.git] / cdmlib-remote / src / main / java / eu / etaxonomy / cdm / remote / json / processor / value / ClassJSONValueProcessor.java
1 // $Id: UUIDJSONValueProcessor.java 5587 2009-04-09 15:04:38Z a.kohlbecker $
2 /**
3 * Copyright (C) 2009 EDIT European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 See LICENSE.TXT at the top of this package for the full license terms.
8 */
9
10 package eu.etaxonomy.cdm.remote.json.processor.value;
11
12 import net.sf.json.JsonConfig;
13 import net.sf.json.processors.JsonValueProcessor;
14
15 import org.apache.log4j.Logger;
16
17 public class ClassJSONValueProcessor implements JsonValueProcessor {
18
19 private static final Logger logger = Logger.getLogger(ClassJSONValueProcessor.class);
20
21 public Object processArrayValue(Object obj, JsonConfig jsonConfig) {
22 logger.debug("Processing Class");
23 if(obj == null){
24 return "";
25 }
26 Class clazz = (Class) obj;
27 return clazz.getSimpleName();
28 }
29
30 public Object processObjectValue(String key, Object obj,
31 JsonConfig jsonConfig) {
32 logger.debug("Processing Class");
33 if(obj == null){
34 return "";
35 }
36 Class clazz = (Class) obj;
37 return clazz.getSimpleName();
38 };
39
40 }