2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.data.impl.schema.tree;
10 import java.util.Optional;
11 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
12 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
13 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
14 import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.TreeNode;
15 import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.Version;
18 * An implementation of apply operation which fails to do anything,
19 * consistently. An instance of this class is used by the data tree
20 * if it does not have a SchemaContext attached and hence cannot
21 * perform anything meaningful.
23 final class AlwaysFailOperation extends ModificationApplyOperation {
24 static final ModificationApplyOperation INSTANCE = new AlwaysFailOperation();
26 private AlwaysFailOperation() {
31 Optional<TreeNode> apply(final ModifiedNode modification,
32 final Optional<TreeNode> storeMeta, final Version version) {
33 throw new IllegalStateException("Schema Context is not available.");
37 void checkApplicable(final YangInstanceIdentifier path, final NodeModification modification,
38 final Optional<TreeNode> storeMetadata, final Version version) {
39 throw new IllegalStateException("Schema Context is not available.");
43 public Optional<ModificationApplyOperation> getChild(final PathArgument child) {
44 throw new IllegalStateException("Schema Context is not available.");
48 void verifyStructure(final NormalizedNode<?, ?> modification, final boolean verifyChildren) {
49 throw new IllegalStateException("Schema Context is not available.");
53 ChildTrackingPolicy getChildPolicy() {
54 throw new IllegalStateException("Schema Context is not available.");
58 void mergeIntoModifiedNode(final ModifiedNode node, final NormalizedNode<?, ?> value, final Version version) {
59 throw new IllegalStateException("Schema Context is not available.");
63 void recursivelyVerifyStructure(final NormalizedNode<?, ?> value) {
64 throw new IllegalStateException("Schema Context is not available.");