public class JsonFieldsInclusionStrategy
extends java.lang.Object
implements com.google.gson.ExclusionStrategy
| Constructor and Description |
|---|
JsonFieldsInclusionStrategy(java.lang.Class<?> fieldClazz,
java.util.Set<java.lang.String> allowedNames)
Initialize JsonFieldsInclusionStrategy specifying a class and set of fields allowed for this class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addInclusion(java.lang.Class<?> fieldClazz,
java.util.Set<java.lang.String> allowedNames)
Add additional Exclusion Strategy specifying a class and set of fields allowed for this class.
|
boolean |
shouldSkipClass(java.lang.Class<?> clazz) |
boolean |
shouldSkipField(com.google.gson.FieldAttributes f)
Implements shouldSkipField to include only those fields for each class that were specified for each of the
specified classes, stored in allowedFieldsMap
|
public JsonFieldsInclusionStrategy(java.lang.Class<?> fieldClazz,
java.util.Set<java.lang.String> allowedNames)
fieldClazz - classallowedNames - a set of allowed fields.public void addInclusion(java.lang.Class<?> fieldClazz,
java.util.Set<java.lang.String> allowedNames)
fieldClazz - classallowedNames - a set of allowed fields.public boolean shouldSkipClass(java.lang.Class<?> clazz)
shouldSkipClass in interface com.google.gson.ExclusionStrategypublic boolean shouldSkipField(com.google.gson.FieldAttributes f)
shouldSkipField in interface com.google.gson.ExclusionStrategyf - field attributes