public Thumbnails unmarshall(JsonUnmarshallerContext context) throws Exception { Thumbnails thumbnails = new Thumbnails(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); 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("Format", targetDepth)) { context.nextToken(); thumbnails.setFormat(StringJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("Interval", targetDepth)) { context.nextToken(); thumbnails.setInterval(StringJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("Resolution", targetDepth)) { context.nextToken(); thumbnails.setResolution(StringJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("AspectRatio", targetDepth)) { context.nextToken(); thumbnails.setAspectRatio(StringJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("MaxWidth", targetDepth)) { context.nextToken(); thumbnails.setMaxWidth(StringJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("MaxHeight", targetDepth)) { context.nextToken(); thumbnails.setMaxHeight(StringJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("SizingPolicy", targetDepth)) { context.nextToken(); thumbnails.setSizingPolicy(StringJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("PaddingPolicy", targetDepth)) { context.nextToken(); thumbnails.setPaddingPolicy(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 thumbnails; }