Package com.google.api.client.json.jackson

Examples of com.google.api.client.json.jackson.JacksonFactory.fromString()


      + "\"refresh_token\":\"tGzv3JOkF0XG5Qx2TlKWIA\","
      + "\"example_parameter\":\"example_value\"}";

  public void test() throws Exception {
    JsonFactory jsonFactory = new JacksonFactory();
    TokenResponse response = jsonFactory.fromString(JSON, TokenResponse.class);
    assertEquals("2YotnFZFEjr1zCsicMWpAA", response.getAccessToken());
    assertEquals("example", response.getTokenType());
    assertEquals(3600L, response.getExpiresInSeconds().longValue());
    assertEquals("tGzv3JOkF0XG5Qx2TlKWIA", response.getRefreshToken());
    assertEquals("example_value", response.get("example_parameter"));
View Full Code Here


      + "\"error_uri\":\"http://www.example.com/error\","
      + "\"error_description\":\"error description\"}";

  public void test() throws Exception {
    JsonFactory jsonFactory = new JacksonFactory();
    TokenErrorResponse response = jsonFactory.fromString(JSON, TokenErrorResponse.class);
    assertEquals("invalid_request", response.getError());
    assertEquals("http://www.example.com/error", response.getErrorUri());
    assertEquals("error description", response.getErrorDescription());
  }
}
View Full Code Here

            JacksonFactory jacksonFactory = new JacksonFactory();
            if (facet.attendeesStorage!=null) {
                this.attendees = new ArrayList<EventAttendee>();
                String[] attendees = facet.attendeesStorage.split("\\|");
                for (String attendee : attendees) {
                    final EventAttendee eventAttendee = jacksonFactory.fromString(attendee, EventAttendee.class);
                    eventAttendee.put("attendeeStatusClass", toCssClass(eventAttendee.getResponseStatus()));
                    this.attendees.add(eventAttendee);
                }
            }
            if (facet.creatorStorage!=null)
View Full Code Here

                    eventAttendee.put("attendeeStatusClass", toCssClass(eventAttendee.getResponseStatus()));
                    this.attendees.add(eventAttendee);
                }
            }
            if (facet.creatorStorage!=null)
                creator = jacksonFactory.fromString(facet.creatorStorage, Event.Creator.class);
            if (facet.organizerStorage!=null)
                organizer = jacksonFactory.fromString(facet.organizerStorage, Event.Organizer.class);
            this.description = facet.description;
            this.summary = facet.summary;
            this.apiKeyId = facet.apiKeyId;
View Full Code Here

                }
            }
            if (facet.creatorStorage!=null)
                creator = jacksonFactory.fromString(facet.creatorStorage, Event.Creator.class);
            if (facet.organizerStorage!=null)
                organizer = jacksonFactory.fromString(facet.organizerStorage, Event.Organizer.class);
            this.description = facet.description;
            this.summary = facet.summary;
            this.apiKeyId = facet.apiKeyId;
            this.calendarId = facet.calendarId;
            if (facet.location!=null)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.