return delegateSchemaNode().getReference();
}
+ @Deprecated
@Override
public boolean isAugmenting() {
return delegateSchemaNode().isAugmenting();
}
+ @Deprecated
@Override
public boolean isAddedByUses() {
return delegateSchemaNode().isAddedByUses();
}
}
+ @Deprecated
@Override
public boolean isAddedByUses() {
return false;
}
@Override
+ @Deprecated
public boolean isAddedByUses() {
//FIXME: reference to https://bugs.opendaylight.org/show_bug.cgi?id=6897
return false;
return ret;
}
+ @Deprecated
@Override
public boolean isAugmenting() {
return false;
}
+ @Deprecated
@Override
public boolean isAddedByUses() {
return false;
--- /dev/null
+/*
+ * Copyright (c) 2018 Pantheon Technologies, s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.model.api;
+
+/**
+ * Trait interface for {@link SchemaNode}s, which have the {@link #isAddedByUses()} method.
+ *
+ * @deprecated This interface relates to declared model rather than to effective mode and as such should not
+ * exist. It is provided to provide common method definition and eash migration of users.
+ */
+@Deprecated
+public interface AddedByUsesAware {
+ /**
+ * Returns <code>true</code> if this node was added by uses statement,
+ * otherwise returns <code>false</code>.
+ *
+ * @return <code>true</code> if this node was added by uses statement,
+ * otherwise returns <code>false</code>
+ */
+ boolean isAddedByUses();
+}
*/
package org.opendaylight.yangtools.yang.model.api;
-import com.google.common.annotations.Beta;
+import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
/**
* Represents a node that can be added by uses or by augmentation.
+ *
+ * @deprecated Aside from the deprecated {@link AddedByUsesAware} contract, this interface adds only a trait related
+ * to now how we arrived at this effective node. Users who need to know this information should really be
+ * looking at the {@link DeclaredStatement} world, which holds the original node definition.
*/
-@Beta
-public interface CopyableNode {
+@Deprecated
+public interface CopyableNode extends AddedByUsesAware {
/**
* Returns <code>true</code> if this node was added by augmentation,
* otherwise returns <code>false</code>.
* otherwise returns <code>false</code>
*/
boolean isAugmenting();
-
- /**
- * Returns <code>true</code> if this node was added by uses statement,
- * otherwise returns <code>false</code>.
- *
- * @return <code>true</code> if this node was added by uses statement,
- * otherwise returns <code>false</code>
- */
- boolean isAddedByUses();
}
* <p>
* It is used to define a reusable block of nodes, which may be used locally in
* the module, in modules that include it, and by other modules that import from it.
+ *
+ * <p>
+ * Note: this interface extends {@link AddedByUsesAware}, but this contradicts the javadoc of {@link #isAddedByUses()},
+ * as groupings can never be encountered in 'data schema node' context. It is their children, which are data
+ * schema node, but those really are instantiated and typically differ in {@link #getQName()}'s namespace.
*/
public interface GroupingDefinition extends DataNodeContainer, SchemaNode, NotificationNodeContainer,
- ActionNodeContainer {
- /**
- * Returns <code>true</code> if the data node was added by uses statement,
- * otherwise returns <code>false</code>.
- *
- * @return <code>true</code> if the data node was added by uses statement,
- * otherwise returns <code>false</code>
- */
- boolean isAddedByUses();
+ ActionNodeContainer, AddedByUsesAware {
+
}
* environment is safe.
*/
@Immutable
+// FIXME: 3.0.0: ContainerSchemaNode is far too broad. A combination of DataNodeContainer, NotificationNodeContainer
+// and possibly DataSchemaNode would reflect SchemaContext traits better.
public interface SchemaContext extends ContainerSchemaNode {
/**
* QName of NETCONF top-level data node.
/**
* Contains the methods for getting the details about the unknown node.
*/
-public interface UnknownSchemaNode extends SchemaNode {
+public interface UnknownSchemaNode extends SchemaNode, AddedByUsesAware {
/**
* Returns QName instance with the name of the unknown node.
*
*/
String getNodeParameter();
- /**
- * Describes whether the node was added through <code>uses</code> YANG
- * keyword.
- *
- * @return boolean value which is <code>true</code> if the node is added by
- * <code>uses</code> YANG keyword
- */
- boolean isAddedByUses();
-
/**
* Describes whether the node was added through <code>augment</code> YANG
* statement.
*
* @return boolean value which is <code>true</code> if the node is added by
* <code>augment</code> YANG statement
+ *
+ * @deprecated This method exposes mechanism of how this node was instantiated. This runs contrary to the idea
+ * that a SchemaNode is part of the effective model of the world. Examining a node's DeclaredStatement
+ * world should be sufficient to ascertain its origin.
*/
+ @Deprecated
boolean isAddedByAugmentation();
/**
/**
* Contains the methods for getting data and checking properties of the YANG <code>uses</code> substatement.
*/
-public interface UsesNode extends WhenConditionAware, WithStatus {
+public interface UsesNode extends WhenConditionAware, WithStatus, CopyableNode {
/**
* Returns the schema path to used grouping.
*/
@Nonnull Set<AugmentationSchemaNode> getAugmentations();
- /**
- * Returns <code>true</code> if the data node was added by augmentation,
- * otherwise returns <code>false</code>.
- *
- * @return <code>true</code> if the data node was added by augmentation,
- * otherwise returns <code>false</code>
- */
- boolean isAugmenting();
-
- /**
- * Returns <code>true</code> if the data node was added by uses statement,
- * otherwise returns <code>false</code>.
- *
- * @return <code>true</code> if the data node was added by uses statement,
- * otherwise returns <code>false</code>
- */
- boolean isAddedByUses();
-
/**
* Some of the properties of each node in the grouping can be refined with
* the "refine" statement.
return getNameToModules().get(name);
}
+ @Deprecated
@Override
public boolean isAugmenting() {
return false;
}
+ @Deprecated
@Override
public boolean isAddedByUses() {
return false;
}
}
+ @Deprecated
@Override
public final boolean isAugmenting() {
return augmenting;
}
+ @Deprecated
@Override
public final boolean isAddedByUses() {
return addedByUses;
return path;
}
+ @Deprecated
@Override
public boolean isAugmenting() {
return augmenting;
}
+ @Deprecated
@Override
public boolean isAddedByUses() {
return addedByUses;
unknownNodes = builder.build();
}
+ @Deprecated
@Override
public boolean isAddedByAugmentation() {
return addedByAugmentation;
return nodeParameter;
}
+ @Deprecated
@Override
public boolean isAddedByUses() {
return addedByUses;
return groupings;
}
+ @Deprecated
@Override
public boolean isAugmenting() {
return augmenting;
}
+ @Deprecated
@Override
public boolean isAddedByUses() {
return addedByUses;
this.augmenting = caseShorthandNode.isAugmenting();
}
+ @Deprecated
@Override
public boolean isAugmenting() {
return augmenting;
}
+ @Deprecated
@Override
public boolean isAddedByUses() {
return caseShorthandNode.isAddedByUses();
return unknownNodes;
}
+ @Deprecated
@Override
public boolean isAugmenting() {
return augmenting;
}
+ @Deprecated
@Override
public boolean isAddedByUses() {
return addedByUses;
return augmentations;
}
+ @Deprecated
@Override
public boolean isAugmenting() {
return false;
}
+ @Deprecated
@Override
public boolean isAddedByUses() {
return addedByUses;