public PutPipelineDefinitionResult unmarshall(JsonUnmarshallerContext context) throws Exception { PutPipelineDefinitionResult putPipelineDefinitionResult = new PutPipelineDefinitionResult(); 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("validationErrors", targetDepth)) { putPipelineDefinitionResult.setValidationErrors( new ListUnmarshaller<ValidationError>(ValidationErrorJsonUnmarshaller.getInstance()) .unmarshall(context)); } if (context.testExpression("errored", targetDepth)) { context.nextToken(); putPipelineDefinitionResult.setErrored( BooleanJsonUnmarshaller.getInstance().unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getCurrentDepth() <= originalDepth) break; } token = context.nextToken(); } return putPipelineDefinitionResult; }
public QueryObjectsResult unmarshall(JsonUnmarshallerContext context) throws Exception { QueryObjectsResult queryObjectsResult = new QueryObjectsResult(); 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("ids", targetDepth)) { context.nextToken(); queryObjectsResult.setIds( new ListUnmarshaller<String>(StringJsonUnmarshaller.getInstance()) .unmarshall(context)); } if (context.testExpression("marker", targetDepth)) { context.nextToken(); queryObjectsResult.setMarker(StringJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("hasMoreResults", targetDepth)) { context.nextToken(); queryObjectsResult.setHasMoreResults( BooleanJsonUnmarshaller.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 queryObjectsResult; }