public WorkflowExecutionInfos unmarshall(JsonUnmarshallerContext context) throws Exception { WorkflowExecutionInfos workflowExecutionInfos = new WorkflowExecutionInfos(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; JsonToken token = context.currentToken; if (token == null) token = context.nextToken(); while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("executionInfos", targetDepth)) { workflowExecutionInfos.setExecutionInfos( new ListUnmarshaller<WorkflowExecutionInfo>( WorkflowExecutionInfoJsonUnmarshaller.getInstance()) .unmarshall(context)); } if (context.testExpression("nextPageToken", targetDepth)) { context.nextToken(); workflowExecutionInfos.setNextPageToken( StringJsonUnmarshaller.getInstance().unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getCurrentDepth() <= originalDepth) break; } token = context.nextToken(); } return workflowExecutionInfos; }
public WorkflowExecutionDetail unmarshall(JsonUnmarshallerContext context) throws Exception { WorkflowExecutionDetail workflowExecutionDetail = new WorkflowExecutionDetail(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) return null; while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("executionInfo", targetDepth)) { context.nextToken(); workflowExecutionDetail.setExecutionInfo( WorkflowExecutionInfoJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("executionConfiguration", targetDepth)) { context.nextToken(); workflowExecutionDetail.setExecutionConfiguration( WorkflowExecutionConfigurationJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("openCounts", targetDepth)) { context.nextToken(); workflowExecutionDetail.setOpenCounts( WorkflowExecutionOpenCountsJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("latestActivityTaskTimestamp", targetDepth)) { context.nextToken(); workflowExecutionDetail.setLatestActivityTaskTimestamp( DateJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("latestExecutionContext", targetDepth)) { context.nextToken(); workflowExecutionDetail.setLatestExecutionContext( StringJsonUnmarshaller.getInstance().unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return workflowExecutionDetail; }