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
.cdm
.remote
.json
.util
;
13 import net
.sf
.json
.util
.PropertyFilter
;
15 import org
.apache
.log4j
.Logger
;
16 import org
.hibernate
.Hibernate
;
18 public class InitializedHibernatePropertyFilter
implements PropertyFilter
{
20 private static final Logger logger
= Logger
.getLogger(InitializedHibernatePropertyFilter
.class);
23 * @see net.sf.json.util.PropertyFilter#apply(java.lang.Object, java.lang.String, java.lang.Object)
25 public boolean apply(Object source
, String name
, Object value
) {
26 if (logger
.isDebugEnabled()) {
27 logger
.debug("Property " + name
+ " : Hibernate.isInitialized? " + Hibernate
.isInitialized(value
));
29 boolean skipProperty
= !Hibernate
.isInitialized(value
) || name
.equals("hibernateLazyInitializer");