Package com.google.gson.internal
Class Excluder
java.lang.Object
com.google.gson.internal.Excluder
- All Implemented Interfaces:
TypeAdapterFactory
,Cloneable
This class selects which fields and types to omit. It is configurable,
supporting version attributes
Since
and Until
, modifiers,
synthetic fields, anonymous and local classes, inner classes, and fields with
the Expose
annotation.
This class is a type adapter factory; types that are excluded will be adapted to null. It may delegate to another type adapter if only one direction is excluded.
- Author:
- Joel Leitch, Jesse Wilson
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Excluder
clone()
<T> TypeAdapter
<T> Returns a type adapter fortype
, or null if this factory doesn't supporttype
.boolean
excludeClass
(Class<?> clazz, boolean serialize) boolean
excludeField
(Field field, boolean serialize) withExclusionStrategy
(ExclusionStrategy exclusionStrategy, boolean serialization, boolean deserialization) withModifiers
(int... modifiers) withVersion
(double ignoreVersionsAfter)
-
Field Details
-
DEFAULT
-
-
Constructor Details
-
Excluder
public Excluder()
-
-
Method Details
-
clone
-
withVersion
-
withModifiers
-
disableInnerClassSerialization
-
excludeFieldsWithoutExposeAnnotation
-
withExclusionStrategy
public Excluder withExclusionStrategy(ExclusionStrategy exclusionStrategy, boolean serialization, boolean deserialization) -
create
Description copied from interface:TypeAdapterFactory
Returns a type adapter fortype
, or null if this factory doesn't supporttype
.- Specified by:
create
in interfaceTypeAdapterFactory
-
excludeField
-
excludeClass
-