AnnotationT - The type of the annotation to check for.public class AnnotatedFieldGsonExclusionStrategy<AnnotationT extends Annotation> extends Object implements com.google.gson.ExclusionStrategy
ExclusionStrategy excluding all fields not annotated with the given
annotation.
Typical use-case is the usage of an annotation like ElementName. JSON should only (de-)serialize fields
annotated with this annotation and ignore every other field.
| Constructor and Description |
|---|
AnnotatedFieldGsonExclusionStrategy(Class<AnnotationT> annotationClass) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
shouldSkipClass(Class<?> cls) |
boolean |
shouldSkipField(com.google.gson.FieldAttributes fieldAttributes) |
public AnnotatedFieldGsonExclusionStrategy(@Nonnull Class<AnnotationT> annotationClass)
public boolean shouldSkipField(@Nonnull com.google.gson.FieldAttributes fieldAttributes)
shouldSkipField in interface com.google.gson.ExclusionStrategyCopyright © 2021 SAP SE. All rights reserved.