Revision 379eb203
Added by Andreas Müller over 3 years ago
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/json/util/CardinalityPropertyFilter.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.cdm.remote.json.util; |
11 | 10 |
|
12 | 11 |
import java.util.Collection; |
... | ... | |
14 | 13 |
import java.util.Map; |
15 | 14 |
import java.util.Set; |
16 | 15 |
|
17 |
import net.sf.json.util.PropertyFilter; |
|
18 |
|
|
19 | 16 |
import org.apache.log4j.Logger; |
20 | 17 |
|
21 | 18 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
19 |
import net.sf.json.util.PropertyFilter; |
|
22 | 20 |
|
23 | 21 |
public class CardinalityPropertyFilter implements PropertyFilter { |
24 | 22 |
|
23 |
@SuppressWarnings("unused") |
|
25 | 24 |
private static final Logger logger = Logger.getLogger(CardinalityPropertyFilter.class); |
26 | 25 |
|
27 | 26 |
boolean includeToOneRelations = true; |
28 | 27 |
|
29 | 28 |
boolean includeToManyRelations = true; |
30 | 29 |
|
31 |
Set<String> exceptions = new HashSet<String>();
|
|
30 |
Set<String> exceptions = new HashSet<>(); |
|
32 | 31 |
|
33 | 32 |
public void setExceptions(Set<String> exceptions) { |
34 | 33 |
this.exceptions = exceptions; |
... | ... | |
42 | 41 |
this.includeToManyRelations = includeToManyRelations; |
43 | 42 |
} |
44 | 43 |
|
45 |
/* (non-Javadoc) |
|
46 |
* @see net.sf.json.util.PropertyFilter#apply(java.lang.Object, java.lang.String, java.lang.Object) |
|
47 |
*/ |
|
44 |
@Override |
|
48 | 45 |
public boolean apply(Object source, String name, Object value) { |
49 | 46 |
Class<?> valueType; |
50 | 47 |
|
Also available in: Unified diff
cleanup