Merge branch 'master' of github.com:code4craft/webmagic

master
yihua.huang 2017-05-29 21:26:09 +08:00
commit 3c653d941a
1 changed files with 5 additions and 1 deletions

View File

@ -115,7 +115,11 @@ class PageModelExtractor {
}
private ObjectFormatter getObjectFormatter(Field field, Class<?> fieldClazz, Formatter formatter) {
return initFormatter(ObjectFormatters.get(fieldClazz));
ObjectFormatter objectFormatter = initFormatter(ObjectFormatters.get(fieldClazz));
if(formatter != null && formatter.value() != null){
objectFormatter.initParam(formatter.value());
}
return objectFormatter;
}
private ObjectFormatter initFormatter(Class<? extends ObjectFormatter> formatterClazz) {