58beef0e872872b61e1a9512096f58fb116232ad
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / builder / api / AugmentationSchemaBuilder.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.parser.builder.api;
9
10 import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
11 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
12
13 /**
14  * Builder for {@link AugmentationSchema}, which represents 'augment' statement.
15  */
16 public interface AugmentationSchemaBuilder extends DataNodeContainerBuilder,DocumentedNodeBuilder {
17
18     /**
19      * Returns when condition
20      *
21      * If when condition is present node defined by the parent data definition
22      * statement is only valid when the returned XPath expression conceptually
23      * evaluates to "true" for a particular instance, then the node defined by
24      * the parent data definition statement is valid; otherwise, it is not.
25      *
26      * @return when condition as string
27      */
28     String getWhenCondition();
29
30     /**
31      * Adds string representation of when condition.
32      *
33      * If when condition is present node defined by the parent data definition
34      * statement is only valid when the returned XPath
35      * expression conceptually evaluates to "true"
36      * for a particular instance, then the node defined by the parent data
37      * definition statement is valid; otherwise, it is not.
38      *
39      * @param whenCondition string representation of when condition
40      */
41     void addWhenCondition(String whenCondition);
42
43     /**
44      * Returns target path representation as was present in schema source.
45      *
46      * @return path to target node as String
47      */
48     String getTargetPathAsString();
49
50     /**
51      * Get path to target node.
52      * <p>
53      * Note that individual parts of path contain only prefix relative to
54      * current context and name of node.
55      * </p>
56      *
57      * @return path to target node as SchemaPath
58      */
59     SchemaPath getTargetPath();
60
61     @Override
62     AugmentationSchema build();
63
64     /**
65      * Get information about augmentation process.
66      *
67      * @return true, if augmentation process was performed already, false
68      *         otherwise
69      */
70     boolean isResolved();
71
72     /**
73      * Set information about augmentation process.
74      *
75      * @param resolved information about augmentation process
76      */
77     void setResolved(boolean resolved);
78
79     /**
80      *
81      * Returns position of defining <code>augment</code> statement
82      * as was present in schema source.
83      *
84      * @return Position of definiing augment statement in source code.
85      */
86     int getOrder();
87
88     /**
89      *  Set true if target of augment is unsupported (e.g. node in body of extension).
90      *  In such case, augmentation is skipped and AugmentationSchema is not built.
91      *
92      *  @param unsupportedTarget information about target of augment statement
93      */
94     void setUnsupportedTarget(boolean unsupportedTarget);
95
96     /**
97      *  Return true if target of augment is unsupported (e.g. node in body of extension).
98      *  In such case, augmentation is skipped and AugmentationSchema is not built.
99      *
100      *  @return information about target of augment statement
101      */
102     boolean isUnsupportedTarget();
103 }