Package org.myjson.json

Examples of org.myjson.json.ValueMap


  public BingResponse getResults(String json) {
    if(logger.isDebugEnabled()) {
      logger.debug("Response json: "+json);
    }
    BingResponse bingResponse = new BingResponse();
    ValueMap response = (ValueMap) Parser.parse(json);
    ValueMap map = (ValueMap) response.get("SearchResponse");

    ValueMap images = (ValueMap) map.get("Image");
    if(images != null) {
      Image imageItem = new Image();
      parseValueMap(bingResponse, images, imageItem)
    }
    ValueMap news = (ValueMap) map.get("News");
    if(news != null) {
      News newsItem = new News();
      parseValueMap(bingResponse, news, newsItem);
    }
    ValueMap video = (ValueMap) map.get("Video");
    if(video != null) {
      Video videoItem = new Video();
      parseValueMap(bingResponse, video, videoItem);
    }
    ValueMap web = (ValueMap) map.get("Web");
    if(web != null) {
      Web webItem = new Web();
      parseValueMap(bingResponse, web, webItem);
    }
   
View Full Code Here


   
    return bingResponse;
  }
 
  public void getError(String json) throws BingException {
    ValueMap response = (ValueMap) Parser.parse(json);
    ValueMap map = (ValueMap) response.get("SearchResponse");
    ArrayList<ValueMap> errors = (ArrayList<ValueMap>) map.get("Errors");
    if(errors != null) {
      for (ValueMap vm : errors) {
        String message = (String) vm.get("Message");
        String url = (String) vm.get("HelpUrl");
        String parameter = (String) vm.get("Parameter");
View Full Code Here

      Iterator<String> iter = row.keySet().iterator();
      while(iter.hasNext()) {
        String key = iter.next();
        Object value = row.get(key);
        if("thumbnail".equalsIgnoreCase(key)) {
          ValueMap vm = (ValueMap) value;
          Thumbnail thumbnail = new Thumbnail();
          fillThumbnail(thumbnail, vm);
          ((Image) responseItem).setThumbnail(thumbnail);
        }
        else if("StaticThumbnail".equalsIgnoreCase(key)) {
          ValueMap vm = (ValueMap) value;
          Thumbnail thumbnail = new Thumbnail();
          fillThumbnail(thumbnail, vm);
          ((Video) responseItem).setThumbnail(thumbnail);
        }
        else {
View Full Code Here

TOP

Related Classes of org.myjson.json.ValueMap

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.