public PipelineDescription unmarshall(JsonUnmarshallerContext context) throws Exception { PipelineDescription pipelineDescription = new PipelineDescription(); 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("pipelineId", targetDepth)) { context.nextToken(); pipelineDescription.setPipelineId( StringJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("name", targetDepth)) { context.nextToken(); pipelineDescription.setName(StringJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("fields", targetDepth)) { context.nextToken(); pipelineDescription.setFields( new ListUnmarshaller<Field>(FieldJsonUnmarshaller.getInstance()).unmarshall(context)); } if (context.testExpression("description", targetDepth)) { context.nextToken(); pipelineDescription.setDescription( StringJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("tags", targetDepth)) { context.nextToken(); pipelineDescription.setTags( new ListUnmarshaller<Tag>(TagJsonUnmarshaller.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 pipelineDescription; }
public DescribeTagsResult unmarshall(JsonUnmarshallerContext context) throws Exception { DescribeTagsResult describeTagsResult = new DescribeTagsResult(); 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("ResourceId", targetDepth)) { context.nextToken(); describeTagsResult.setResourceId( context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("ResourceType", targetDepth)) { context.nextToken(); describeTagsResult.setResourceType( context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("Tags", targetDepth)) { context.nextToken(); describeTagsResult.setTags( new ListUnmarshaller<Tag>(TagJsonUnmarshaller.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 describeTagsResult; }