BUG-1472: deprecated CompositeNode and friends
[yangtools.git] / yang / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / CompositeNode.java
index 9800da60e807eb90713ade3762be6f027ae5d691..4b96bdc2031179ba5a68ae18f644b960508ed7a7 100644 (file)
@@ -1,52 +1,66 @@
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.yangtools.yang.data.api;\r
-\r
-import java.util.List;\r
-\r
-import org.opendaylight.yangtools.yang.common.QName;\r
-\r
-/**\r
- * Composite node represents a branch in the data tree, which could contain\r
- * nested composite nodes or leaf nodes. In the terms of the XML the simple node\r
- * is element which does not text data directly (CDATA or PCDATA), only other\r
- * nodes. The composite node is the manifestation of the following data schema\r
- * constructs in the YANG:\r
- *\r
- * <ul>\r
- * <li><b>container</b> - the composite node represents the YANG container and\r
- * could contain all children schema nodes of that container</li>\r
- * <li><b>item</b> in the <b>list</b> - the composite node represents one item\r
- * in the YANG list and could contain all children schema nodes of that list\r
- * item.</li>\r
- * <li><b>anyxml</b></li>\r
- * </ul>\r
- *\r
- *\r
- */\r
-public interface CompositeNode extends Node<List<Node<?>>>, NodeModification {\r
-\r
-    List<Node<?>> getChildren();\r
-\r
-    List<CompositeNode> getCompositesByName(QName children);\r
-\r
-    List<CompositeNode> getCompositesByName(String children);\r
-\r
-    List<SimpleNode<?>> getSimpleNodesByName(QName children);\r
-\r
-    List<SimpleNode<?>> getSimpleNodesByName(String children);\r
-\r
-    CompositeNode getFirstCompositeByName(QName container);\r
-\r
-    SimpleNode<?> getFirstSimpleByName(QName leaf);\r
-\r
-    /**\r
-     * @return cast self to mutable, if possible\r
-     */\r
-    MutableCompositeNode asMutable();\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. 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.data.api;
+
+import java.util.List;
+import java.util.Map;
+
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodeContainer;
+
+/**
+ * Composite node represents a branch in the data tree, which could contain
+ * nested composite nodes or leaf nodes. In the terms of the XML the simple node
+ * is element which does not text data directly (CDATA or PCDATA), only other
+ * nodes. The composite node is the manifestation of the following data schema
+ * constructs in the YANG:
+ *
+ * <ul>
+ * <li><b>container</b> - the composite node represents the YANG container and
+ * could contain all children schema nodes of that container</li>
+ * <li><b>item</b> in the <b>list</b> - the composite node represents one item
+ * in the YANG list and could contain all children schema nodes of that list
+ * item.</li>
+ * <li><b>anyxml</b></li>
+ * </ul>
+ *
+ * @deprecated Use {@link NormalizedNodeContainer} instead.
+ */
+@Deprecated
+public interface CompositeNode extends Node<List<Node<?>>>, NodeModification, Map<QName,List<Node<?>>> {
+
+    /**
+     * Returns a list of children as seens in resulting XML serialization
+     * defined by YANG specification.
+     *
+     * @return
+     *
+     * @deprecated Use {@link #getValue()} instead.
+     */
+    @Deprecated
+    List<Node<?>> getChildren();
+
+    List<CompositeNode> getCompositesByName(QName children);
+
+    List<CompositeNode> getCompositesByName(String children);
+
+    List<SimpleNode<?>> getSimpleNodesByName(QName children);
+
+    List<SimpleNode<?>> getSimpleNodesByName(String children);
+
+    CompositeNode getFirstCompositeByName(QName container);
+
+    SimpleNode<?> getFirstSimpleByName(QName leaf);
+
+    /**
+     * @return cast self to mutable, if possible
+     */
+    @Deprecated
+    MutableCompositeNode asMutable();
+
+}