MCPcopy
hub / github.com/google/gson / ExclusionStrategy

Interface ExclusionStrategy

gson/src/main/java/com/google/gson/ExclusionStrategy.java:94–111  ·  gson/src/main/java/com/google/gson/ExclusionStrategy.java::ExclusionStrategy

A strategy (or policy) definition that is used to decide whether or not a field or class should be serialized or deserialized as part of the JSON output/input. <p>The following are a few examples that shows how you can use this exclusion mechanism. <p><strong>Exclude fields and objects based on a

Source from the content-addressed store, hash-verified

92 * @since 1.4
93 */
94public interface ExclusionStrategy {
95
96 /**
97 * Decides if a field should be skipped during serialization or deserialization.
98 *
99 * @param f the field object that is under test
100 * @return true if the field should be ignored; otherwise false
101 */
102 boolean shouldSkipField(FieldAttributes f);
103
104 /**
105 * Decides if a class should be serialized or deserialized
106 *
107 * @param clazz the class object that is under test
108 * @return true if the class should be ignored; otherwise false
109 */
110 boolean shouldSkipClass(Class<?> clazz);
111}

Callers 2

excludeFieldMethod · 0.65
excludeClassMethod · 0.65

Implementers 5

MyExclusionStrategygson/src/test/java/com/google/gson/fun
Java17RecordTestgson/src/test/java/com/google/gson/fun
ObjectTestgson/src/test/java/com/google/gson/fun
JsonAdapterAnnotationOnFieldsTestgson/src/test/java/com/google/gson/fun
ExclusionStrategyFunctionalTestgson/src/test/java/com/google/gson/fun

Calls

no outgoing calls

Tested by

no test coverage detected