日期:2014-05-17 浏览次数:20715 次
/**
* Json配置按类对象映射属性过滤器.
*
* @author MaYichao
* @since 1.0
*/
public class ClassMappingPropertyFilter extends MappingPropertyFilter {
@Override
protected boolean keyMatches(Object key, Object source, String name, Object value) {
Class c = (Class) key;
return c.isInstance(source);
}
@Override
public boolean apply(Object source, String name, Object value) {
// if (name.equals("imagePath")) {
// return true;
// }
if (value == null
------解决方案--------------------
value instanceof JSONNull) {
return true;
}
return super.apply(source, name, value);
}
}
/**
* Json配置包含属性过滤器.
*
* @author MaYichao
* @since 1.0
*/
public class IncludePropertyFilter implements PropertyFilter {
/**
* 需要包含的属性列表.
*/
private List<String> properties = null;