
org.jeewx.api.extend.CustomJsonConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of weixin4j Show documentation
Show all versions of weixin4j Show documentation
微信和钉钉开发SDK,主要提供微信、企业微信、钉钉的JAVA封装,降低集成难度,让API变简单
The newest version!
package org.jeewx.api.extend;
import com.alibaba.fastjson.serializer.PropertyFilter;
import com.alibaba.fastjson.support.config.FastJsonConfig;
/**
* 过滤不需要转换的属性
* @author luobaoli
*
*/
public class CustomJsonConfig extends FastJsonConfig {
@SuppressWarnings("rawtypes")
private Class clazz;
public CustomJsonConfig(){
}
public CustomJsonConfig(Class clazz,final String exclude){
this.clazz = clazz;
setSerializeFilters(new PropertyFilter() {
public boolean apply(Object arg0, String param, Object arg2) {
if(param.equals(exclude))return true;
return false;
}
});
}
public CustomJsonConfig(Class clazz,final String[] excludes){
this.clazz = clazz;
setSerializeFilters(new PropertyFilter() {
public boolean apply(Object arg0, String param, Object arg2) {
for(String exclude:excludes){
if(param.equals(exclude))return true;
}
return false;
}
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy