Package net.sf.json

Examples of net.sf.json.JSONObject.containsKey()


  private void extractLastfmRecentTracks(ApiData apiData,
      List<AbstractFacet> facets) throws Throwable {
    JSONObject tracksToExtract = apiData.jsonObject
        .getJSONObject("recenttracks");
    JSONArray tracks = new JSONArray();
    if (tracksToExtract.containsKey("track")&&tracksToExtract.get("track") instanceof JSONArray)
      tracks = tracksToExtract.getJSONArray("track");
    else if (tracksToExtract.containsKey("track")&&tracksToExtract.get("track") instanceof JSONObject) {
      JSONObject aTrack = tracksToExtract.getJSONObject("track");
      tracks.add(aTrack);
    } else
View Full Code Here


    JSONObject tracksToExtract = apiData.jsonObject
        .getJSONObject("recenttracks");
    JSONArray tracks = new JSONArray();
    if (tracksToExtract.containsKey("track")&&tracksToExtract.get("track") instanceof JSONArray)
      tracks = tracksToExtract.getJSONArray("track");
    else if (tracksToExtract.containsKey("track")&&tracksToExtract.get("track") instanceof JSONObject) {
      JSONObject aTrack = tracksToExtract.getJSONObject("track");
      tracks.add(aTrack);
    } else
      return;
   
View Full Code Here

      super.extractCommonFacetData(facet, apiData);

      JSONObject it = tracks.getJSONObject(i);

      if (!it.containsKey("artist"))
        continue;
      if (!it.getJSONObject("artist").containsKey("#text")) {
        JSONObject artist = it.getJSONObject("artist");
        facet.artist = artist.getString("name");
        facet.artist_mbid = artist.getString("mbid");
View Full Code Here

      String name = it.getString("name");

      facet.name = name;

      JSONObject dateObject = it.getJSONObject("date");
      if (!dateObject.containsKey("uts"))
        continue;

      long uts = dateObject.getLong("uts");
      long date = (Long.valueOf(uts)) * 1000;
      facet.time = date;
View Full Code Here

    private void retrieveTracks(final UpdateInfo updateInfo, final long fromTime, final String tracksType) throws Exception {
        int page =  0;
        do {
            JSONObject tracks = getTracks(updateInfo, fromTime, System.currentTimeMillis(), page, tracksType);
            JSONObject tracksObject = tracks.getJSONObject(tracksType);
            if (tracksObject.containsKey("track") && (tracksObject.get("track") instanceof JSONArray
                || tracksObject.get("track") instanceof JSONObject))
                apiDataService.cacheApiDataJSON(updateInfo, tracks, -1, -1);
            else
                return;
            final JSONObject metadata = tracksObject.getJSONObject("@attr");
View Full Code Here

            JSONObject jk = new JSONObject();
            jk = (JSONObject) JSONSerializer.toJSON(k);
            String hookedbrowser = on[i].getIp();
            // host informations
                   
         if (jk.containsKey("OsName")){osname = jk.getString("OsName"); System.out.println(osname); }
            if (jk.containsKey("DateStamp")){  datestamp = jk.getString("DateStamp");}
            if (jk.containsKey("Hardware")){  Hardware = jk.getString("Hardware");}
            if (jk.containsKey("CPU")){  CPU = jk.getString("CPU");}
            if (jk.containsKey("ScreenSize")){  screensize = jk.getString("ScreenSize");}
            if (jk.containsKey("TouchEnabled")){  touchenabled = jk.getString("TouchEnabled");}
View Full Code Here

            jk = (JSONObject) JSONSerializer.toJSON(k);
            String hookedbrowser = on[i].getIp();
            // host informations
                   
         if (jk.containsKey("OsName")){osname = jk.getString("OsName"); System.out.println(osname); }
            if (jk.containsKey("DateStamp")){  datestamp = jk.getString("DateStamp");}
            if (jk.containsKey("Hardware")){  Hardware = jk.getString("Hardware");}
            if (jk.containsKey("CPU")){  CPU = jk.getString("CPU");}
            if (jk.containsKey("ScreenSize")){  screensize = jk.getString("ScreenSize");}
            if (jk.containsKey("TouchEnabled")){  touchenabled = jk.getString("TouchEnabled");}
            // Hooked page
View Full Code Here

            String hookedbrowser = on[i].getIp();
            // host informations
                   
         if (jk.containsKey("OsName")){osname = jk.getString("OsName"); System.out.println(osname); }
            if (jk.containsKey("DateStamp")){  datestamp = jk.getString("DateStamp");}
            if (jk.containsKey("Hardware")){  Hardware = jk.getString("Hardware");}
            if (jk.containsKey("CPU")){  CPU = jk.getString("CPU");}
            if (jk.containsKey("ScreenSize")){  screensize = jk.getString("ScreenSize");}
            if (jk.containsKey("TouchEnabled")){  touchenabled = jk.getString("TouchEnabled");}
            // Hooked page
           if (jk.containsKey("PageTitle")){   pagetitle = jk.getString("PageTitle");}
View Full Code Here

            // host informations
                   
         if (jk.containsKey("OsName")){osname = jk.getString("OsName"); System.out.println(osname); }
            if (jk.containsKey("DateStamp")){  datestamp = jk.getString("DateStamp");}
            if (jk.containsKey("Hardware")){  Hardware = jk.getString("Hardware");}
            if (jk.containsKey("CPU")){  CPU = jk.getString("CPU");}
            if (jk.containsKey("ScreenSize")){  screensize = jk.getString("ScreenSize");}
            if (jk.containsKey("TouchEnabled")){  touchenabled = jk.getString("TouchEnabled");}
            // Hooked page
           if (jk.containsKey("PageTitle")){   pagetitle = jk.getString("PageTitle");}
            if (jk.containsKey("PageURI")){  pageuri = jk.getString("PageURI");}
View Full Code Here

                   
         if (jk.containsKey("OsName")){osname = jk.getString("OsName"); System.out.println(osname); }
            if (jk.containsKey("DateStamp")){  datestamp = jk.getString("DateStamp");}
            if (jk.containsKey("Hardware")){  Hardware = jk.getString("Hardware");}
            if (jk.containsKey("CPU")){  CPU = jk.getString("CPU");}
            if (jk.containsKey("ScreenSize")){  screensize = jk.getString("ScreenSize");}
            if (jk.containsKey("TouchEnabled")){  touchenabled = jk.getString("TouchEnabled");}
            // Hooked page
           if (jk.containsKey("PageTitle")){   pagetitle = jk.getString("PageTitle");}
            if (jk.containsKey("PageURI")){  pageuri = jk.getString("PageURI");}
            if (jk.containsKey("PageReferrer")){  pagereferrer = jk.getString("PageReferrer");}
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.