Package org.codehaus.jettison.json

Examples of org.codehaus.jettison.json.JSONObject.optString()


                            jsOpt.optString("@alias"));
                    opt.param._acceptableValues = jsOpt.optString("@acceptable-values");
                    if ("PASSWORD".equals(type)) {
                        opt.param._password = true;
                        opt.prompt = jsOpt.optString("@prompt");
                        opt.promptAgain = jsOpt.optString("@prompt-again");
                    } else if ("FILE".equals(type)) {
                        sawFile = true;
                    }
                    if (jsOpt.optBoolean("@primary", false)) {
                        opt.param._primary = true;
View Full Code Here


       *
       * partsData.optString("PC_PARTS_TITLE", "NULL");
       * You can add a second parameter, it will return NULL if PC_PARTS_TITLE does not
       * exist.
       */
      int http_code = dao.insertIntoPC_PARTS(partsData.optString("PC_PARTS_TITLE"),
                            partsData.optString("PC_PARTS_CODE"),
                            partsData.optString("PC_PARTS_MAKER"),
                            partsData.optString("PC_PARTS_AVAIL"),
                            partsData.optString("PC_PARTS_DESC") );
     
View Full Code Here

       * partsData.optString("PC_PARTS_TITLE", "NULL");
       * You can add a second parameter, it will return NULL if PC_PARTS_TITLE does not
       * exist.
       */
      int http_code = dao.insertIntoPC_PARTS(partsData.optString("PC_PARTS_TITLE"),
                            partsData.optString("PC_PARTS_CODE"),
                            partsData.optString("PC_PARTS_MAKER"),
                            partsData.optString("PC_PARTS_AVAIL"),
                            partsData.optString("PC_PARTS_DESC") );
     
      if( http_code == 200 ) {
View Full Code Here

       * You can add a second parameter, it will return NULL if PC_PARTS_TITLE does not
       * exist.
       */
      int http_code = dao.insertIntoPC_PARTS(partsData.optString("PC_PARTS_TITLE"),
                            partsData.optString("PC_PARTS_CODE"),
                            partsData.optString("PC_PARTS_MAKER"),
                            partsData.optString("PC_PARTS_AVAIL"),
                            partsData.optString("PC_PARTS_DESC") );
     
      if( http_code == 200 ) {
        /*
 
View Full Code Here

       * exist.
       */
      int http_code = dao.insertIntoPC_PARTS(partsData.optString("PC_PARTS_TITLE"),
                            partsData.optString("PC_PARTS_CODE"),
                            partsData.optString("PC_PARTS_MAKER"),
                            partsData.optString("PC_PARTS_AVAIL"),
                            partsData.optString("PC_PARTS_DESC") );
     
      if( http_code == 200 ) {
        /*
         * The put method allows you to add data to a JSONObject.
View Full Code Here

       */
      int http_code = dao.insertIntoPC_PARTS(partsData.optString("PC_PARTS_TITLE"),
                            partsData.optString("PC_PARTS_CODE"),
                            partsData.optString("PC_PARTS_MAKER"),
                            partsData.optString("PC_PARTS_AVAIL"),
                            partsData.optString("PC_PARTS_DESC") );
     
      if( http_code == 200 ) {
        /*
         * The put method allows you to add data to a JSONObject.
         * The first parameter is the KEY (no spaces)
View Full Code Here

      //call method to parse header into json object
      json = ParseHttpHeader.parseHSR(hsr);
      System.out.println("json header: " + json);
     
      //once its in a json object, we can search for data we want to use
      String browser = json.optString("User-Agent", "NOT-FOUND");
     
      //return data to the user
      rb = Response.ok( browser ).build();
    }
    catch (Exception e) {
View Full Code Here

        assertEquals(1, responseJson.length());

        JSONObject firstJsonObj = responseJson.getJSONObject(0);
        assertEquals("Differs from expected, whole object: " + firstJsonObj
                , "scalarAttrValue_XY"
                , firstJsonObj.optString("scalarAttribute"));
    }

}
View Full Code Here

            JSONObject obj = new JSONObject(str);
            obj = obj.getJSONObject("command");
            CachedCommandModel cm = new CachedCommandModel(obj.getString("@name"), etag);
            cm.dashOk = obj.optBoolean("@unknown-options-are-operands", false);
            cm.managedJob = obj.optBoolean("@managed-job", false);
            cm.setUsage(obj.optString("usage", null));
            Object optns = obj.opt("option");
            if (!JSONObject.NULL.equals(optns)) {
                JSONArray jsonOptions;
                if (optns instanceof JSONArray) {
                    jsonOptions = (JSONArray) optns;
View Full Code Here

                    String type = jsOpt.getString("@type");
                    ParamModelData opt = new ParamModelData(
                            jsOpt.getString("@name"),
                            typeOf(type),
                            jsOpt.optBoolean("@optional", false),
                            jsOpt.optString("@default"),
                            jsOpt.optString("@short"),
                            jsOpt.optBoolean("@obsolete", false),
                            jsOpt.optString("@alias"));
                    opt.param._acceptableValues = jsOpt.optString("@acceptable-values");
                    if ("PASSWORD".equals(type)) {
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.