5e280997dc5247e6073c7affb65aa180112a1079
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / AugmentationSchemaNode.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.model.api;
9
10 import java.util.Optional;
11 import org.opendaylight.yangtools.yang.model.api.DocumentedNode.WithStatus;
12
13 /**
14  * AugmentationSchema represents augment definition. The "augment" statement allows a module or submodule to add
15  * to the schema tree defined in an external module, or the current module and its submodules, and to add to the nodes
16  * from a grouping in a "uses" statement.
17  */
18 public interface AugmentationSchemaNode extends DataNodeContainer, NotificationNodeContainer, ActionNodeContainer,
19         WithStatus {
20     /**
21      * Returns when statement.
22      *
23      * <p>
24      * If when condition is present node defined by the parent data definition
25      * statement is only valid when the returned XPath
26      * expression conceptually evaluates to "true"
27      * for a particular instance, then the node defined by the parent data
28      * definition statement is valid; otherwise, it is not.
29      *
30      * @return XPath condition
31      */
32     RevisionAwareXPath getWhenCondition();
33
34     /**
35      * Returns augmentation schema path.
36      *
37      * @return SchemaPath that identifies a node in the schema tree. This node
38      *         is called the augment's target node. The target node MUST be
39      *         either a container, list, choice, case, input, output, or
40      *         notification node. It is augmented with the nodes defined as
41      *         child nodes of this AugmentationSchema.
42      */
43     SchemaPath getTargetPath();
44
45     /**
46      * Returns Augmentation Definition from which this augmentation is derived
47      * if augmentation was added transitively via augmented uses.
48      *
49      * @return Augmentation Definition from which this augmentation is derived
50      *         if augmentation was added transitively via augmented uses.
51      */
52     Optional<AugmentationSchemaNode> getOriginalDefinition();
53 }