@Test public void isObjectEmpty() { ObjectNode json = new ObjectNode(factory); assertTrue(expressionEvaluatorLocal.isObjectEmpty(json)); ObjectNode nestedNode = new ObjectNode(factory); json.set("emptyField", nestedNode); assertTrue(expressionEvaluatorLocal.isObjectEmpty(json)); nestedNode.set("notEmptyField", new TextNode("text")); assertFalse(expressionEvaluatorLocal.isObjectEmpty(json)); }
protected boolean isObjectEmpty(ObjectNode json) { Iterator<Map.Entry<String, JsonNode>> fields = json.fields(); while (fields.hasNext()) { JsonNode element = fields.next().getValue(); if (!isNodeEmpty(element)) { return false; } } return true; }
AbstractExpressionEvaluator implements ExpressionEvaluator { protected boolean isObjectEmpty(ObjectNode json) { Iterator<Map.Entry<String, JsonNode>> fields = json.fields(); while (fields.hasNext()) { JsonNode element = fields.next().getValue(); if (!isNodeEmpty(element)) { return false; } } return true; } }
AbstractExpressionEvaluator implements ExpressionEvaluator { protected boolean isObjectEmpty(ObjectNode json) { Iterator<Map.Entry<String, JsonNode>> fields = json.fields(); while (fields.hasNext()) { JsonNode element = fields.next().getValue(); if (!isNodeEmpty(element)) { return false; } } return true; }  }
AbstractExpressionEvaluator implements ExpressionEvaluator { protected boolean isObjectEmpty(ObjectNode json) { Iterator<Map.Entry<String, JsonNode>> fields = json.fields(); while (fields.hasNext()) { JsonNode element = fields.next().getValue(); if (!isNodeEmpty(element)) { return false; } } return true; }  @Override Object evaluateLiteralExpression(String rawExpression, String className, List<String> genericClasses); @Override boolean evaluateUnaryExpression(String rawExpression, Object resultValue, Class<?> resultClass); }
AbstractExpressionEvaluator implements ExpressionEvaluator { protected boolean isObjectEmpty(ObjectNode json) { Iterator<Map.Entry<String, JsonNode>> fields = json.fields(); while (fields.hasNext()) { JsonNode element = fields.next().getValue(); if (!isNodeEmpty(element)) { return false; } } return true; }  @Override Object evaluateLiteralExpression(String rawExpression, String className, List<String> genericClasses); @Override boolean evaluateUnaryExpression(String rawExpression, Object resultValue, Class<?> resultClass);  }