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(Class<AnnotationT> annotationClass)
public boolean shouldSkipField(com.google.gson.FieldAttributes fieldAttributes)
shouldSkipField
in interface com.google.gson.ExclusionStrategy
public boolean shouldSkipClass(Class<?> cls)
shouldSkipClass
in interface com.google.gson.ExclusionStrategy
Copyright © 2018 SAP SE. All rights reserved.