X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=yang%2Fyang-parser-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fparser%2Fbuilder%2Fapi%2FUsesNodeBuilder.java;h=6b827841af9a8459707f1e632e3cc57005006537;hb=23883848595da8256244c7b952ef3a7d0ec05e68;hp=0965f6421321b8fd957614b69cc8e7202a720bc7;hpb=717b2cc4a5477867981786ad554de233d5f7d1d7;p=yangtools.git diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/builder/api/UsesNodeBuilder.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/builder/api/UsesNodeBuilder.java index 0965f64213..6b827841af 100644 --- a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/builder/api/UsesNodeBuilder.java +++ b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/builder/api/UsesNodeBuilder.java @@ -13,6 +13,7 @@ import java.util.Set; import org.opendaylight.yangtools.yang.model.api.GroupingDefinition; import org.opendaylight.yangtools.yang.model.api.SchemaPath; import org.opendaylight.yangtools.yang.model.api.UsesNode; +import org.opendaylight.yangtools.yang.model.api.YangNode; import org.opendaylight.yangtools.yang.parser.builder.impl.UnknownSchemaNodeBuilder; import org.opendaylight.yangtools.yang.parser.util.RefineHolder; @@ -21,62 +22,192 @@ import org.opendaylight.yangtools.yang.parser.util.RefineHolder; */ public interface UsesNodeBuilder extends GroupingMember, Builder { + /** + * Get parent of this uses node. Since uses can be defined only under on of + * module, container, list, case, grouping, input, output, notification or + * augment, return type is DataNodeContainerBuilder. + */ DataNodeContainerBuilder getParent(); - String getGroupingName(); - + /** + * Get grouping path as string. + * + * @return grouping path as String + */ + String getGroupingPathAsString(); + + /** + * Get grouping path. + * + * @return grouping path as SchemaPath + */ SchemaPath getGroupingPath(); - void setGroupingPath(SchemaPath groupingPath); - + /** + * Get grouping definition. + * + * @return GroupingDefinition if present, null otherwise + */ GroupingDefinition getGroupingDefinition(); + /** + * Set grouping definition. + * + * @param groupingDefinition + * GroupingDefinition object + */ void setGroupingDefinition(GroupingDefinition groupingDefinition); + /** + * Get grouping builder. + * + * @return GroupingBuilder if present, null otherwise + */ GroupingBuilder getGroupingBuilder(); + /** + * Set grouping builder. + * + * @param grouping + * GroupingBuilder object + */ void setGrouping(GroupingBuilder grouping); - Set getAugmentations(); - - void addAugment(AugmentationSchemaBuilder builder); - + /** + * Get information if this uses node is defined in augment. + * + * @return true, if this node is defined under augment statement, false + * otherwise + */ boolean isAugmenting(); + /** + * Set information if this uses node is defined in augment. + * + * @param augmenting + */ void setAugmenting(boolean augmenting); + /** + * Get augment under which was this uses node was defined. + *

+ * Note: This method may return different object than {@link #getParent()} + * if this node is a copy of other uses node. If the uses node is copied, + * its parent has changed, but parent augment is always same. + *

+ * + * @return AugmentationSchemaBuilder under which was this node defined + */ + AugmentationSchemaBuilder getParentAugment(); + + /** + * Set augment under which was this uses node was defined. + * + * @param augment + */ + void setParentAugment(AugmentationSchemaBuilder augment); + + /** + * Get augmentations defined in this uses node. + * + * @return set of augmentations defined in this node + */ + Set getAugmentations(); + + /** + * Add augment builder. + * + * @param builder + * new builder of augment statement + */ + void addAugment(AugmentationSchemaBuilder builder); + + /** + * Get refine statements. + * + * @return list of RefineHolder objects + */ List getRefines(); + /** + * Get refined nodes. + * + * @return List of refined SchemaNodeBuilder objects + */ List getRefineNodes(); + /** + * Add refine statement. + * + * @param refine + * new RefineHolder object + */ void addRefine(RefineHolder refine); + /** + * Add refine node. + * + * @param refineNode + * refined DataSchemaNodeBuilder object + */ void addRefineNode(DataSchemaNodeBuilder refineNode); - UsesNode build(); + /** + * Build new UsesNode object. + */ + UsesNode build(YangNode parent); + /** + * Get child nodes defined in target grouping. + * + * @return set of DataSchemaNodeBuilder objects + */ Set getTargetChildren(); - void setTargetChildren(Set targetChildren); - + /** + * Get groupings defined in target grouping. + * + * @return set of GroupingBuilder objects + */ Set getTargetGroupings(); - void setTargetGroupings(Set targetGroupings); - + /** + * Get type definitions defined in target grouping. + * + * @return set of typedefs defined in target grouping + */ Set getTargetTypedefs(); - void setTargetTypedefs(Set targetTypedefs); - + /** + * Get unknown nodes defined in target grouping. + * + * @return list of unknown nodes defined in target grouping + */ List getTargetUnknownNodes(); - void setTargetUnknownNodes(List targetUnknownNodes); - + /** + * + * @return true, if this object was built based on another UsesNodeBuilder, + * false otherwise + */ + boolean isCopy(); + + /** + * + * @return true, if target grouping objects was loaded already, false + * otherwise + */ boolean isDataCollected(); + /** + * Set if target grouping objects was loaded already. + * + * @param dataCollected + */ void setDataCollected(boolean dataCollected); - boolean isParentUpdated(); + boolean isResolved(); - void setParentUpdated(boolean parentUpdated); + void setResolved(boolean resolved); }