/** * {@inheritDoc} This implementation assumes that a node is defined if it * has a value or has children or has attributes. */ @Override public boolean isDefined(final ImmutableNode node) { return AbstractImmutableNodeHandler.checkIfNodeDefined(node); }
/** * {@inheritDoc} This implementation returns an immutable list with all * child nodes that have the specified name. */ @Override public List<ImmutableNode> getChildren(final ImmutableNode node, final String name) { return getMatchingChildren(node, NodeNameMatchers.EQUALS, name); }
@Override public int getChildrenCount(final ImmutableNode node, final String name) { if (name == null) { return node.getChildren().size(); } return getMatchingChildrenCount(node, NodeNameMatchers.EQUALS, name); }
@Override public <C> int getMatchingChildrenCount(final ImmutableNode node, final NodeMatcher<C> matcher, final C criterion) { return getMatchingChildren(node, matcher, criterion).size(); }