- void verifyStructure(final ModifiedNode modification) throws IllegalArgumentException {
- if (modification.getOperation() == LogicalOperation.WRITE) {
- verifyWrittenStructure(modification.getWrittenValue());
+ final void checkApplicable(final ModificationPath path, final NodeModification modification,
+ final Optional<? extends TreeNode> current, final Version version) throws DataValidationFailedException {
+ switch (modification.getOperation()) {
+ case DELETE:
+ checkDeleteApplicable(modification, current);
+ break;
+ case TOUCH:
+ checkTouchApplicable(path, modification, current, version);
+ break;
+ case WRITE:
+ checkWriteApplicable(path, modification, current, version);
+ break;
+ case MERGE:
+ checkMergeApplicable(path, modification, current, version);
+ break;
+ case NONE:
+ break;
+ default:
+ throw new UnsupportedOperationException(
+ "Suplied modification type " + modification.getOperation() + " is not supported.");