From: Martin Vitez Date: Mon, 20 May 2013 11:20:54 +0000 (+0200) Subject: More javadocs added to yang-model-api. X-Git-Tag: releasepom-0.1.0~438 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=82d65e5729893688d4daa0a9d6a55d90d30d6899 More javadocs added to yang-model-api. Deleted not used KeyDefinition class. Signed-off-by: Martin Vitez --- diff --git a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/Deviation.java b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/Deviation.java index b3b2c06caa..8745dda8ba 100644 --- a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/Deviation.java +++ b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/Deviation.java @@ -7,16 +7,40 @@ */ package org.opendaylight.controller.yang.model.api; +/** + * Interface describing YANG 'deviation' statement. + *

+ * The 'deviation' statement defines a hierarchy of a module that the device + * does not implement faithfully. Deviations define the way a device deviate + * from a standard. + *

+ */ public interface Deviation { + /** + * Enum describing YANG deviation 'deviate' statement. It defines how the + * device's implementation of the target node deviates from its original + * definition. + */ enum Deviate { NOT_SUPPORTED, ADD, REPLACE, DELETE } + /** + * @return SchemaPath that identifies the node in the schema tree where a + * deviation from the module occurs. + */ SchemaPath getTargetPath(); + /** + * @return deviate statement of this deviation + */ Deviate getDeviate(); + /** + * @return textual cross-reference to an external document that provides + * additional information relevant to this node. + */ String getReference(); } diff --git a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/FeatureDefinition.java b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/FeatureDefinition.java index efd0e18d18..a6d6331aae 100644 --- a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/FeatureDefinition.java +++ b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/FeatureDefinition.java @@ -7,6 +7,14 @@ */ package org.opendaylight.controller.yang.model.api; +/** + * Interface describing YANG 'feature' statement. + *

+ * The feature statement is used to define a mechanism by which portions of the + * schema are marked as conditional. A feature name can later be referenced + * using the 'if-feature' statement. + *

+ */ public interface FeatureDefinition extends SchemaNode { } diff --git a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/GroupingDefinition.java b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/GroupingDefinition.java index 5e94f3b5be..1c8398b86c 100644 --- a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/GroupingDefinition.java +++ b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/GroupingDefinition.java @@ -7,10 +7,14 @@ */ package org.opendaylight.controller.yang.model.api; -import java.util.Set; - +/** + * Interface describing YANG 'grouping' statement. + *

+ * It is used to define a reusable block of nodes, which may be used locally in + * the module, in modules that include it, and by other modules that import from + * it. + *

+ */ public interface GroupingDefinition extends DataNodeContainer, SchemaNode { - Set getUses(); - } diff --git a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/IdentitySchemaNode.java b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/IdentitySchemaNode.java index d1e68182c3..7e08238c04 100644 --- a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/IdentitySchemaNode.java +++ b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/IdentitySchemaNode.java @@ -1,14 +1,27 @@ /* - * 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 - */ + * 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.controller.yang.model.api; +/** + * Interface describing YANG 'identity' statement. + *

+ * The 'identity' statement is used to define a new globally unique, abstract, + * and untyped identity. Its only purpose is to denote its name, semantics, and + * existence. The built-in datatype "identityref" can be used to reference + * identities within a data model. + *

+ */ public interface IdentitySchemaNode extends SchemaNode { + /** + * @return an existing identity, from which the new identity is derived or + * null, if the identity is defined from scratch. + */ IdentitySchemaNode getBaseIdentity(); } diff --git a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/KeyDefinition.java b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/KeyDefinition.java deleted file mode 100644 index 5e8b2c70a8..0000000000 --- a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/KeyDefinition.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * 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.controller.yang.model.api; - -public interface KeyDefinition extends SchemaNode { - - TypeDefinition> getType(); - -} diff --git a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/LeafListSchemaNode.java b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/LeafListSchemaNode.java index 1d7287f0f7..8780322e52 100644 --- a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/LeafListSchemaNode.java +++ b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/LeafListSchemaNode.java @@ -7,10 +7,20 @@ */ package org.opendaylight.controller.yang.model.api; +/** + * Interface describing YANG 'leaf-list' statement. + */ public interface LeafListSchemaNode extends DataSchemaNode { 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(); } diff --git a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/LeafSchemaNode.java b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/LeafSchemaNode.java index 3ad047f3b9..9325cb8f0c 100644 --- a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/LeafSchemaNode.java +++ b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/LeafSchemaNode.java @@ -7,8 +7,17 @@ */ package org.opendaylight.controller.yang.model.api; +/** + * Interface describing YANG 'leaf' statement. + *

+ * The 'leaf' statement is used to define a leaf node in the schema tree. + *

+ */ public interface LeafSchemaNode extends DataSchemaNode { + /** + * @return type of this leaf + */ TypeDefinition getType(); } diff --git a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/ListSchemaNode.java b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/ListSchemaNode.java index 824afb76e8..3a812bd35e 100644 --- a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/ListSchemaNode.java +++ b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/ListSchemaNode.java @@ -11,11 +11,29 @@ import java.util.List; import org.opendaylight.controller.yang.common.QName; +/** + * Interface describing YANG 'list' statement. + *

+ * The 'list' statement is used to define an interior data node in the schema + * tree. A list entry is uniquely identified by the values of the list's keys, + * if defined. + *

+ */ public interface ListSchemaNode extends DataNodeContainer, AugmentationTarget, DataSchemaNode { + /** + * @return List of QNames of leaf identifiers of this list + */ public List getKeyDefinition(); + /** + * YANG 'ordered-by' statement. It defines whether the order of entries + * within a 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(); } diff --git a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/ModuleImport.java b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/ModuleImport.java index 37237dd057..4314798589 100644 --- a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/ModuleImport.java +++ b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/ModuleImport.java @@ -9,11 +9,28 @@ package org.opendaylight.controller.yang.model.api; import java.util.Date; +/** + * Interface describing YANG 'import' statement. + *

+ * The import statement makes definitions from one module available inside + * another module or submodule. + *

+ */ public interface ModuleImport { + /** + * @return Name of the module to import + */ String getModuleName(); + /** + * @return Revision of module to import + */ Date getRevision(); + /** + * @return Prefix used to point to imported module + */ String getPrefix(); + } diff --git a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/NotificationDefinition.java b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/NotificationDefinition.java index 4e805f0fa6..8e7686cf3b 100644 --- a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/NotificationDefinition.java +++ b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/NotificationDefinition.java @@ -7,5 +7,10 @@ */ package org.opendaylight.controller.yang.model.api; +/** + * Interface describing YANG 'notification' statement. The + * notification statement is used to define a NETCONF notification. + */ public interface NotificationDefinition extends SchemaNode, DataNodeContainer { + } diff --git a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/RpcDefinition.java b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/RpcDefinition.java index a4c784e0cd..5ce453dd38 100644 --- a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/RpcDefinition.java +++ b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/RpcDefinition.java @@ -9,13 +9,36 @@ package org.opendaylight.controller.yang.model.api; import java.util.Set; +/** + * Interface describing YANG 'rpc' statement. + *

+ * The rpc statement defines an rpc node in the schema tree. Under the rpc node, + * a schema node with the name 'input', and a schema node with the name 'output' + * are also defined. + *

+ */ public interface RpcDefinition extends SchemaNode { + /** + * @return Set of type definitions declared under this rpc statement. + */ Set> getTypeDefinitions(); + /** + * @return Set of grouping statements declared under this rpc statement. + */ Set getGroupings(); + /** + * @return Definition of input parameters to the RPC operation. The + * substatements of input define nodes under the RPC's input node. + */ ContainerSchemaNode getInput(); + /** + * @return Definition of output parameters to the RPC operation. The + * substatements of output define nodes under the RPC's output node. + */ ContainerSchemaNode getOutput(); + } diff --git a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/Status.java b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/Status.java index 9a49d79d32..39aa0c8472 100644 --- a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/Status.java +++ b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/Status.java @@ -7,6 +7,28 @@ */ package org.opendaylight.controller.yang.model.api; +/** + * Enum describing YANG 'status' statement. If no status is specified, the + * default is CURRENT. + */ public enum Status { - CURRENT, DEPRECATED, OBSOLETE + + /** + * CURRENT means that the definition is current and valid. + */ + CURRENT, + + /** + * DEPRECATED indicates an obsolete definition, but it permits new/ + * continued implementation in order to foster interoperability with + * older/existing implementations. + */ + DEPRECATED, + + /** + * OBSOLETE means the definition is obsolete and SHOULD NOT be implemented + * and/or can be removed from implementations. + */ + OBSOLETE + } diff --git a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/UsesNode.java b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/UsesNode.java index 91fde5bd5c..e76f5e8131 100644 --- a/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/UsesNode.java +++ b/opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/UsesNode.java @@ -12,11 +12,31 @@ import java.util.Set; public interface UsesNode { + /** + * @return path to 'grouping' on which this 'uses' statement points + */ SchemaPath getGroupingPath(); - + + /** + * @return Set of augment statements defined under this uses node + */ Set getAugmentations(); - + + /** + * Returns true if the data node was added by augmentation, + * otherwise returns false + * + * @return true if the data node was added by augmentation, + * otherwise returns false + */ boolean isAugmenting(); - + + /** + * 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 getRefines(); }