public Artwork unmarshall(JsonUnmarshallerContext context) throws Exception { Artwork artwork = new Artwork(); 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("InputKey", targetDepth)) { context.nextToken(); artwork.setInputKey(StringJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("MaxWidth", targetDepth)) { context.nextToken(); artwork.setMaxWidth(StringJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("MaxHeight", targetDepth)) { context.nextToken(); artwork.setMaxHeight(StringJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("SizingPolicy", targetDepth)) { context.nextToken(); artwork.setSizingPolicy(StringJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("PaddingPolicy", targetDepth)) { context.nextToken(); artwork.setPaddingPolicy(StringJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("AlbumArtFormat", targetDepth)) { context.nextToken(); artwork.setAlbumArtFormat(StringJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("Encryption", targetDepth)) { context.nextToken(); artwork.setEncryption(EncryptionJsonUnmarshaller.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 artwork; }
public JobWatermark unmarshall(JsonUnmarshallerContext context) throws Exception { JobWatermark jobWatermark = new JobWatermark(); 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("PresetWatermarkId", targetDepth)) { context.nextToken(); jobWatermark.setPresetWatermarkId( StringJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("InputKey", targetDepth)) { context.nextToken(); jobWatermark.setInputKey(StringJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("Encryption", targetDepth)) { context.nextToken(); jobWatermark.setEncryption(EncryptionJsonUnmarshaller.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 jobWatermark; }