- modification.setValidatedNode(this, current, applied);
- }
-
- private static int numOfChildrenFromValue(final NormalizedNode<?, ?> value) {
- if (value instanceof NormalizedNodeContainer) {
- return ((NormalizedNodeContainer<?, ?, ?>) value).getValue().size();
- } else if (value instanceof UnkeyedListNode) {
- return ((UnkeyedListNode) value).getSize();
- }
-
- throw new IllegalArgumentException(String.format(
- "Unexpected type '%s', expected types are NormalizedNodeContainer and UnkeyedListNode",
- value.getClass()));
- }
-
- @Override
- protected void checkTouchApplicable(final ModificationPath path, final NodeModification modification,
- final Optional<TreeNode> current, final Version version) throws DataValidationFailedException {
- delegate.checkTouchApplicable(path, modification, current, version);
- checkMinMaxElements(path, modification, current, version);
- }
-
- @Override
- protected void checkMergeApplicable(final ModificationPath path, final NodeModification modification,
- final Optional<TreeNode> current, final Version version) throws DataValidationFailedException {
- delegate.checkMergeApplicable(path, modification, current, version);
- checkMinMaxElements(path, modification, current, version);