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; }
/** * The name of the .png or .jpg file that you want to use for the watermark. To determine which * Amazon S3 bucket contains the specified file, Elastic Transcoder checks the pipeline specified * by <code>Pipeline</code>; the <code>Input Bucket</code> object in that pipeline identifies the * bucket. * * <p>If the file name includes a prefix, for example, <b>logos/128x64.png</b>, include the prefix * in the key. If the file isn't in the specified bucket, Elastic Transcoder returns an error. * * @param inputKey The name of the .png or .jpg file that you want to use for the watermark. To * determine which Amazon S3 bucket contains the specified file, Elastic Transcoder checks the * pipeline specified by <code>Pipeline</code>; the <code>Input Bucket</code> object in that * pipeline identifies the bucket. * <p>If the file name includes a prefix, for example, <b>logos/128x64.png</b>, include the * prefix in the key. If the file isn't in the specified bucket, Elastic Transcoder returns an * error. * @return Returns a reference to this object so that method calls can be chained together. */ public JobWatermark withInputKey(String inputKey) { setInputKey(inputKey); return this; }