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
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();
}
-/*\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();
+}
-/*\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();
+}
-/*\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();
+}
-/*\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();
+}
-/*\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();
+
+}
-/*\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();
+
+}
-/*\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 />
+ {@link #getYangVersion() <b><font color="#8b4513">yang-version</font></b>} "1";<br /><br />
+
+ {@link #getNamespace() <b><font color="#00FF00">namespace</font></b>} "urn:module:namespace";<br />
+ {@link #getPrefix() <b><font color="#0000FF">prefix</font></b><a name="prefix"></a>} "prefix";<br /><br />
+
+ {@link #getDescription() <b><font color="#b8860b">description</font></b>} "description test";<br />
+ {@link #getReference() <b><font color="#008b8b">reference</font></b>} "reference test";<br /><br />
+
+ {@link #getOrganization() <b><font color="#606060">organization</font></b>} "John Doe, john.doe@email.com";<br />
+ {@link #getContact() <b><font color="#FF9900">contact</font></b>} "http://www.opendaylight.org/";<br /><br />
+
+ {@link #getFeatures() <b><font color="#8b0000">feature</font></b>} feature-test{<br />
+ description "description of some feature";<br />
+ }</br>
+
+ {@link #getNotifications() <b><font color="#b22222">notification</font></b>} notification-test;<br />
+ {@link #getRpcs() <b><font color="#d2691e">rpc</font></b>} rpc-test;<br />
+ <!-- {@link #getDeviations() <b><font color="#b8860b">deviation</font></b>} deviation-test;<br /> -->
+ {@link #getIdentities() <b><font color="#bdb76b">identity</font></b>} identity-test;<br />
+ {@link #getExtensionSchemaNodes() <b><font color="#808000">extension</font></b>} extension-test;<br />
+
+
+ {@link #getRevision() <b><font color="#339900">revision</font></b>} 2011-08-27 {<br />
+
+ {@link #getImports() <b><font color="#9400d3">import</font></b>} other_module {<br />
+ prefix "other_module_prefix"<br />
+ revision-date 2011-08-27<br />
+ }<br /><br />
+
+ container cont {<br />
+ }<br />
+
+ {@link #getAugmentations() <b><font color="#dc143c">augment</font></b>} "/cont" { ;<br />
+ }<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();
+
+}
-/*\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();
+}
-/*\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();
+}
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);
}
-/*\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();
+
+}
-/*\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();
+ }
+}
-/*\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><T></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();
+}
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();
-/*\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();
+}
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();
}
}
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> {
}
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();
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();
* 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();
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();
}
-/*\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();
+
}
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();
}
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();
}
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();
}
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();
}
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();
}
/**
* Get case by name.
- *
+ *
* @param caseName
* name of case to search
* @return case with given name if present, null otherwise
/**
* 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
*/