use of com.alibaba.json.test.entity.pagemodel.PageInstance in project fastjson by alibaba.
the class JacksonPageModelParser method parse.
/**
* @param content
* @throws JsonParseException
* @throws IOException
*/
public PageInstance parse(String content) throws JsonParseException, IOException {
JsonFactory f = new JsonFactory();
JsonParser parser = f.createJsonParser(content);
// move to the start of the
JsonToken current = parser.nextToken();
// object
// get instanceId
String instanceId = getNextTextValue("sid", parser);
// get pageId
String pageId = getNextTextValue("cid", parser);
// move to field: segments
current = parser.nextToken();
assertExpectedFiled(parser.getCurrentName(), "segments", parser.getCurrentLocation());
PageInstance pageInstance = new PageInstance();
pageInstance.setCid(pageId);
pageInstance.setSid(Long.valueOf(instanceId));
pageInstance.setSegments(parseSegments(parser));
return pageInstance;
// 构建组件树,用于递归渲染
// pageInstance.buildComponentTree();
}
Aggregations