Package net.minidev.json

Examples of net.minidev.json.JSONArray


    if (aud != null && ! aud.isEmpty()) {

      if (aud.size() == 1) {
        o.put(AUDIENCE_CLAIM, aud.get(0));
      } else {
        JSONArray audArray = new JSONArray();
        audArray.addAll(aud);
        o.put(AUDIENCE_CLAIM, audArray);
      }
    }

    if (exp != null) {
View Full Code Here


      String rec = arg1.toString();
      obj = (JSONObject) parser.parse(rec);

      short owner = ((Long) obj.get("owner")).shortValue();
      out.collect(new IntWritable(owner), new Text(rec));
      JSONArray mirrors = (JSONArray) obj.get("mirrors");
      for (int j = 0; j < mirrors.size(); j++) {
        out.collect(new IntWritable(((Long) mirrors.get(j)).intValue()),
            new Text(rec));
      }
    } catch (ParseException e) {
      e.printStackTrace();
    }
View Full Code Here

   * @param resultList
   */
  protected void handleResults(JSONObject results,
      LinkedList<Map<String, VariableBinding>> resultList) {
    _log.debug("Handling results {}", results);
    final JSONArray bindingsArray = (JSONArray) results.get(KEY_BINDINGS);
    final Iterator<Object> bindingsIt = bindingsArray.iterator();
    while (bindingsIt.hasNext()) {
      handleBinding((JSONObject) bindingsIt.next(), resultList);
    }
  }
View Full Code Here

      o = new JSONObject();


    if (redirectURIs != null) {

      JSONArray uriList = new JSONArray();

      for (URI uri: redirectURIs)
        uriList.add(uri.toString());

      o.put("redirect_uris", uriList);
    }


    if (scope != null)
      o.put("scope", scope.toString());


    if (responseTypes != null) {

      JSONArray rtList = new JSONArray();

      for (ResponseType rt: responseTypes)
        rtList.add(rt.toString());

      o.put("response_types", rtList);
    }


    if (grantTypes != null) {

      JSONArray grantList = new JSONArray();

      for (GrantType grant: grantTypes)
        grantList.add(grant.toString());

      o.put("grant_types", grantList);
    }


    if (contacts != null) {

      JSONArray contactList = new JSONArray();

      for (InternetAddress email: contacts)
        contactList.add(email.toString());

      o.put("contacts", contactList);
    }

View Full Code Here

        final Date iat) {

    setClaim(ISS_CLAIM_NAME, iss.getValue());
    setClaim(SUB_CLAIM_NAME, sub.getValue());

    JSONArray audList = new JSONArray();

    for (Audience a: aud)
      audList.add(a.getValue());

    setClaim(AUD_CLAIM_NAME, audList);

    setDateClaim(EXP_CLAIM_NAME, exp);
    setDateClaim(IAT_CLAIM_NAME, iat);
View Full Code Here

      o.put("sector_identifier_uri", sectorIDURI.toString());
   
   
    if (requestObjectURIs != null) {
     
      JSONArray uriList = new JSONArray();
     
      for (URI uri: requestObjectURIs)
        uriList.add(uri.toString());
     
      o.put("request_uris", uriList);
    }


    if (requestObjectJWSAlg != null)
      o.put("request_object_signing_alg", requestObjectJWSAlg.getName());

    if (requestObjectJWEAlg != null)
      o.put("request_object_encryption_alg", requestObjectJWEAlg.getName());

    if (requestObjectJWEEnc != null)
      o.put("request_object_encryption_enc", requestObjectJWEEnc.getName());

    if (authJWSAlg != null)
      o.put("token_endpoint_auth_signing_alg", authJWSAlg.getName());


    if (idTokenJWSAlg != null)
      o.put("id_token_signed_response_alg", idTokenJWSAlg.getName());


    if (idTokenJWEAlg != null)
      o.put("id_token_encrypted_response_alg", idTokenJWEAlg.getName());


    if (idTokenJWEEnc != null)
      o.put("id_token_encrypted_response_enc", idTokenJWEEnc.getName());


    if (userInfoJWSAlg != null)
      o.put("userinfo_signed_response_alg", userInfoJWSAlg.getName());


    if (userInfoJWEAlg != null)
      o.put("userinfo_encrypted_response_alg", userInfoJWEAlg.getName());


    if (userInfoJWEEnc != null)
      o.put("userinfo_encrypted_response_enc", userInfoJWEEnc.getName());


    if (defaultMaxAge > 0)
      o.put("default_max_age", defaultMaxAge);


    if (requiresAuthTime())
      o.put("require_auth_time", requiresAuthTime);


    if (defaultACRs != null) {

      JSONArray acrList = new JSONArray();

      for (ACR acr: defaultACRs)
        acrList.add(acr);

      o.put("default_acr_values", acrList);
    }


    if (initiateLoginURI != null)
      o.put("initiate_login_uri", initiateLoginURI.toString());


    if (postLogoutRedirectURIs != null) {

      JSONArray uriList = new JSONArray();

      for (URI uri: postLogoutRedirectURIs)
        uriList.add(uri.toString());

      o.put("post_logout_redirect_uris", uriList);
    }

    return o;
View Full Code Here

    if (qi != null) {
      o.put("qi", qi.toString());
    }
    if (oth != null && !oth.isEmpty()) {

      JSONArray a = new JSONArray();

      for (OtherPrimesInfo other : oth) {

        JSONObject oo = new JSONObject();
        oo.put("r", other.r.toString());
        oo.put("d", other.d.toString());
        oo.put("t", other.t.toString());

        a.add(oo);
      }

      o.put("oth", a);
    }
View Full Code Here

    }
   
    List<OtherPrimesInfo> oth = null;
    if (jsonObject.containsKey("oth")) {

      JSONArray arr = JSONObjectUtils.getJSONArray(jsonObject, "oth");
      oth = new ArrayList<>(arr.size());
     
      for (Object o : arr) {

        if (o instanceof JSONObject) {
          JSONObject otherJson = (JSONObject)o;
View Full Code Here

   */
  public JSONObject toJSONObject(final boolean publicKeysOnly) {

    JSONObject o = new JSONObject(customMembers);

    JSONArray a = new JSONArray();

    for (JWK key: keys) {

      if (publicKeysOnly) {

        // Try to get public key, then serialise
        JWK publicKey = key.toPublicJWK();

        if (publicKey != null) {
          a.add(publicKey.toJSONObject());
        }
      } else {

        a.add(key.toJSONObject());
      }
    }

    o.put("keys", a);

View Full Code Here

   *                        JSON Web Key (JWK) set.
   */
  public static JWKSet parse(final JSONObject json)
    throws ParseException {

    JSONArray keyArray = JSONObjectUtils.getJSONArray(json, "keys");

    List<JWK> keys = new LinkedList<>();

    for (int i=0; i < keyArray.size(); i++) {

      if (! (keyArray.get(i) instanceof JSONObject)) {
        throw new ParseException("The \"keys\" JSON array must contain JSON objects only", 0);
      }

      JSONObject keyJSON = (JSONObject)keyArray.get(i);

      try {
        keys.add(JWK.parse(keyJSON));

      } catch (ParseException e) {
View Full Code Here

TOP

Related Classes of net.minidev.json.JSONArray

Copyright © 2018 www.massapicom. 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.