Simple Solution
  • Java
  • Spring
  • Spring Boot
  • Tutorials
  • Tags
Java Gson exclude fields using ExclusionStrategy interface
Java Gson exclude fields using ExclusionStrategy interface

In this Java Gson tutorial we learn how to exclude fields during serialization or deserialize JSON by using the ExclusionStrategy interface. Via step by step tutorial we will show you how to use the GsonBuilder.setExclusionStrategies() method and com.google.gson.ExclusionStrategy interface to configure Gson to exclude fields based on custom implementation.

Java Gson exclude fields using @Expose annotation
Java Gson exclude fields using @Expose annotation

In this Java Gson tutorial we learn how to exclude fields during serialization or deserialize JSON to exclude fields based on @Expose annotation. Via step by step tutorial we will show you how to use the GsonBuilder.excludeFieldsWithoutExposeAnnotation() method to configure Gson to exclude fields without @Expose annotation.

Java Gson exclude fields with modifiers
Java Gson exclude fields with modifiers

In this tutorial we learn how to configure Gson to exclude fields during serialization or deserialize JSON to exclude fields with specific access modifiers. Via step by step example we will show you how to use the GsonBuilder.excludeFieldsWithModifiers() method to override Gson configuration to exclude fields by given modifiers.

Copyright © 2019 SimpleSolution.dev. All Rights Reserved.