本文整理匯總了Java中com.alibaba.fastjson.serializer.FilterUtils類的典型用法代碼示例。如果您正苦於以下問題:Java FilterUtils類的具體用法?Java FilterUtils怎麽用?Java FilterUtils使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
FilterUtils類屬於com.alibaba.fastjson.serializer包,在下文中一共展示了FilterUtils類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: parseExtra
import com.alibaba.fastjson.serializer.FilterUtils; //導入依賴的package包/類
void parseExtra(DefaultJSONParser parser, Object object, String key) {
JSONLexer lexer = parser.getLexer();
if (lexer.isEnabled(Feature.IgnoreNotMatch)) {
Object value;
lexer.nextTokenWithColon();
Type type = FilterUtils.getExtratype(parser, object, key);
if (type == null) {
value = parser.parse();
} else {
value = parser.parseObject(type);
}
FilterUtils.processExtra(parser, object, key, value);
return;
}
throw new JSONException("setter not found, class " + this.clazz.getName() + ", property " + key);
}
示例2: parseExtra
import com.alibaba.fastjson.serializer.FilterUtils; //導入依賴的package包/類
void parseExtra(DefaultJSONParser parser, Object object, String key) {
final JSONLexer lexer = parser.getLexer(); // xxx
if (!lexer.isEnabled(Feature.IgnoreNotMatch)) {
throw new JSONException("setter not found, class " + clazz.getName() + ", property " + key);
}
lexer.nextTokenWithColon();
Type type = FilterUtils.getExtratype(parser, object, key);
Object value;
if (type == null) {
value = parser.parse(); // skip
} else {
value = parser.parseObject(type);
}
FilterUtils.processExtra(parser, object, key, value);
}