Package org.codehaus.jackson

Examples of org.codehaus.jackson.JsonNode.path()


    SortedMap<Integer, String> classKeys = new TreeMap<Integer, String>();
    while (iterator.hasNext()){
      JsonNode currentNode = iterator.next();
      Boolean outputFormatMatch = matchNode(currentNode, "outputFormats", layer.getRequestedFormat().toLowerCase());
      if (outputFormatMatch){
        String classKey = currentNode.path("classKey").getTextValue();
        Integer preference = currentNode.path("preference").getIntValue();
        logger.debug("Matched classKey: " + classKey);
        if (hasRequirements(classKey, layer)){
          logger.debug("requirements met: " + classKey);
          classKeys.put(preference, classKey);
View Full Code Here


    while (iterator.hasNext()){
      JsonNode currentNode = iterator.next();
      Boolean outputFormatMatch = matchNode(currentNode, "outputFormats", layer.getRequestedFormat().toLowerCase());
      if (outputFormatMatch){
        String classKey = currentNode.path("classKey").getTextValue();
        Integer preference = currentNode.path("preference").getIntValue();
        logger.debug("Matched classKey: " + classKey);
        if (hasRequirements(classKey, layer)){
          logger.debug("requirements met: " + classKey);
          classKeys.put(preference, classKey);
        } else {
View Full Code Here

   */
  private SolrInputDocument parseObject(final String object)
  throws JsonProcessingException, IOException {
    final SolrInputDocument doc = new SolrInputDocument();
    final JsonNode node = mapper.readTree(object);
    doc.addField("id", node.path("ChargeDeviceId").asText());
    doc.addField("name", node.path("ChargeDeviceName").asText());
    doc.addField("DeviceController_facet", node.path("DeviceController").path("OrganisationName").asText());
    doc.addField("json", node);
    return doc;
  }
View Full Code Here

  private SolrInputDocument parseObject(final String object)
  throws JsonProcessingException, IOException {
    final SolrInputDocument doc = new SolrInputDocument();
    final JsonNode node = mapper.readTree(object);
    doc.addField("id", node.path("ChargeDeviceId").asText());
    doc.addField("name", node.path("ChargeDeviceName").asText());
    doc.addField("DeviceController_facet", node.path("DeviceController").path("OrganisationName").asText());
    doc.addField("json", node);
    return doc;
  }
View Full Code Here

  throws JsonProcessingException, IOException {
    final SolrInputDocument doc = new SolrInputDocument();
    final JsonNode node = mapper.readTree(object);
    doc.addField("id", node.path("ChargeDeviceId").asText());
    doc.addField("name", node.path("ChargeDeviceName").asText());
    doc.addField("DeviceController_facet", node.path("DeviceController").path("OrganisationName").asText());
    doc.addField("json", node);
    return doc;
  }

  public void close() {
View Full Code Here

        JsonNode jsonNode = this.jsonNode;
        final List<String> keys = PathNode.split(path);
        for (final String key : keys) {
            final PathNode pathNode = PathNode.parse(key);
            if (!pathNode.getKey().isEmpty()) {
                jsonNode = jsonNode.path(pathNode.getKey());
            } else {
                // pathNode is criteria only; don't change jsonNode
            }
            if (jsonNode.isNull()) {
                return jsonNode;
View Full Code Here

        for (final String key : keys) {
            final PathNode pathNode = PathNode.parse(key);
            if (!pathNode.getKey().isEmpty()) {
                // grab format (if present) before moving down the path
                format = getFormatValueIfAnyFrom(jsonNode);
                jsonNode = jsonNode.path(pathNode.getKey());
            } else {
                // pathNode is criteria only; don't change jsonNode
            }
            if (jsonNode.isNull()) {
                return new NodeAndFormat(jsonNode, format);
View Full Code Here

 
  public String getSearchUrl() throws IOException {
    this.readConfigFile();
    JsonNode jsonObject = this.configContents.path("search");
    return jsonObject.path("serviceAddress").getTextValue();
  }

  public String getSearchPort() throws IOException {
    this.readConfigFile();
    JsonNode jsonObject = this.configContents.path("search");
View Full Code Here

  }

  public String getSearchPort() throws IOException {
    this.readConfigFile();
    JsonNode jsonObject = this.configContents.path("search");
    int searchPort = jsonObject.path("servicePort").asInt();
    return Integer.toString(searchPort);
  }

  public String getSearchType() throws IOException {
    this.readConfigFile();
View Full Code Here

  }

  public String getSearchType() throws IOException {
    this.readConfigFile();
    JsonNode jsonObject = this.configContents.path("search");
    return jsonObject.path("serviceType").getTextValue();
  }

  public String getHome() throws IOException {
    this.readConfigFile();
    return this.configContents.path("homeInstitution").getTextValue();
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.