3 * Copyright (C) 2009 EDIT 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
7 * 1.1 See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.remote
.json
.processor
.matcher
;
14 import org
.apache
.log4j
.Logger
;
15 import org
.hibernate
.proxy
.HibernateProxy
;
17 import javassist
.util
.proxy
.ProxyObject
;
19 import net
.sf
.cglib
.proxy
.Enhancer
;
20 import net
.sf
.json
.processors
.JsonBeanProcessorMatcher
;
23 * @author a.kohlbecker
26 public class HibernateProxyBeanProcessorMatcher
extends
27 JsonBeanProcessorMatcher
{
29 public static final Logger logger
= Logger
.getLogger(HibernateProxyBeanProcessorMatcher
.class);
32 * @see net.sf.json.processors.JsonBeanProcessorMatcher#getMatch(java.lang.Class, java.util.Set)
35 public Object
getMatch(Class target
, Set set
) {
37 if (HibernateProxy
.class.isAssignableFrom(target
)) {
38 logger
.debug("Found HibernateProxy object of class " + target
.getClass() + " returning " + HibernateProxy
.class);
39 return HibernateProxy
.class;
42 return DEFAULT
.getMatch(target
, set
);