/** * Returns the node handler for the managed nodes. This is a convenience * method. * * @return the node handler */ protected NodeHandler<T> getNodeHandler() { return getParent().getNodeHandler(); }
/** * Returns the value of this node. * * @return the represented node's value */ @Override public Object getValue() { return getNodeHandler().getValue(node); }
/** * Returns a reference to the current node handler. The handler is obtained * from the parent pointer. * * @return the node handler */ private NodeHandler<T> getNodeHandler() { return getParentPointer().getNodeHandler(); } }
/** * Returns a flag whether this node is a leaf. This is the case if there are * no child nodes. * * @return a flag if this node is a leaf */ @Override public boolean isLeaf() { return getNodeHandler().getChildrenCount(node, null) < 1; }
/** * Returns this node's name. * * @return the name */ @Override public QName getName() { return new QName(null, getNodeHandler().nodeName(node)); }
/** * Helper method for checking whether an attribute is defined and adding it * to the list of attributes to iterate over. * * @param parent the parent node pointer * @param result the result list * @param name the name of the current attribute */ private void addAttributeData(final ConfigurationNodePointer<T> parent, final List<String> result, final String name) { if (parent.getNodeHandler().getAttributeValue( parent.getConfigurationNode(), name) != null) { result.add(name); } } }
/** * Compares two child node pointers. * * @param pointer1 one pointer * @param pointer2 another pointer * @return a flag, which pointer should be sorted first */ @Override public int compareChildNodePointers(final NodePointer pointer1, final NodePointer pointer2) { final Object node1 = pointer1.getBaseValue(); final Object node2 = pointer2.getBaseValue(); // sort based on the occurrence in the sub node list for (final T child : getNodeHandler().getChildren(node)) { if (child == node1) { return -1; } else if (child == node2) { return 1; } } return 0; // should not happen }
new LinkedHashSet<>(parent.getNodeHandler() .getAttributes(parent.getConfigurationNode())); final String prefix =