Package com.nimbusds.oauth2.sdk

Examples of com.nimbusds.oauth2.sdk.ErrorObject


  @SuppressWarnings("unchecked")
  public static <T> T getGeneric(final JSONObject o, final String key, final Class<T> clazz)
    throws ParseException {
 
    if (! o.containsKey(key))
      throw new ParseException("Missing JSON object member with key \"" + key + "\"");
   
    if (o.get(key) == null)
      throw new ParseException("JSON object member with key \"" + key + "\" has null value");
   
    Object value = o.get(key);
   
    if (! clazz.isAssignableFrom(value.getClass()))
      throw new ParseException("Unexpected type of JSON object member with key \"" + key + "\"");
   
    return (T)value;
  }
View Full Code Here


   */
  public void ensureStatusCodeNotOK()
    throws ParseException {

    if (statusCode == SC_OK)
      throw new ParseException("Unexpected HTTP status code, must not be 200 (OK)");
  }
View Full Code Here

            
      if (en.toString().equalsIgnoreCase(value))
        return en;
    }

    throw new ParseException("Unexpected value of JSON object member with key \"" + key + "\"");
  }
View Full Code Here

   */
  private void ensureContent()
    throws ParseException {
   
    if (content == null || content.isEmpty())
      throw new ParseException("Missing or empty HTTP response body");
  }
View Full Code Here

    try {
      return JWTParser.parse(content);
     
    } catch (java.text.ParseException e) {
   
      throw new ParseException(e.getMessage(), e);
    }
  }
View Full Code Here

    try {
      return new URI(getGeneric(o, key, String.class));

    } catch (URISyntaxException e) {

      throw new ParseException(e.getMessage(), e);
    }
  }
View Full Code Here

    try {
      return new URL(getGeneric(o, key, String.class));
     
    } catch (MalformedURLException e) {
   
      throw new ParseException(e.getMessage(), e);
    }
  }
View Full Code Here

     
      return new InternetAddress(getGeneric(o, key, String.class), strict);
     
    } catch (AddressException e) {
   
      throw new ParseException(e.getMessage(), e);
    }
  }
View Full Code Here

    try {
      return list.toArray(new String[0]);

    } catch (ArrayStoreException e) {

      throw new ParseException("JSON object member with key \"" + key + "\" is not an array of strings");
    }
  }
View Full Code Here

      try {
        set.add((String)item);

      } catch (Exception e) {

        throw new ParseException("JSON object member wit key \"" + key + "\" is not an array of strings");
      }

    }

    return set;
View Full Code Here

TOP

Related Classes of com.nimbusds.oauth2.sdk.ErrorObject

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.