Package org.codehaus.jackson.map

Examples of org.codehaus.jackson.map.ObjectMapper.readValue()


    parseArgs(args);

      File sourcesJson = new File(_sSourcesConfigFile);

      ObjectMapper mapper = new ObjectMapper();
      PhysicalSourceConfig physicalSourceConfig = mapper.readValue(sourcesJson, PhysicalSourceConfig.class);
      physicalSourceConfig.checkForNulls();

      Config config = new Config();

      ConfigLoader<StaticConfig> configLoader =
View Full Code Here


      // Load the source configuration JSON file
      //File sourcesJson = new File("integration-test/config/sources-member2.json");
      File sourcesJson = new File(_sSourcesConfigFile);

      ObjectMapper mapper = new ObjectMapper();
      PhysicalSourceConfig physicalSourceConfig = mapper.readValue(sourcesJson, PhysicalSourceConfig.class);
      physicalSourceConfig.checkForNulls();

      Config config = new Config();

      ConfigLoader<StaticConfig> configLoader =
View Full Code Here

        // parse JSON
        ObjectMapper mapper = new ObjectMapper();
        Backup backupData = null;
        try {
            backupData = mapper.readValue(data, Backup.class);
        } catch (Exception e) {
            logger.error("Could not parse input data: {}, {}", e.getClass(), e.getMessage());
            return false;
        }
View Full Code Here

    @SuppressWarnings("unchecked")
    public static Map<String, Object> mapFromJson(String location) throws Exception {
        ObjectMapper mapper = new ObjectMapper();
        InputStream jsonStream = JsonUtils.class.getResourceAsStream(location);
        assertNotNull("no resource found at " + location, jsonStream);
        return mapper.readValue(jsonStream, Map.class);
    }
}
View Full Code Here

    logger.debug("delimiter is: " + delimiter);
    String columnInfoJsonString = context.getConfiguration().get(
        HIHOConf.COLUMN_INFO);
    logger.debug("columnInfoJsonString is: " + columnInfoJsonString);
    ObjectMapper mapper = new ObjectMapper();
    tableInfo = mapper.readValue(columnInfoJsonString,
        new TypeReference<ArrayList<ColumnInfo>>() {
        });
  }

  public void map(K key, V val, Context context) throws IOException,
View Full Code Here

      Matcher matcher = pattern.matcher(response);
      if(matcher.find()) {
        String filter = matcher.group();
        ObjectMapper m = new ObjectMapper();
        try {
          StationVO stations[] = m.readValue(filter, StationVO[].class);
          return Arrays.asList(stations);
        } catch (Exception e) {
          StationServerResource.log.severe("could not parse object to stationvo: " + e.toString());
        }
      } else {
View Full Code Here

    ContainerModel containerModel = new ContainerModel(1, tasks);
    Map<Integer, ContainerModel> containerMap = new HashMap<Integer, ContainerModel>();
    containerMap.put(Integer.valueOf(1), containerModel);
    JobModel jobModel = new JobModel(config, containerMap);
    String str = mapper.writeValueAsString(jobModel);
    JobModel obj = mapper.readValue(str, JobModel.class);
    assertEquals(jobModel, obj);
  }
}
View Full Code Here

            ObjectNode map;
            if (jsonStr == null) {
                map = new ObjectNode(JsonNodeFactory.instance);
            } else {
                ObjectMapper mapper = new ObjectMapper();
                map = mapper.readValue(jsonStr, ObjectNode.class);
            }
            return Util.parseEnqueteAnswers(map);
        } catch (JsonParseException e) {
            throw new PartakeException(UserErrorCode.INVALID_ENQUETE_ANSWERS);
        } catch (JsonMappingException e) {
View Full Code Here

    String content = URLDecoder.decode(req.getParameter("content"),
      "UTF-8");

    ObjectMapper om = new ObjectMapper();

    JsonNode requestJson = om.readValue(content, JsonNode.class);

    RemoteDependencyDeclaration remoteDependency = RemoteDependencyDeclaration
      .fromJson(requestJson);
    String identifier = remoteDependency.getIdentifier();
View Full Code Here

 
        System.out.println("Decoded value=" + decoded);
 
        ObjectMapper om = new ObjectMapper();
 
        JsonNode node = om.readValue(decoded, JsonNode.class);
 
        Map<String, String> endpoints = om.convertValue(
          node.get("endpoint_entry"),
          new TypeReference<Map<String, String>>() {
          });
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.