Comments added to a source codes. 30/1030/1
authorJozef Gloncak <jgloncak@cisco.com>
Fri, 23 Aug 2013 12:36:41 +0000 (14:36 +0200)
committerJozef Gloncak <jgloncak@cisco.com>
Wed, 28 Aug 2013 09:46:45 +0000 (11:46 +0200)
The missing comments in the interfaces of project yang-model-api were
added.

Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
28 files changed:
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/ChoiceNode.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/ConstraintDefinition.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/ConstraintMetaDefinition.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/DataSchemaNode.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/ExtensionDefinition.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/LeafListSchemaNode.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/LeafSchemaNode.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/Module.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/MustDefinition.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/RevisionAwareXPath.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/SchemaContext.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/SchemaNode.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/SchemaPath.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/TypeDefinition.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/UnknownSchemaNode.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/UsesNode.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/type/BitsTypeDefinition.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/type/BooleanTypeDefinition.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/type/DecimalTypeDefinition.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/type/EnumTypeDefinition.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/type/IdentityTypeDefinition.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/type/IdentityrefTypeDefinition.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/type/InstanceIdentifierTypeDefinition.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/type/PatternConstraint.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/type/StringTypeDefinition.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/type/UnionTypeDefinition.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/type/UnsignedIntegerTypeDefinition.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/builder/impl/ChoiceBuilder.java

index ac658a57fca595cee6a9c6eda7fb7f624795a75d..cae5136a40f75867d97cd56829818b7649028177 100644 (file)
@@ -18,11 +18,18 @@ import org.opendaylight.yangtools.yang.common.QName;
 public interface ChoiceNode extends DataSchemaNode, AugmentationTarget {
 
     /**
-     * @return ChoiceCaseNode objects defined in this node
+     * Returns cases of choice.
+     * 
+     * @return set of ChoiceCaseNode objects defined in this node which
+     *         represents set of arguments of the YANG <code>case</code>
+     *         substatement of the <code>choice</code> statement
      */
     Set<ChoiceCaseNode> getCases();
 
     /**
+     * 
+     * Returns the concrete case according to specified Q name.
+     * 
      * @param name
      *            QName of seeked Choice Case Node
      * @return child case node of this Choice if child with given name is
@@ -31,13 +38,23 @@ public interface ChoiceNode extends DataSchemaNode, AugmentationTarget {
     ChoiceCaseNode getCaseNodeByName(QName name);
 
     /**
+     * Returns the concrete case according to specified name.
+     * 
      * @param name
      *            name of seeked child as String
-     * @return child case node (or local name of case node) of this Choice if child with given name is
-     *         present, <code>null</code> otherwise
+     * @return child case node (or local name of case node) of this Choice if
+     *         child with given name is present, <code>null</code> otherwise
      */
     ChoiceCaseNode getCaseNodeByName(String name);
 
+    /**
+     * 
+     * Returns name of case which is in the choice specified as default
+     * 
+     * @return string with the name of case which is specified in the argument
+     *         of the YANG <code>default</code> substatement of
+     *         <code>choice</code> statement.
+     */
     String getDefaultCase();
 
 }
