Package org.codehaus.jackson

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


    accessLevel = accessLevel.trim();
    JsonNode allInstitutionsObject = this.configContents.path("institutions");
    JsonNode institutionObject = allInstitutionsObject.path(institution);
    if (institutionObject.has("proxy")) {
      JsonNode proxyObject = institutionObject.path("proxy");
      ArrayNode accessNode = (ArrayNode) proxyObject.path("accessLevel");
      Iterator<JsonNode> accessIterator = accessNode.getElements();
      while (accessIterator.hasNext()){
        String currentValue = accessIterator.next().getTextValue();
        if (currentValue.equalsIgnoreCase(accessLevel)){
          return proxyObject.path(serviceKey).getTextValue();
View Full Code Here


      ArrayNode accessNode = (ArrayNode) proxyObject.path("accessLevel");
      Iterator<JsonNode> accessIterator = accessNode.getElements();
      while (accessIterator.hasNext()){
        String currentValue = accessIterator.next().getTextValue();
        if (currentValue.equalsIgnoreCase(accessLevel)){
          return proxyObject.path(serviceKey).getTextValue();
        }
      }
      return null;
   
    } else {
View Full Code Here

            if (token.startsWith("["))
            {
                if (o.isArray())
                {
                    int index = Integer.valueOf(token.substring(1, token.length() - 1));
                    o = o.path(index);
                }
                else
                {
                    throw new IllegalArgumentException("Current node is not an array, but expression is expecting one");
                }
View Full Code Here

                    throw new IllegalArgumentException("Current node is not an array, but expression is expecting one");
                }
            }
            else
            {
                o = o.path(token);
            }

            if (o.isMissingNode())
            {
                throw new IllegalArgumentException("Not a valid element: " + token);
View Full Code Here

        JsonNode propertiesSchema = root.get("properties");
        assertNotNull(propertiesSchema);
        JsonNode property1Schema = propertiesSchema.get("property1");
        assertNotNull(property1Schema);
        assertEquals("integer", property1Schema.get("type").asText());
        assertEquals(false, property1Schema.path("required").getBooleanValue());
        JsonNode property2Schema = propertiesSchema.get("property2");
        assertNotNull(property2Schema);
        assertEquals("string", property2Schema.get("type").asText());
        assertEquals(false, property2Schema.path("required").getBooleanValue());
        JsonNode property3Schema = propertiesSchema.get("property3");
View Full Code Here

        assertEquals("integer", property1Schema.get("type").asText());
        assertEquals(false, property1Schema.path("required").getBooleanValue());
        JsonNode property2Schema = propertiesSchema.get("property2");
        assertNotNull(property2Schema);
        assertEquals("string", property2Schema.get("type").asText());
        assertEquals(false, property2Schema.path("required").getBooleanValue());
        JsonNode property3Schema = propertiesSchema.get("property3");
        assertNotNull(property3Schema);
        assertEquals("array", property3Schema.get("type").asText());
        assertEquals(false, property3Schema.path("required").getBooleanValue());
        assertEquals("string", property3Schema.get("items").get("type").asText());
View Full Code Here

        assertEquals("string", property2Schema.get("type").asText());
        assertEquals(false, property2Schema.path("required").getBooleanValue());
        JsonNode property3Schema = propertiesSchema.get("property3");
        assertNotNull(property3Schema);
        assertEquals("array", property3Schema.get("type").asText());
        assertEquals(false, property3Schema.path("required").getBooleanValue());
        assertEquals("string", property3Schema.get("items").get("type").asText());
        JsonNode property4Schema = propertiesSchema.get("property4");
        assertNotNull(property4Schema);
        assertEquals("array", property4Schema.get("type").asText());
        assertEquals(false, property4Schema.path("required").getBooleanValue());
View Full Code Here

        assertEquals(false, property3Schema.path("required").getBooleanValue());
        assertEquals("string", property3Schema.get("items").get("type").asText());
        JsonNode property4Schema = propertiesSchema.get("property4");
        assertNotNull(property4Schema);
        assertEquals("array", property4Schema.get("type").asText());
        assertEquals(false, property4Schema.path("required").getBooleanValue());
        assertEquals("number", property4Schema.get("items").get("type").asText());
    }

    /**
     * Additional unit test for verifying that schema object itself
View Full Code Here

        if (props.isMissingNode()) {
            throw new JsonMappingException("no 'props' field found");
        }

        builder.allowSiblings(props.path(Constants.FL_SCHEMA_ALLOW_MULT).getBooleanValue());
        builder.lastWriteWins(props.path(Constants.FL_SCHEMA_LAST_WRITE_WINS).getBooleanValue());
        builder.nVal(props.path(Constants.FL_SCHEMA_NVAL).getIntValue());
        builder.backend(props.path(Constants.FL_SCHEMA_BACKEND).getTextValue());
        builder.smallVClock(props.path(Constants.FL_SCHEMA_SMALL_VCLOCK).getIntValue());
        builder.bigVClock(props.path(Constants.FL_SCHEMA_BIG_VCLOCK).getIntValue());
View Full Code Here

        if (props.isMissingNode()) {
            throw new JsonMappingException("no 'props' field found");
        }

        builder.allowSiblings(props.path(Constants.FL_SCHEMA_ALLOW_MULT).getBooleanValue());
        builder.lastWriteWins(props.path(Constants.FL_SCHEMA_LAST_WRITE_WINS).getBooleanValue());
        builder.nVal(props.path(Constants.FL_SCHEMA_NVAL).getIntValue());
        builder.backend(props.path(Constants.FL_SCHEMA_BACKEND).getTextValue());
        builder.smallVClock(props.path(Constants.FL_SCHEMA_SMALL_VCLOCK).getIntValue());
        builder.bigVClock(props.path(Constants.FL_SCHEMA_BIG_VCLOCK).getIntValue());
        builder.youngVClock(props.path(Constants.FL_SCHEMA_YOUNG_VCLOCK).getLongValue());
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.