You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 23, 2024. It is now read-only.
需要jsonToString 一个 java bean, 使用了PropertyFilter 和 SerializerFeature.BeanToArray ,想要筛选几个需要的属性,然后去掉key,array输出, code 类似:
SimplePropertyPreFilter classAFilter = new SimplePropertyPreFilter(ClassA.class, "code");
SerializeFilter[] filters =new SerializeFilter[]{classAFilter};
JSON.toJSONString(classA, filters, SerializerFeature.BeanToArray );
但是结果,显示只有SerializerFeature.BeanToArray 起了作用,filter 没有
如果去掉feature, 则可以使filter 起作用
问,如何同时起作用?