use of com.alibaba.json.test.entity.pagemodel.WidgetInstance in project fastjson by alibaba.
the class JacksonPageModelParser method parseWidgets.
/**
* @param parser
* @param layoutId
* @param regionId
* @throws JsonParseException
* @throws IOException
*/
private List<WidgetInstance> parseWidgets(JsonParser parser, RegionEnum region) throws JsonParseException, IOException {
JsonToken current = parser.nextToken();
assertExpectedJsonToken(current, JsonToken.START_ARRAY, parser.getCurrentLocation());
List<WidgetInstance> widgetInThisRegion = new ArrayList<WidgetInstance>();
while ((current = parser.nextToken()) != JsonToken.END_ARRAY) {
assertExpectedJsonToken(current, JsonToken.START_OBJECT, parser.getCurrentLocation());
// get
String instanceId = getNextTextValue("sid", parser);
// instanceId
// get
String widgetId = getNextTextValue("cid", parser);
// widgetId
WidgetInstance widgetInstance = new WidgetInstance();
widgetInstance.setCid(widgetId);
widgetInstance.setSid(Long.valueOf(instanceId));
widgetInThisRegion.add(widgetInstance);
assertExpectedJsonToken((current = parser.nextToken()), JsonToken.END_OBJECT, parser.getCurrentLocation());
}
return widgetInThisRegion;
}
Aggregations