Excluder
Date: 2016-11-03

com.google.gson.internal

## Class Excluder

- java.lang.Object
- - com.google.gson.internal.Excluder

- All Implemented Interfaces:
    TypeAdapterFactory, java.lang.Cloneable

      public final class Excluder
      extends java.lang.Object
      implements TypeAdapterFactory, java.lang.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.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Excluder` | `DEFAULT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Excluder()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Excluder` | `clone()`
    `<T> TypeAdapter<T>` | `create(Gson gson, TypeToken<T> type)` Returns a type adapter for `type`, or null if this factory doesn't support `type`.
    `Excluder` | `disableInnerClassSerialization()`
    `boolean` | `excludeClass(java.lang.Class<?> clazz, boolean serialize)`
    `boolean` | `excludeField(java.lang.reflect.Field field, boolean serialize)`
    `Excluder` | `excludeFieldsWithoutExposeAnnotation()`
    `Excluder` | `withExclusionStrategy(ExclusionStrategy exclusionStrategy, boolean serialization, boolean deserialization)`
    `Excluder` | `withModifiers(int... modifiers)`
    `Excluder` | `withVersion(double ignoreVersionsAfter)`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT

          public static final Excluder DEFAULT

  - ### Constructor Detail

    - #### Excluder

          public Excluder()

  - ### Method Detail

    - #### clone

          protected Excluder clone()

      Overrides:
        `clone` in class `java.lang.Object`

    - #### withVersion

          public Excluder withVersion(double ignoreVersionsAfter)

    - #### withModifiers

          public Excluder withModifiers(int... modifiers)

    - #### disableInnerClassSerialization

          public Excluder disableInnerClassSerialization()

    - #### excludeFieldsWithoutExposeAnnotation

          public Excluder excludeFieldsWithoutExposeAnnotation()

    - #### withExclusionStrategy

          public Excluder withExclusionStrategy(ExclusionStrategy exclusionStrategy,
                                       boolean serialization,
                                       boolean deserialization)

    - #### create

          public <T> TypeAdapter<T> create(Gson gson,
                                  TypeToken<T> type)

      Description copied from interface: `TypeAdapterFactory`
      Returns a type adapter for `type`, or null if this factory doesn't support `type`.
      Specified by:
        `create` in interface `TypeAdapterFactory`

    - #### excludeField

          public boolean excludeField(java.lang.reflect.Field field,
                             boolean serialize)

    - #### excludeClass

          public boolean excludeClass(java.lang.Class<?> clazz,
                             boolean serialize)