index 349a2ba1e6b8f096b14c27806ae3ab66bc89eaba..c201545d8ca98849f3aa3cd6f51a350626a768c3 100644 (file)
@@ -1,23 +1,82 @@
-/*\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.model.api;\r
-\r
-import java.util.Set;\r
-\r
-public interface ConstraintDefinition {\r
-\r
-    RevisionAwareXPath getWhenCondition();\r
-\r
-    Set<MustDefinition> getMustConstraints();\r
-\r
-    boolean isMandatory();\r
-\r
-    Integer getMinElements();\r
-\r
-    Integer getMaxElements();\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.model.api;
+
+import java.util.Set;
+
+/**
+ * Contains method which returns various data constraints for some YANG element
+ * (e.g. min or max number of elements). Not all constraints are allowed for all
+ * YANG element therefore if the constraint doesn't have sense for some element
+ * then the method returns <code>null</code> value.
+ */
+public interface ConstraintDefinition {
+
+    /**
+     * Specifies the condition when the data node which contains
+     * <code>when</code> YANG substatement has to be present. If XPath
+     * expression is evaluated as true then the data node has to be present.
+     * 
+     * @return XPath expression.
+     */
+    RevisionAwareXPath getWhenCondition();
+
+    /**
+     * Specifies the rules which the node which contains <code>must</code> YANG
+     * substatement has to match.
+     * 
+     * 
+     * @return set of <code>MustDefinition</code> (XPath) instances which
+     *         represents the concrete data constraints
+     */
+    Set<MustDefinition> getMustConstraints();
+
+    /**
+     * Expreses if the presence of the data element for which this constraint is
+     * specified is|isn't required.
+     * 
+     * Contains the value of the <b>mandatory</b> YANG substatement.
+     * 
+     * It is used with YANG statements leaf, choice, anyxml, deviate.
+     * 
+     * @return boolean value:
+     *         <ul>
+     *         <li>true - if <code>mandatory</code> YANG keyword argument =
+     *         <i>true</i></li>
+     *         <li>false - if <code>mandatory</code> YANG keyword argument =
+     *         <i>false</i></li>
+     *         </ul>
+     */
+    boolean isMandatory();
+
+    /**
+     * Returns the minimum required number of data elements for node where this
+     * constraint is specified.
+     * 
+     * The returning value equals to value of the argument of the
+     * <b>min-elements</b> YANG substatement.
+     * 
+     * It is used with YANG statements leaf-list, list, deviate.
+     * 
+     * @return integer with minimal number of elements
+     */
+    Integer getMinElements();
+
+    /**
+     * Returns the maximum admissible number of data elements for node where
+     * this constraint is specified.
+     * 
+     * The returning value equals to value of the argument of the
+     * <b>max-elements</b> YANG substatement.
+     * 
+     * It is used with YANG statements leaf-list, list, deviate.
+     * 
+     * @return integer with maximum number of elements
+     */
+    Integer getMaxElements();
+}
index 060fe2b089110997fced678874091fda917e802a..ea2f7d3e68c601cdd1b2e37073b7737a4b13f3a0 100644 (file)
@@ -1,19 +1,47 @@
-/*\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.model.api;\r
-\r
-public interface ConstraintMetaDefinition {\r
-\r
-    String getDescription();\r
-\r
-    String getErrorAppTag();\r
-\r
-    String getErrorMessage();\r
-\r
-    String getReference();\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.model.api;
+
+/**
+ * Contains methods which retrive values for description, error message, error
+ * app tag and reference (to other document).
+ * 
+ */
+public interface ConstraintMetaDefinition {
+
+    /**
+     * Returns the value of the argument of YANG <code>description</code>
+     * keyword.
+     * 
+     * @return string with the description
+     */
+    String getDescription();
+
+    /**
+     * Returns the value of the argument of YANG <code>error-app-tag</code>
+     * keyword.
+     * 
+     * @return string with the application tag
+     */
+    String getErrorAppTag();
+
+    /**
+     * Returns the value of the argument of YANG <code>error-message</code>
+     * keyword.
+     * 
+     * @return string with the error message
+     */
+    String getErrorMessage();
+
+    /**
+     * Returns the value of the argument of YANG <code>reference</code> keyword.
+     * 
+     * @return string with reference to some other document
+     */
+    String getReference();
+}
index 7e9b1e8a879858fa971b7b6eb496ee47f03ca28c..892a725225c8f455059aa8ed969b8039fde909ee 100644 (file)
@@ -1,45 +1,51 @@
-/*\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.model.api;\r
-\r
-public interface DataSchemaNode extends SchemaNode {\r
-\r
-    /**\r
-     * Returns <code>true</code> if the data node was added by augmentation,\r
-     * otherwise returns <code>false</code>\r
-     *\r
-     * @return <code>true</code> if the data node was added by augmentation,\r
-     *         otherwise returns <code>false</code>\r
-     */\r
-    boolean isAugmenting();\r
-\r
-    /**\r
-     * Returns <code>true</code> if the data node was added by uses statement,\r
-     * otherwise returns <code>false</code>\r
-     *\r
-     * @return <code>true</code> if the data node was added by uses statement,\r
-     *         otherwise returns <code>false</code>\r
-     */\r
-    boolean isAddedByUses();\r
-\r
-    /**\r
-     * Returns <code>true</code> if the data represents configuration data,\r
-     * otherwise returns <code>false</code>\r
-     *\r
-     * @return <code>true</code> if the data represents configuration data,\r
-     *         otherwise returns <code>false</code>\r
-     */\r
-    boolean isConfiguration();\r
-\r
-    /**\r
-     * Returns the constraints associated with Data Schema Node\r
-     *\r
-     * @return the constraints associated with Data Schema Node\r
-     */\r
-    ConstraintDefinition getConstraints();\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.model.api;
+
+/**
+ * 
+ * Contains the method which are used for getting metadata from the schema nodes
+ * which contains data.
+ * 
+ */
+public interface DataSchemaNode extends SchemaNode {
+
+    /**
+     * 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();
+
+    /**
+     * Returns <code>true</code> if the data represents configuration data,
+     * otherwise returns <code>false</code>
+     * 
+     * @return <code>true</code> if the data represents configuration data,
+     *         otherwise returns <code>false</code>
+     */
+    boolean isConfiguration();
+
+    /**
+     * Returns the constraints associated with Data Schema Node
+     * 
+     * @return the constraints associated with Data Schema Node
+     */
+    ConstraintDefinition getConstraints();
+}
index 2317011b8a27eef9fc41edefc558a78ad0fb4d30..c65200c7e86d7bc40192ff92de74fbc31310ea1d 100644 (file)
@@ -1,44 +1,50 @@
-/*\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.model.api;\r
-\r
-public interface ExtensionDefinition extends SchemaNode {\r
-\r
-    /**\r
-     * Returns the <code>String</code> that is the name of argument to the\r
-     * Keyword. If no argument statement is present the method will return\r
-     * <code>null</code> <br>\r
-     * The argument statement is defined in <a\r
-     * href="https://tools.ietf.org/html/rfc6020#section-7.17.2">[RFC-6020] The\r
-     * argument Statement</a>\r
-     * \r
-     * @return the <code>String</code> that is the name of argument to the\r
-     *         Keyword. If no argument statement is present the method will\r
-     *         return <code>null</code>\r
-     */\r
-    public String getArgument();\r
-\r
-    /**\r
-     * This statement indicates if the argument is mapped to an XML element in\r
-     * YIN or to an XML attribute.<br>\r
-     * By contract if implementation of ExtensionDefinition does not specify the\r
-     * yin-element statement the return value is by default set to\r
-     * <code>false</code>\r
-     * \r
-     * <br>\r
-     * <br>\r
-     * For more specific definition please look into <a\r
-     * href="https://tools.ietf.org/html/rfc6020#section-7.17.2.2">[RFC-6020]\r
-     * The yin-element Statement</a>\r
-     * \r
-     * @return <code>true</code> if the argument is mapped to an XML element in\r
-     *         YIN or returns <code>false</code> if the argument is mapped to an\r
-     *         XML attribute.\r
-     */\r
-    public boolean isYinElement();\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.model.api;
+
+/**
+ * 
+ * Contains the methods for getting the data which are part of the YANG
+ * <code>extensoion</code> statement.
+ * 
+ */
+public interface ExtensionDefinition extends SchemaNode {
+
+    /**
+     * Returns the <code>String</code> that is the name of argument to the
+     * Keyword. If no argument statement is present the method will return
+     * <code>null</code> <br>
+     * The argument statement is defined in <a
+     * href="https://tools.ietf.org/html/rfc6020#section-7.17.2">[RFC-6020] The
+     * argument Statement</a>
+     * 
+     * @return the <code>String</code> that is the name of argument to the
+     *         Keyword. If no argument statement is present the method will
+     *         return <code>null</code>
+     */
+    public String getArgument();
+
+    /**
+     * This statement indicates if the argument is mapped to an XML element in
+     * YIN or to an XML attribute.<br>
+     * By contract if implementation of ExtensionDefinition does not specify the
+     * yin-element statement the return value is by default set to
+     * <code>false</code>
+     * 
+     * <br>
+     * <br>
+     * For more specific definition please look into <a
+     * href="https://tools.ietf.org/html/rfc6020#section-7.17.2.2">[RFC-6020]
+     * The yin-element Statement</a>
+     * 
+     * @return <code>true</code> if the argument is mapped to an XML element in
+     *         YIN or returns <code>false</code> if the argument is mapped to an
+     *         XML attribute.
+     */
+    public boolean isYinElement();
+}
index 58f81d920eb551a3687f0553039e237419ac860c..b6c2a6ec42102e7faf4dd75f9313ab06b134efc4 100644 (file)
@@ -1,26 +1,34 @@
-/*\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.model.api;\r
-\r
-/**\r
- * Interface describing YANG 'leaf-list' statement.\r
- */\r
-public interface LeafListSchemaNode extends DataSchemaNode {\r
-\r
-    TypeDefinition<? extends TypeDefinition<?>> getType();\r
-\r
-    /**\r
-     * YANG 'ordered-by' statement. It defines whether the order of entries\r
-     * within this leaf-list are determined by the user or the system. If not\r
-     * present, default is false.\r
-     *\r
-     * @return true if ordered-by argument is "user", false otherwise\r
-     */\r
-    boolean isUserOrdered();\r
-\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.model.api;
+
+/**
+ * Interface describing YANG 'leaf-list' statement.
+ */
+public interface LeafListSchemaNode extends DataSchemaNode {
+
+    /**
+     * Returns type of the instance which implements <code>DataSchemaNode</code>
+     * .
+     * 
+     * @return type definition of leaf-list schema node which represents the
+     *         value of the argument of the YANG <code>type</code> substatement
+     *         of the <code>leaf-list</code> statement
+     */
+    TypeDefinition<? extends TypeDefinition<?>> getType();
+
+    /**
+     * YANG 'ordered-by' statement. It defines whether the order of entries
+     * within this leaf-list are determined by the user or the system. If not
+     * present, default is false.
+     * 
+     * @return true if ordered-by argument is "user", false otherwise
+     */
+    boolean isUserOrdered();
+
+}
index db930d218280a9c308a146585340b82ac6a8ca1b..37b2ef0744c0f5170400c6d74da11e7d2fd439f9 100644 (file)
@@ -1,27 +1,52 @@
-/*\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.model.api;\r
-\r
-/**\r
- * Interface describing YANG 'leaf' statement.\r
- * <p>\r
- * The 'leaf' statement is used to define a leaf node in the schema tree.\r
- * </p>\r
- */\r
-public interface LeafSchemaNode extends DataSchemaNode {\r
-\r
-    /**\r
-     * @return type of this leaf\r
-     */\r
-    TypeDefinition<?> getType();\r
-\r
-    String getDefault();\r
-\r
-    String getUnits();\r
-\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.model.api;
+
+/**
+ * Interface describing YANG <code>leaf</code> statement. The interface contains
+ * the methods for getting the following data (substatements of
+ * <code>leaf</code> statement)
+ * <ul>
+ * <li><code>type</code></li>
+ * <li><code>default</code></li>
+ * <li><code>units</code></li>
+ * </ul>
+ * <p>
+ * The 'leaf' statement is used to define a leaf node in the schema tree.
+ * </p>
+ */
+public interface LeafSchemaNode extends DataSchemaNode {
+
+    /**
+     * Returns the YANG <code>type</code> of the instance of the type
+     * <code>LeafSchemaNode</code>.
+     * 
+     * @return type definition which represents the value of the YANG
+     *         <code>type</code> substatement for <code>leaf</code> statement
+     */
+    TypeDefinition<?> getType();
+
+    /**
+     * Returns the default value of YANG <code>leaf</code>.
+     * 
+     * @return string with the value of the argument of YANG
+     *         <code>default</code> substatement of the <code>leaf</code>
+     *         statement
+     */
+    String getDefault();
+
+    /**
+     * Returns the units in which are the values of the <code>leaf</code>
+     * presented.
+     * 
+     * @return string with the value of the argument of YANG <code>units</code>
+     *         substatement of the <code>leaf</code> statement
+     */
+    String getUnits();
+
+}
index b1b03a4dd85bf4b7741dd8a8ad156aa6321661c5..837f1718dba21006c3737fd6322f8d88e510abde 100644 (file)
-/*\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.model.api;\r
-\r
-import java.net.URI;\r
-import java.util.Date;\r
-import java.util.List;\r
-import java.util.Set;\r
-\r
-public interface Module extends DataNodeContainer {\r
-\r
-    URI getNamespace();\r
-\r
-    String getName();\r
-\r
-    Date getRevision();\r
-\r
-    String getPrefix();\r
-\r
-    String getYangVersion();\r
-\r
-    String getDescription();\r
-\r
-    String getReference();\r
-\r
-    String getOrganization();\r
-\r
-    String getContact();\r
-\r
-    Set<ModuleImport> getImports();\r
-\r
-    /**\r
-     * Returns feature statements defined in module.\r
-     *\r
-     * @return feature statements in lexicographical order\r
-     */\r
-    Set<FeatureDefinition> getFeatures();\r
-\r
-    /**\r
-     * Returns notification statements defined in module.\r
-     *\r
-     * @return notification statements in lexicographical order\r
-     */\r
-    Set<NotificationDefinition> getNotifications();\r
-\r
-    /**\r
-     * Returns augment statements defined in module.\r
-     *\r
-     * @return augment statements\r
-     */\r
-    Set<AugmentationSchema> getAugmentations();\r
-\r
-    /**\r
-     * Returns rpc statements defined in module.\r
-     *\r
-     * @return rpc statements in lexicographical order\r
-     */\r
-    Set<RpcDefinition> getRpcs();\r
-\r
-    /**\r
-     * Returns deviation statements defined in module.\r
-     *\r
-     * @return deviation statements\r
-     */\r
-    Set<Deviation> getDeviations();\r
-\r
-    /**\r
-     * Returns identity statements defined in module.\r
-     *\r
-     * @return identity statements in lexicographical order\r
-     */\r
-    Set<IdentitySchemaNode> getIdentities();\r
-\r
-    /**\r
-     * Returns extension statements defined in module.\r
-     *\r
-     * @return extension statements in lexicographical order\r
-     */\r
-    List<ExtensionDefinition> getExtensionSchemaNodes();\r
-\r
-    /**\r
-     * Returns unknown nodes defined in module.\r
-     *\r
-     * @return unknown nodes in lexicographical order\r
-     */\r
-    List<UnknownSchemaNode> getUnknownSchemaNodes();\r
-\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.model.api;
+
+import java.net.URI;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * This interface contains the methods for getting the data from the YANG
+ * module.<br />
+ * <br />
+ * <i>Example of YANG module</i> <code><br/>
+ * {@link #getName() <b><font color="#FF0000">module</font></b>} module_name{<br />
+    &nbsp;&nbsp;{@link #getYangVersion() <b><font color="#8b4513">yang-version</font></b>} "1";<br /><br />
+    
+    &nbsp;&nbsp;{@link #getNamespace() <b><font color="#00FF00">namespace</font></b>} "urn:module:namespace";<br />
+    &nbsp;&nbsp;{@link #getPrefix() <b><font color="#0000FF">prefix</font></b><a name="prefix"></a>} "prefix";<br /><br />
+    
+    &nbsp;&nbsp;{@link #getDescription() <b><font color="#b8860b">description</font></b>} "description test";<br />
+    &nbsp;&nbsp;{@link #getReference() <b><font color="#008b8b">reference</font></b>} "reference test";<br /><br />
+
+    &nbsp;&nbsp;{@link #getOrganization() <b><font color="#606060">organization</font></b>} "John Doe, john.doe@email.com";<br />
+    &nbsp;&nbsp;{@link #getContact() <b><font color="#FF9900">contact</font></b>} "http://www.opendaylight.org/";<br /><br />
+    
+    &nbsp;&nbsp;{@link #getFeatures() <b><font color="#8b0000">feature</font></b>} feature-test{<br /> 
+    &nbsp;&nbsp;&nbsp;&nbsp; description "description of some feature";<br />
+    &nbsp;&nbsp;}</br>
+    
+    &nbsp;&nbsp;{@link #getNotifications() <b><font color="#b22222">notification</font></b>} notification-test;<br />
+    &nbsp;&nbsp;{@link #getRpcs() <b><font color="#d2691e">rpc</font></b>} rpc-test;<br /> 
+    <!-- &nbsp;&nbsp;{@link #getDeviations() <b><font color="#b8860b">deviation</font></b>} deviation-test;<br /> -->         
+    &nbsp;&nbsp;{@link #getIdentities() <b><font color="#bdb76b">identity</font></b>} identity-test;<br /> 
+    &nbsp;&nbsp;{@link #getExtensionSchemaNodes() <b><font color="#808000">extension</font></b>} extension-test;<br />         
+
+
+    &nbsp;&nbsp;{@link #getRevision() <b><font color="#339900">revision</font></b>} 2011-08-27 {<br />
+    
+    &nbsp;&nbsp;{@link #getImports() <b><font color="#9400d3">import</font></b>} other_module {<br />
+    &nbsp;&nbsp;&nbsp;&nbsp;prefix "other_module_prefix"<br />
+    &nbsp;&nbsp;&nbsp;&nbsp;revision-date 2011-08-27<br />
+    &nbsp;&nbsp;}<br /><br />
+    
+    &nbsp;&nbsp;container cont {<br />
+    &nbsp;&nbsp;}<br />
+    
+    &nbsp;&nbsp;{@link #getAugmentations() <b><font color="#dc143c">augment</font></b>} "/cont" { ;<br />
+    &nbsp;&nbsp;}<br />
+    }
+    
+    </code>
+ */
+
+public interface Module extends DataNodeContainer {
+
+    /**
+     * Returns the namespace of the module which is specified as argument of
+     * YANG {@link Module <b><font color="#00FF00">namespace</font></b>}
+     * keyword.
+     * 
+     * @return URI format of the namespace of the module
+     */
+    URI getNamespace();
+
+    /**
+     * Returns the name of the module which is specified as argument of YANG
+     * {@link Module <b><font color="#FF0000">module</font></b>} keyword
+     * 
+     * @return string with the name of the module
+     */
+    String getName();
+
+    /**
+     * Returns the revision date for the module.
+     * 
+     * @return date of the module revision which is specified as argument of
+     *         YANG {@link Module <b><font color="#339900">revison</font></b>}
+     *         keyword
+     */
+    Date getRevision();
+
+    /**
+     * Returns the prefix of the module
+     * 
+     * @return string with the module prefix which is specified as argument of
+     *         YANG {@link Module <b><font color="#0000FF">prefix</font></b>}
+     *         keyword
+     */
+    String getPrefix();
+
+    /**
+     * Returns the YANG version.
+     * 
+     * Default value is 1.
+     * 
+     * @return string with the module YANG version which is specified as
+     *         argument of YANG {@link Module <b> <font
+     *         color="#8b4513">yang-version</font></b>} keyword
+     */
+    String getYangVersion();
+
+    /**
+     * Returns the module description.
+     * 
+     * @return string with the module description which is specified as argument
+     *         of YANG {@link Module <b><font
+     *         color="#b8860b">description</font></b>} keyword
+     */
+    String getDescription();
+
+    /**
+     * Returns the module reference.
+     * 
+     * @return string with the module reference which is specified as argument
+     *         of YANG {@link Module <b><font
+     *         color="#008b8b">reference</font></b>} keyword
+     */
+    String getReference();
+
+    /**
+     * Returns the module organization.
+     * 
+     * @return string with the name of the organization specified in the module
+     *         as the argument of YANG {@link Module <b><font
+     *         color="#606060">organization</font></b>} keyword
+     */
+    String getOrganization();
+
+    /**
+     * Returns the module contact.
+     * 
+     * The contact represents the person or persons to whom technical queries
+     * concerning this module should be sent, such as their name, postal
+     * address, telephone number, and electronic mail address.
+     * 
+     * @return string with the contact data specified in the module as the
+     *         argument of YANG {@link Module <b><font
+     *         color="#FF9900">contact</font></b>} keyword
+     */
+    String getContact();
+
+    /**
+     * Returns imports which represents YANG modules which are imported to this
+     * module via <b>import</b> statement.
+     * 
+     * @return set of module imports which are specified in the module as the
+     *         argument of YANG {@link Module <b><font
+     *         color="#9400d3">import</font></b>} keywords.
+     */
+    Set<ModuleImport> getImports();
+
+    /**
+     * Returns <code>FeatureDefinition</code> instances which contain data from
+     * <b>feature</b> statements defined in the module.
+     * 
+     * The feature is used to define a mechanism by which portions of the schema
+     * are marked as conditional.
+     * 
+     * @return feature statements in lexicographical order which are specified
+     *         in the module as the argument of YANG {@link Module <b><font
+     *         color="#8b0000">feature</font></b>} keywords.
+     */
+    Set<FeatureDefinition> getFeatures();
+
+    /**
+     * Returns <code>NotificationDefinition</code> instances which contain data
+     * from <b>notification</b> statements defined in the module.
+     * 
+     * @return notification statements in lexicographical order which are
+     *         specified in the module as the argument of YANG {@link Module
+     *         <b><font color="#b22222">notification</font></b>} keywords.
+     */
+    Set<NotificationDefinition> getNotifications();
+
+    /**
+     * Returns <code>AugmentationSchema</code> instances which contain data from
+     * <b>augment</b> statements defined in the module.
+     * 
+     * @return set of the augmentation schema instances which are specified in
+     *         the module as YANG {@link Module <b><font
+     *         color="#dc143c">augment</font></b>} keyword and are
+     *         lexicographicaly ordered
+     */
+    Set<AugmentationSchema> getAugmentations();
+
+    /**
+     * Returns <code>RpcDefinition</code> instances which contain data from
+     * <b>rpc</b> statements defined in the module.
+     * 
+     * @return set of the rpc definition instances which are specified in the
+     *         module as YANG {@link Module <b><font
+     *         color="#d2691e">rpc</font></b>} keywords and are lexicographicaly
+     *         ordered
+     */
+    Set<RpcDefinition> getRpcs();
+
+    /**
+     * Returns <code>Deviation</code> instances which contain data from
+     * <b>deviation</b> statements defined in the module.
+     * 
+     * @return set of the deviation instances
+     */
+    Set<Deviation> getDeviations();
+
+    /**
+     * Returns <code>IdentitySchemaNode</code> instances which contain data from
+     * <b>identity</b> statements defined in the module.
+     * 
+     * @return set of identity schema node instances which are specified in the
+     *         module as YANG {@link Module <b><font
+     *         color="#bdb76b">identity</font></b>} keywords and are
+     *         lexicographicaly ordered
+     */
+    Set<IdentitySchemaNode> getIdentities();
+
+    /**
+     * Returns <code>ExtensionDefinition</code> instances which contain data
+     * from <b>extension</b> statements defined in the module.
+     * 
+     * @return set of extension definition instances which are specified in the
+     *         module as YANG {@link Module <b><font
+     *         color="#808000">extension</font></b>} keyword and are
+     *         lexicographicaly ordered
+     */
+    List<ExtensionDefinition> getExtensionSchemaNodes();
+
+    /**
+     * Returns unknown nodes defined in module.
+     * 
+     * @return unknown nodes in lexicographical order
+     */
+    List<UnknownSchemaNode> getUnknownSchemaNodes();
+
+}
index c6b9b223868196775290357fd6b2c7bd93d40ff4..c725d3c546742ddd69a8c81a50a1374774b75ee9 100644 (file)
@@ -1,13 +1,28 @@
-/*\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.model.api;\r
-\r
-public interface MustDefinition extends ConstraintMetaDefinition {\r
-\r
-    RevisionAwareXPath getXpath();\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.model.api;
+
+/**
+ * 
+ * Contains methods for accessing constraint declaration for valid data in form
+ * of XPath expressions.<br />
+ * <br />
+ * <i>YANG example:<br />
+ * <code>must "ifType != 'ethernet' or (ifType = 'ethernet' and ifMTU = 1500)";</code>
+ * </i>
+ */
+public interface MustDefinition extends ConstraintMetaDefinition {
+
+    /**
+     * Returns XPath expression which contains constraint.
+     * 
+     * @return XPath expression which represents the value of the argument of
+     *         the <code>must</code> YANG substatement
+     */
+    RevisionAwareXPath getXpath();
+}
index 6a98cd0012b35f2b6c42ede16d62e55b8b070319..95d46ac8b20b577c0a1c17bc8522fdcbb7b52d79 100644 (file)
@@ -1,28 +1,36 @@
-/*\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.model.api;\r
-\r
-public interface RevisionAwareXPath {\r
-    \r
-    \r
-    /**\r
-     * Returns <code>true</code> if the XPapth starts in root of Yang model, otherwise returns <code>false</cdoe>.\r
-     * \r
-     * @return <code>true</code> if the XPapth starts in root of Yang model, otherwise returns <code>false</cdoe>\r
-     */\r
-    public boolean isAbsolute();\r
-    \r
-    /**\r
-     * Returns the XPath formatted string as is defined in model. \r
-     * <br>\r
-     * For example: /prefix:container/prefix:container::cond[when()=foo]/prefix:leaf\r
-     * \r
-     * @return the XPath formatted string as is defined in model.\r
-     */\r
-    public String toString();\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.model.api;
+
+/**
+ * 
+ * Contains methods for getting data (concrete XPath) and metadata (is XPath
+ * absolute) from XPath instance.
+ * 
+ * 
+ */
+public interface RevisionAwareXPath {
+
+    /**
+     * Returns <code>true</code> if the XPapth starts in root of Yang model,
+     * otherwise returns <code>false</cdoe>.
+     * 
+     * @return <code>true</code> if the XPapth starts in root of Yang model,
+     *         otherwise returns <code>false</cdoe>
+     */
+    public boolean isAbsolute();
+
+    /**
+     * Returns the XPath formatted string as is defined in model. <br>
+     * For example:
+     * /prefix:container/prefix:container::cond[when()=foo]/prefix:leaf
+     * 
+     * @return the XPath formatted string as is defined in model.
+     */
+    public String toString();
+}
index a40bf2bd0ab201e5476ac24043e06bc4bc84d7e8..1555bbb38ff5b12cf149cea73310d63bc87fcd85 100644 (file)
@@ -11,24 +11,82 @@ import java.net.URI;
 import java.util.Date;
 import java.util.Set;
 
-
-
 /**
- * 
+ * The interface contains the methods for manipulating all the top level context
+ * data (data from all red modules) like YANG notifications, extensions,
+ * operations...
  */
 public interface SchemaContext {
 
+    /**
+     * Returns data schema node instances which represents direct subnodes (like
+     * leaf, leaf-list, list, container) in all YANG modules in the context.
+     * 
+     * @return set of <code>DataSchemaNode</code> instances which represents
+     *         YANG data nodes at the module top level
+     */
     Set<DataSchemaNode> getDataDefinitions();
 
+    /**
+     * Returns modules which are part of the schema context.
+     * 
+     * @return set of the modules which belong to the schema context
+     */
     Set<Module> getModules();
 
+    /**
+     * 
+     * Returns notification definition instances which are defined as the direct
+     * subelements in all YANG modules in the context.
+     * 
+     * @return set of <code>NotificationDefinition</code> instances which
+     *         represents nodes defined via <code>notification</code> YANG
+     *         keyword
+     */
     Set<NotificationDefinition> getNotifications();
 
+    /**
+     * Returns rpc definition instances which are defined as the direct
+     * subelements in all YANG modules in the context.
+     * 
+     * @return set of <code>RpcDefinition</code> instances which represents
+     *         nodes defined via <code>rpc</code> YANG keyword
+     */
     Set<RpcDefinition> getOperations();
-    
+
+    /**
+     * Returns extencion definition instances which are defined as the direct
+     * subelements in all YANG modules in the context
+     * 
+     * @return set of <code>ExtensionDefinition</code> instances which
+     *         represents nodes defined via <code>extension</code> YANG keyword
+     */
     Set<ExtensionDefinition> getExtensions();
-    
+
+    /**
+     * Returns module instance (from the context) with concrete name and
+     * revision date.
+     * 
+     * @param name
+     *            string with the module name
+     * @param revision
+     *            date of the module revision
+     * @return module instance which has name and revision (if specified) the
+     *         same as are the values specified in parameters <code>name</code>
+     *         and <code>revision</code>. In other cases the <code>null</code>
+     *         value is returned.
+     * 
+     */
     Module findModuleByName(final String name, final Date revision);
-    
+
+    /**
+     * 
+     * Returns module instance (from the context) with concrete namespace.
+     * 
+     * @param namespace
+     *            URI instance with specified namespace
+     * @return module instance which has namespace equal to the
+     *         <code>namespace</code> or <code>null</code> in other cases
+     */
     Module findModuleByNamespace(final URI namespace);
 }
index 53c025c6e50d4de6a06beebf7b2b8b0c6a27e70b..84dc24a0b4298e4972c1d32d53cc26c091b029ca 100644 (file)
@@ -1,44 +1,71 @@
-/*\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.model.api;\r
-\r
-import java.util.List;\r
-\r
-import org.opendaylight.yangtools.yang.common.QName;\r
-\r
-/**\r
- * SchemaNode represents a node in schema tree.\r
- */\r
-public interface SchemaNode {\r
-\r
-    public QName getQName();\r
-\r
-    public SchemaPath getPath();\r
-\r
-    /**\r
-     * @return textual description of this node.\r
-     */\r
-    public String getDescription();\r
-\r
-    /**\r
-     * @return textual cross-reference to an external document that provides\r
-     *         additional information relevant to this node.\r
-     */\r
-    public String getReference();\r
-\r
-    /**\r
-     * @return actual status of this node.\r
-     */\r
-    public Status getStatus();\r
-\r
-    /**\r
-     * @return collection of all unknown nodes defined under this schema node.\r
-     */\r
-    public List<UnknownSchemaNode> getUnknownSchemaNodes();\r
-\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.model.api;
+
+import java.util.List;
+
+import org.opendaylight.yangtools.yang.common.QName;
+
+/**
+ * SchemaNode represents a node in schema tree.
+ */
+public interface SchemaNode {
+
+    /**
+     * Returns QName of the instance of the type <code>SchemaNode</code>.
+     * 
+     * @return QName with the name of the schema node
+     */
+    public QName getQName();
+
+    /**
+     * Returns the schema path of the instance of the type
+     * <code>SchemaNode</code> <code>SchemaNode</code>.
+     * 
+     * @return schema path of the schema node
+     */
+    public SchemaPath getPath();
+
+    /**
+     * Returns description of the instance of the type <code>SchemaNode</code>
+     * 
+     * @return string with textual description the node which represents the
+     *         argument of the YANG <code>description</code> substatement
+     */
+    public String getDescription();
+
+    /**
+     * Returns reference of the instance of the type <code>SchemaNode</code>
+     * 
+     * The reference refers to external document that provides additional
+     * information relevant for the instance of this type.
+     * 
+     * @return string with the reference to some external document which
+     *         represents the argument of the YANG <code>reference</code>
+     *         substatement
+     */
+    public String getReference();
+
+    /**
+     * Returns status of the instance of the type <code>SchemaNode</code>
+     * 
+     * @return status of this node which represents the argument of the YANG
+     *         <code>status</code> substatement
+     */
+    public Status getStatus();
+
+    /**
+     * 
+     * Returns unknown schema nodes which belongs to this instance of the type
+     * <code>SchemaNode</code>.
+     * 
+     * @return list of unknown schema nodes defined under this schema node.
+     */
+    public List<UnknownSchemaNode> getUnknownSchemaNodes();
+
+}
index 6bcb009afef7866d18bc4b7b10769a6fca914cc1..325b0c2c0a6d9df2397d5d40a5638323ee4f634f 100644 (file)
-/*\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.model.api;\r
-\r
-import java.util.ArrayList;\r
-import java.util.Collections;\r
-import java.util.List;\r
-\r
-import org.opendaylight.yangtools.yang.common.QName;\r
-\r
-public class SchemaPath {\r
-\r
-    final List<QName> path;\r
-    final boolean absolute;\r
-\r
-    public SchemaPath(final List<QName> path, boolean absolute) {\r
-        this.path = Collections.unmodifiableList(new ArrayList<QName>(path));\r
-        this.absolute = absolute;\r
-    }\r
-\r
-    public List<QName> getPath() {\r
-        return path;\r
-    }\r
-\r
-    public boolean isAbsolute() {\r
-        return absolute;\r
-    }\r
-\r
-    @Override\r
-    public int hashCode() {\r
-        final int prime = 31;\r
-        int result = 1;\r
-        result = prime * result + (absolute ? 1231 : 1237);\r
-        result = prime * result + ((path == null) ? 0 : path.hashCode());\r
-        return result;\r
-    }\r
-\r
-    @Override\r
-    public boolean equals(Object obj) {\r
-        if (this == obj) {\r
-            return true;\r
-        }\r
-        if (obj == null) {\r
-            return false;\r
-        }\r
-        if (getClass() != obj.getClass()) {\r
-            return false;\r
-        }\r
-        SchemaPath other = (SchemaPath) obj;\r
-        if (absolute != other.absolute) {\r
-            return false;\r
-        }\r
-        if (path == null) {\r
-            if (other.path != null) {\r
-                return false;\r
-            }\r
-        } else if (!path.equals(other.path)) {\r
-            return false;\r
-        }\r
-        return true;\r
-    }\r
-\r
-    @Override\r
-    public String toString() {\r
-        StringBuilder builder = new StringBuilder();\r
-        builder.append("SchemaPath [path=");\r
-        builder.append(path);\r
-        builder.append(", absolute=");\r
-        builder.append(absolute);\r
-        builder.append("]");\r
-        return builder.toString();\r
-    }\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.model.api;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opendaylight.yangtools.yang.common.QName;
+
+/**
+ * 
+ * Represents unique path to the every node inside the module.
+ * 
+ */
+public class SchemaPath {
+
+    /**
+     * List of QName instances which represents complete path to the node.
+     */
+    final List<QName> path;
+
+    /**
+     * Boolean value which represents type of schema path (relative or
+     * absolute).
+     */
+    final boolean absolute;
+
+    /**
+     * Constructs new instance of this class with the concrete path.
+     * 
+     * @param path
+     *            list of QName instances which specifies exact path to the
+     *            module node
+     * @param absolute
+     *            boolean value which specifies if the path is absolute or
+     *            relative
+     */
+    public SchemaPath(final List<QName> path, boolean absolute) {
+        this.path = Collections.unmodifiableList(new ArrayList<QName>(path));
+        this.absolute = absolute;
+    }
+
+    /**
+     * Returns the complete path to schema node.
+     * 
+     * @return list of <code>QName</code> instances which represents complete
+     *         path to schema node
+     */
+    public List<QName> getPath() {
+        return path;
+    }
+
+    /**
+     * Describes whether schema path is|isn't absolute.
+     * 
+     * @return boolean value which is <code>true</code> if schema path is
+     *         absolute.
+     */
+    public boolean isAbsolute() {
+        return absolute;
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + (absolute ? 1231 : 1237);
+        result = prime * result + ((path == null) ? 0 : path.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        SchemaPath other = (SchemaPath) obj;
+        if (absolute != other.absolute) {
+            return false;
+        }
+        if (path == null) {
+            if (other.path != null) {
+                return false;
+            }
+        } else if (!path.equals(other.path)) {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder builder = new StringBuilder();
+        builder.append("SchemaPath [path=");
+        builder.append(path);
+        builder.append(", absolute=");
+        builder.append(absolute);
+        builder.append("]");
+        return builder.toString();
+    }
+}
index 4ff709e1e4ba06a9f28e45d627b6bedbaecb7837..6e75e98c8ed0445916c286ef47351ba4c1e5759c 100644 (file)
@@ -1,18 +1,58 @@
-/*\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.model.api;\r
-\r
-\r
-public interface TypeDefinition<T extends TypeDefinition<?>> extends SchemaNode {\r
-\r
-    T getBaseType();\r
-\r
-    String getUnits();\r
-\r
-    Object getDefaultValue();\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.model.api;
+
+/**
+ * 
+ * YANG statement <code>typedef</code> contains also substatements
+ * <ul>
+ * <li><code>default</code> - default value which is compatible with
+ * <code>type</code>,</li>
+ * <li><code>type</code> - base type from which is <code>typedef</code> derived,
+ * </li>
+ * <li><code>units</code> - textual information about units associated with this
+ * type.</li>
+ * </ul>
+ * This interface contains the methods for getting the values of the arguments
+ * of substatements mentioned above.
+ * 
+ * @param <T>
+ *            type of the base type (YANG <code>type</code> substatement) which
+ *            is included in the instance of this type
+ */
+public interface TypeDefinition<T extends TypeDefinition<?>> extends SchemaNode {
+
+    /**
+     * Returns the base type which represents the value of the argument of the
+     * <code>type</code> substatement of the YANG <code>typedef</code>
+     * statement.
+     * 
+     * @return value of <code>&lt;T&gt;</code> type which represents the base
+     *         type of instance of the <code>TypeDefinition</code> type
+     */
+    T getBaseType();
+
+    /**
+     * Returns the unit which represents the value of the argument of the
+     * <code>units</code> substatement of the YANG <code>typedef</code>
+     * statement.
+     * 
+     * @return string with units in which is type measured
+     */
+    String getUnits();
+
+    /**
+     * Returns the default value which represents the value of the argument of
+     * the <code>default</code> substatement of the YANG <code>typedef</code>
+     * statement.
+     * 
+     * @return instance of <code>Object</code> type which contains default value
+     *         for <code>typedef</code>
+     */
+    Object getDefaultValue();
+}
index e7f5d224b1c7b4fd6534f228b6d77ad10cf3a99d..e9cb93c8bd3f6462c6e358a0e224f8ec7907b456 100644 (file)
@@ -9,17 +9,40 @@ package org.opendaylight.yangtools.yang.model.api;
 
 import org.opendaylight.yangtools.yang.common.QName;
 
+/**
+ * 
+ * Contains the methods for getting the details about the unknown node.
+ * 
+ */
 public interface UnknownSchemaNode extends SchemaNode {
 
+    /**
+     * Returns QName instance with the name of the unknown node.
+     * 
+     * @return QName with name the name of the unknown node.
+     */
     QName getNodeType();
 
+    /**
+     * Returns name of the unknown node.
+     * 
+     * @return string with the name of 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();
 
     /**
      * Get extension definition which identifies this node
-     *
+     * 
      * @return extension definition if exists, null otherwise
      */
     ExtensionDefinition getExtensionDefinition();
index b1ec2578f6688658edcf8f7959129812c5ddbe1d..ae9aabae2bc32a34091fb3564af3dc4bfd9c98d6 100644 (file)
@@ -1,51 +1,61 @@
-/*\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.model.api;\r
-\r
-import java.util.Map;\r
-import java.util.Set;\r
-\r
-public interface UsesNode {\r
-\r
-    /**\r
-     * @return path to 'grouping' on which this 'uses' statement points\r
-     */\r
-    SchemaPath getGroupingPath();\r
-\r
-    /**\r
-     * @return Set of augment statements defined under this uses node\r
-     */\r
-    Set<AugmentationSchema> getAugmentations();\r
-\r
-    /**\r
-     * Returns <code>true</code> if the data node was added by augmentation,\r
-     * otherwise returns <code>false</code>\r
-     *\r
-     * @return <code>true</code> if the data node was added by augmentation,\r
-     *         otherwise returns <code>false</code>\r
-     */\r
-    boolean isAugmenting();\r
-\r
-    /**\r
-     * Returns <code>true</code> if the data node was added by uses statement,\r
-     * otherwise returns <code>false</code>\r
-     *\r
-     * @return <code>true</code> if the data node was added by uses statement,\r
-     *         otherwise returns <code>false</code>\r
-     */\r
-    boolean isAddedByUses();\r
-\r
-    /**\r
-     * Some of the properties of each node in the grouping can be refined with\r
-     * the "refine" statement.\r
-     *\r
-     * @return Map, where key is schema path of refined node and value is\r
-     *         refined node\r
-     */\r
-    Map<SchemaPath, SchemaNode> getRefines();\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.model.api;
+
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Contains the methods for getting data and checking properties of the YANG
+ * <code>uses</code> substatement.
+ * 
+ */
+public interface UsesNode {
+
+    /**
+     * Returns the schema path to used grouping.
+     * 
+     * @return schema path to 'grouping' on which this 'uses' statement points
+     */
+    SchemaPath getGroupingPath();
+
+    /**
+     * 
+     * Returns agumentations which were specified in this uses node.
+     * 
+     * @return Set of augment statements defined under this uses node
+     */
+    Set<AugmentationSchema> 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 Map, where key is schema path of refined node and value is
+     *         refined node
+     */
+    Map<SchemaPath, SchemaNode> getRefines();
+}
index 115ab1355771c1b0a1e6e36d9bb713f6ea9abe47..2a0fb506b3dba22841c818552ea62195864aaa33 100644 (file)
@@ -12,19 +12,40 @@ import java.util.List;
 import org.opendaylight.yangtools.yang.model.api.SchemaNode;
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
 
+/**
+ * 
+ * Makes is possible to access to the individual bits values of this type.
+ * 
+ */
 public interface BitsTypeDefinition extends TypeDefinition<BitsTypeDefinition> {
 
+    /**
+     * Returns all bit values.
+     * 
+     * @return list of <code>Bit</code> type instastances with data about all
+     *         individual bits of <code>bits</code> YANG built-in type
+     */
     public List<Bit> getBits();
 
+    /**
+     * 
+     * Contains the methods for accessing the data about the individual bit of
+     * <code>bits</code> YANG type.
+     */
     interface Bit extends SchemaNode {
         /**
          * The position value MUST be in the range 0 to 4294967295, and it MUST
          * be unique within the bits type.
-         *
+         * 
          * @return The position value of bit in range from 0 to 4294967295.
          */
         public Long getPosition();
 
+        /**
+         * Returns the name of the concrete bit.
+         * 
+         * @return string with the name of the concrete bit
+         */
         public String getName();
     }
 }
index d64d9da7533bf0055c0cec960e221e2aae998f45..84cb4c5a061ad3d0db3177cc734d9c253d2f3109 100644 (file)
@@ -9,7 +9,12 @@ package org.opendaylight.yangtools.yang.model.api.type;
 
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
 
-public interface BooleanTypeDefinition extends
-        TypeDefinition<BooleanTypeDefinition> {
+/**
+ * 
+ * Marker interface which marks that type definition represents the built-in
+ * YANG <code>boolean</code> type.
+ * 
+ */
+public interface BooleanTypeDefinition extends TypeDefinition<BooleanTypeDefinition> {
 
 }
index 7e2692939ec088017f8cd8d4c633aec79c04e608..e3ace5d6e10506df73c8bf5c67039dbc433c09a3 100644 (file)
@@ -11,19 +11,31 @@ import java.util.List;
 
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
 
+/**
+ * Contains methods for getting data from the YANG <code>type</code>
+ * substatement for <code>decimal64</code> built-in type.
+ * 
+ */
 public interface DecimalTypeDefinition extends TypeDefinition<DecimalTypeDefinition> {
 
+    /**
+     * Returns range constraints for instance of this type.
+     * 
+     * @return list of range constraints which are specified as the argument of
+     *         the <code>range</code> which is substatement of the
+     *         <code>type</code> statement
+     */
     List<RangeConstraint> getRangeStatements();
 
     /**
      * Returns integer between 1 and 18 inclusively. <br>
      * <br>
-     *
+     * 
      * The "fraction-digits" statement controls the size of the minimum
      * difference between values of a decimal64 type, by restricting the value
      * space to numbers that are expressible as "i x 10^-n" where n is the
      * fraction-digits argument.
-     *
+     * 
      * @return number of fraction digits
      */
     Integer getFractionDigits();
index c52523f14554bbd09e8e23e14c9f1ab37be13f92..64a3fd2ac5321fb200d80196343dc1424146f255 100644 (file)
@@ -12,15 +12,33 @@ import java.util.List;
 import org.opendaylight.yangtools.yang.model.api.SchemaNode;
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
 
+/**
+ * 
+ * Makes is possible to access to the individual enumeration values of this
+ * type.
+ * 
+ */
 public interface EnumTypeDefinition extends TypeDefinition<EnumTypeDefinition> {
 
+    /**
+     * Returns all enumeration values.
+     * 
+     * @return list of <code>EnumPair</code> type instastances which contain the
+     *         data about all individual enumeration pairs of
+     *         <code>enumeration</code> YANG built-in type
+     */
     List<EnumPair> getValues();
 
+    /**
+     * 
+     * Contains the methods for accessing the data about the concrete
+     * enumeration item which represents <code>enum</code> YANG type.
+     */
     interface EnumPair extends SchemaNode {
 
         /**
          * The name to specify each assigned name of an enumeration type.
-         *
+         * 
          * @return name of each assigned name of an enumeration type.
          */
         public String getName();
@@ -30,7 +48,7 @@ public interface EnumTypeDefinition extends TypeDefinition<EnumTypeDefinition> {
          * integer value with the assigned name for the enum. This integer value
          * MUST be in the range -2147483648 to 2147483647, and it MUST be unique
          * within the enumeration type.
-         *
+         * 
          * @return integer value assigned to enumeration
          */
         public Integer getValue();
index 26551ad9957b79cd96f43ab322afa501c784ebd0..c5647b783519a1c1ea02118470fa9effc3080593 100644 (file)
@@ -10,8 +10,16 @@ package org.opendaylight.yangtools.yang.model.api.type;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
 
-public interface IdentityTypeDefinition extends
-        TypeDefinition<IdentityTypeDefinition> {
+/**
+ * 
+ * Contains the method for getting the details about YANG <code>identity</code>.
+ */
+public interface IdentityTypeDefinition extends TypeDefinition<IdentityTypeDefinition> {
 
+    /**
+     * Returns the name of the YANG identity
+     * 
+     * @return QName of the YANG identity
+     */
     public QName getIdentityName();
 }
index 27c9ac175e36b52b38110dbbfb224e24dd5a2e66..4631e1db01525ff28c6bf32d24d3714c35340620 100644 (file)
@@ -1,18 +1,29 @@
-/*\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.model.api.type;\r
-\r
-import org.opendaylight.yangtools.yang.common.QName;\r
-import org.opendaylight.yangtools.yang.model.api.TypeDefinition;\r
-\r
-public interface IdentityrefTypeDefinition extends\r
-        TypeDefinition<IdentityrefTypeDefinition> {\r
-\r
-    public QName getIdentity();\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.model.api.type;
+
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
+
+/**
+ * 
+ * Contains method for getting data from <code>identityref</code> built-in YANG
+ * type.
+ * 
+ */
+public interface IdentityrefTypeDefinition extends TypeDefinition<IdentityrefTypeDefinition> {
+
+    /**
+     * Returns QName of the identity to which the instance of this type refers.
+     * 
+     * @return QName of referenced identity which is specified with the
+     *         <code>identity</code> YANG statement
+     */
+    public QName getIdentity();
+
 }
index 8d0b64b5274cf6b88a220a99801c1b26167ad70f..3b5f5e0d3fc4e206f147c8c6c7122812a736a635 100644 (file)
@@ -10,10 +10,28 @@ package org.opendaylight.yangtools.yang.model.api.type;
 import org.opendaylight.yangtools.yang.model.api.RevisionAwareXPath;
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
 
-public interface InstanceIdentifierTypeDefinition extends
-        TypeDefinition<InstanceIdentifierTypeDefinition> {
+/**
+ * 
+ * Contains methods for getting data from the <code>instance-identifier</code>
+ * YANG built-in type.
+ */
+public interface InstanceIdentifierTypeDefinition extends TypeDefinition<InstanceIdentifierTypeDefinition> {
 
+    /**
+     * Returns XPath for instance of
+     * <code>InstanceIdentifierTypeDefinition</code>.
+     * 
+     * @return instance of type <code>RevisionAwareXPath</code>
+     */
     public RevisionAwareXPath getPathStatement();
 
+    /**
+     * Returns true|false which represents argument of
+     * <code>require-instance</code> statement. This statement is the
+     * substatement of the <code>type</code> statement.
+     * 
+     * @return boolean value which is true if the <code>require-instance</code>
+     *         statement is true and vice versa
+     */
     public boolean requireInstance();
 }
index d793b24ee0f0aae3800c9fd39cc63974dd85c93c..aab99fd794585fb3912954c4a8da06ac2351b5d4 100644 (file)
@@ -9,7 +9,18 @@ package org.opendaylight.yangtools.yang.model.api.type;
 
 import org.opendaylight.yangtools.yang.model.api.ConstraintMetaDefinition;
 
+/**
+ * Contains the method for getting the data from the YANG <code>pattern</code>
+ * which is substatement of <code>type</code> statement.
+ * 
+ */
 public interface PatternConstraint extends ConstraintMetaDefinition {
 
+    /**
+     * Returns a regular expression (pattern).
+     * 
+     * @return string with regular expression which is equal to the argument of
+     *         the YANG <code>pattern</code> substatement
+     */
     public String getRegularExpression();
 }
index c12499eb6be0c2f32193f34298461a1157320e9d..e1bf21ada41fd25c1571c811b397ed4b0a1462a7 100644 (file)
@@ -11,10 +11,28 @@ import java.util.List;
 
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
 
-public interface StringTypeDefinition extends
-        TypeDefinition<StringTypeDefinition> {
+/**
+ * 
+ * Contains method for getting data from the <code>string</code> YANG built-in
+ * type.
+ */
+public interface StringTypeDefinition extends TypeDefinition<StringTypeDefinition> {
 
+    /**
+     * Returns length constraint specified in the string.
+     * 
+     * @return list of length constraint which are specified in the
+     *         <code>lenght</code> substatement of the <code>type</code>
+     *         statement
+     */
     List<LengthConstraint> getLengthStatements();
 
+    /**
+     * Returns patterns specified in the string.
+     * 
+     * @return list of pattern constraints which are specified in the
+     *         <code>pattern</code> substatement of the <code>type</code>
+     *         statement
+     */
     List<PatternConstraint> getPatterns();
 }
index 98f5eac4a8255c21bcd8aa2e0889cab601aa79d7..04903c0b03154f612ee92fd269c9d268c7b1dbb1 100644 (file)
@@ -11,8 +11,18 @@ import java.util.List;
 
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
 
-public interface UnionTypeDefinition extends
-        TypeDefinition<UnionTypeDefinition> {
+/**
+ * Contains the method which access union item in the union type.
+ * 
+ */
+public interface UnionTypeDefinition extends TypeDefinition<UnionTypeDefinition> {
 
+    /**
+     * Returns type definitions which represent the values of the arguments for
+     * all YANG <code>type</code> substatement in the main <code>union</code>
+     * statement.
+     * 
+     * @return list of the type definition which contains the union items.
+     */
     public List<TypeDefinition<?>> getTypes();
 }
index d40fe0c1596e627d54a987fada97ad50424b9937..34315b1e83837878a8b4071a23b78de23bcb0f8d 100644 (file)
@@ -11,8 +11,21 @@ import java.util.List;
 
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
 
-public interface UnsignedIntegerTypeDefinition extends
-        TypeDefinition<UnsignedIntegerTypeDefinition> {
+/**
+ * 
+ * Contains the method for getting detail data about unsigned integer.
+ * 
+ * Specifically it is the method for getting the range value.
+ * 
+ */
+public interface UnsignedIntegerTypeDefinition extends TypeDefinition<UnsignedIntegerTypeDefinition> {
 
+    /**
+     * Returns range data of the instance of the type
+     * <code>UnsignedIntegerTypeDefinition</code>.
+     * 
+     * @return list of <code>RangeConstraint</code> which represents the YANG
+     *         <code>range</code> substatement arguments.
+     */
     List<RangeConstraint> getRangeStatements();
 }
index 7ec499534c39ced368a5006809292a90f37381c3..05095fe93680b6031f735ec5461e4c9dbf8628ad 100644 (file)
@@ -109,7 +109,7 @@ public final class ChoiceBuilder extends AbstractSchemaNodeBuilder implements Da
 
     /**
      * Get case by name.
-     *
+     * 
      * @param caseName
      *            name of case to search
      * @return case with given name if present, null otherwise
@@ -125,10 +125,10 @@ public final class ChoiceBuilder extends AbstractSchemaNodeBuilder implements Da
 
     /**
      * Add case node to this choice.
-     *
+     * 
      * If node is not declared with 'case' keyword, create new case builder and
      * make this node child of newly created case.
-     *
+     * 
      * @param caseNode
      *            case node
      */