public GetCampaignVersionsResult unmarshall(JsonUnmarshallerContext context) throws Exception { GetCampaignVersionsResult getCampaignVersionsResult = new GetCampaignVersionsResult(); if (context.getHeader("Access-Control-Allow-Origin") != null) getCampaignVersionsResult.setAccessControlAllowOrigin( context.getHeader("Access-Control-Allow-Origin")); return getCampaignVersionsResult; }
public GetSegmentVersionsResult unmarshall(JsonUnmarshallerContext context) throws Exception { GetSegmentVersionsResult getSegmentVersionsResult = new GetSegmentVersionsResult(); 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; getSegmentVersionsResult.setSegmentsResponse( SegmentsResponseJsonUnmarshaller.getInstance().unmarshall(context)); token = context.nextToken(); } return getSegmentVersionsResult; }
public UpdateEndpointResult unmarshall(JsonUnmarshallerContext context) throws Exception { UpdateEndpointResult updateEndpointResult = new UpdateEndpointResult(); 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; updateEndpointResult.setMessageBody( MessageBodyJsonUnmarshaller.getInstance().unmarshall(context)); token = context.nextToken(); } return updateEndpointResult; }
public EndpointLocation unmarshall(JsonUnmarshallerContext context) throws Exception { EndpointLocation endpointLocation = new EndpointLocation(); 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("City", targetDepth)) { context.nextToken(); endpointLocation.setCity(context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("Country", targetDepth)) { context.nextToken(); endpointLocation.setCountry(context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("Latitude", targetDepth)) { context.nextToken(); endpointLocation.setLatitude(context.getUnmarshaller(Double.class).unmarshall(context)); } if (context.testExpression("Longitude", targetDepth)) { context.nextToken(); endpointLocation.setLongitude(context.getUnmarshaller(Double.class).unmarshall(context)); } if (context.testExpression("PostalCode", targetDepth)) { context.nextToken(); endpointLocation.setPostalCode(context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("Region", targetDepth)) { context.nextToken(); endpointLocation.setRegion(context.getUnmarshaller(String.class).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 endpointLocation; }
public GCMChannelRequest unmarshall(JsonUnmarshallerContext context) throws Exception { GCMChannelRequest gCMChannelRequest = new GCMChannelRequest(); 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("ApiKey", targetDepth)) { context.nextToken(); gCMChannelRequest.setApiKey(context.getUnmarshaller(String.class).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 gCMChannelRequest; }