Examples of fromJson()


Examples of com.badlogic.gdx.utils.Json.fromJson()

     * @param fileHandle
     *         The JSON file.
     */
    public void load(FileHandle fileHandle) {
        Json json = new Json();
        ObjectMap<String, JsonValue> obj = json.fromJson(ObjectMap.class, fileHandle);
        if(obj != null) {
            for(ObjectMap.Entry<String, JsonValue> entry : obj.entries()) {
                if(entry.value == null) continue;
                EntityTemplate entityTemplate = new EntityTemplate(componentNamespace);
                entityTemplate.read(json, entry.value);
View Full Code Here

Examples of com.dotcms.repackage.com.google.gson.Gson.fromJson()

//      } catch (Exception e) {
//        //TODO
//      }

            Gson gson = new Gson();
            return gson.fromJson( json, new TypeToken<LinkedHashMap<String, String>>() {
            }.getType() );
        }
        return keyValueMap;
    }
View Full Code Here

Examples of com.dubture.getcomposer.core.repositories.Repository.fromJson()

    if (obj instanceof JSONArray) {
      for (Object repo : (JSONArray) obj) {
        if (repo instanceof JSONObject && ((JSONObject)repo).containsKey("type")) {
          String type = (String)((JSONObject)repo).get("type");
          Repository r = RepositoryFactory.create(type);
          r.fromJson(repo);
          add(r);
        }
      }
    }
  }
View Full Code Here

Examples of com.dyuproject.openid.OpenIdUser.fromJSON()

            return null;
        }
       
        Map map = (Map)_json.parse(new StringSource(B64Code.decode(u)));
        OpenIdUser user = new OpenIdUser();
        user.fromJSON(map);
        return user;
    }
   
    @SuppressWarnings("unchecked")
    OpenIdUser getUserByDecryption(Cookie cookie)
View Full Code Here

Examples of com.esotericsoftware.jsonbeans.Json.fromJson()

      System.out.println("Can't find the supplied config file, or the default file.");
      System.exit(0);
    }
    else {
      String configContent = readFile(configFile);
      config = json.fromJson(BundlerConfig.class, configContent);
    }
   
    if(config == null){
      System.out.println("Something went wrong while loading the config file. Abort.");
      System.exit(0);
View Full Code Here

Examples of com.findwise.hydra.JsonDeserializer.fromJson()

            field.setAccessible(true);
          }
          if(hasInterface(field.getType(), JsonDeserializer.class)) {
            try {
              JsonDeserializer jd = (JsonDeserializer) field.getType().newInstance();
              jd.fromJson(SerializationUtils.toJson(map.get(parameterName)));
              field.set(o, jd);
            } catch (InstantiationException e) {
              field.set(o, map.get(parameterName));
            } catch (JsonException e) {
              field.set(o, map.get(parameterName));
View Full Code Here

Examples of com.findwise.hydra.admin.database.AdminServiceQuery.fromJson()

  public Map<String, Object> getNumberOfDocuments(String jsonQuery) {
    Map<String, Object> ret = new HashMap<String, Object>();

    try {
      DatabaseQuery<AdminServiceType> query = new AdminServiceQuery();
      query.fromJson(jsonQuery);
      ret.put("numberOfDocuments", getNumberOfDocuments(connector.convert(query)));

    } catch (JsonException e) {
      Map<String, String> error = new HashMap<String, String>();
      error.put("Invalid query", jsonQuery);
View Full Code Here

Examples of com.google.gson.Gson.fromJson()

    protected XingUser fetchUser(final Token accessToken) throws Exception {
        final OAuthRequest request = new OAuthRequest(Verb.GET, usersMeUrl);
        oAuthService.signRequest(accessToken, request);
        final Response response = request.send();
        final Gson gson = new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create();
        final Users users = gson.fromJson(response.getBody(), Users.class);
        return users.getUsers().get(0);
    }

    protected void removeAuthFromSession(final HttpServletRequest request) {
        try {
View Full Code Here

Examples of com.google.gson.Gson.fromJson()

        return null;
    }

    public static XingUser fromJson(final String json) {
        final Gson gson = new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create();
        return gson.fromJson(json, XingUser.class);
    }

    public static String hash(final String json, final String secretKey, final String hashAlgorithm) throws InvalidKeyException, NoSuchAlgorithmException, UnsupportedEncodingException {
        final Gson gson = new Gson();
        final List<String> list = new ArrayList<String>();
View Full Code Here

Examples of com.google.gson.Gson.fromJson()

    }

    public static String hash(final String json, final String secretKey, final String hashAlgorithm) throws InvalidKeyException, NoSuchAlgorithmException, UnsupportedEncodingException {
        final Gson gson = new Gson();
        final List<String> list = new ArrayList<String>();
        final Map map = gson.fromJson(json, Map.class);
        join(map, list, "");
        Collections.sort(list);
        final String message = StringUtils.join(list, null);
        final byte[] result = hmac(message, secretKey, hashAlgorithm);
        return Hex.encodeHexString(result);
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.