private Object filterHTMLTag(Object obj) throws Exception{
if(obj==null) return obj;
Class objCls=obj.getClass();
Field[] allFields=objCls.getDeclaredFields();
if(allFields!=null && allFields.length!=0){
HTMLFilter filter=new HTMLFilter();
for(Field field: allFields){
if(field!=null){
if(field.getType().equals(String.class)){
String getMethod="get"+upperCaseFirstChar(field.getName());
String setMethod="set"+upperCaseFirstChar(field.getName());
try {
//String value=(String)objCls.getMethod(getMethod).invoke(obj);
//value=filter.filter(value);
//objCls.getMethod(setMethod, value.getClass()).invoke(obj, value);
} catch (Exception e) {
throw e;
}
}
}
}
}
return obj;
}
posted on 2012-12-03 10:49
老天 阅读(232)
评论(0) 编辑 收藏