Skip to content

Commit

Permalink
support setUseGsonAnnotation, for issue #3258
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Jan 11, 2025
1 parent 949e867 commit 3d1cb1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/src/main/java/com/alibaba/fastjson2/JSONFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,10 @@ public static void setUseJacksonAnnotation(boolean useJacksonAnnotation) {
JSONFactory.useJacksonAnnotation = useJacksonAnnotation;
}

public static void setUseGsonAnnotation(boolean useGsonAnnotation) {
JSONFactory.useGsonAnnotation = useGsonAnnotation;
}

static final CacheItem[] CACHE_ITEMS;

static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public void test1() {
JSONFactory.setUseJacksonAnnotation(false);
assertFalse(JSONFactory.isUseJacksonAnnotation());
JSONFactory.setUseJacksonAnnotation(true);
JSONFactory.setUseGsonAnnotation(true);
assertTrue(JSONFactory.isUseJacksonAnnotation());

ObjectWriterProvider provider = JSONFactory.getDefaultObjectWriterProvider();
Expand Down

0 comments on commit 3d1cb1d

Please sign in to comment.