X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=yang%2Fyang-parser-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fparser%2Fbuilder%2Fapi%2FUsesNodeBuilder.java;h=5b17b1a9dfa4e22ddb0df5320a23330212463755;hb=277461c62786e8b88a60aaa3f195f0a852b87f30;hp=344d8623dc57126c7698fb15aa1b9a1160377325;hpb=7a2b8cc8408824e107b84f9872ead9267b709bd8;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 344d8623dc..5b17b1a9df 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 @@ -9,76 +9,156 @@ package org.opendaylight.yangtools.yang.parser.builder.api; import java.util.List; 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.parser.builder.impl.UnknownSchemaNodeBuilder; -import org.opendaylight.yangtools.yang.parser.util.RefineHolder; /** - * Interface for builders of 'uses' statement. + * Builder for 'uses' statement. */ -public interface UsesNodeBuilder extends GroupingMember, Builder { - +public interface UsesNodeBuilder extends GroupingMember { + + /** + * 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. + */ + @Override DataNodeContainerBuilder getParent(); - String getGroupingName(); - + /** + * Get target grouping path. + * + * @return target grouping path + */ + SchemaPath getTargetGroupingPath(); + + /** + * 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 information about augmentation + */ void setAugmenting(boolean augmenting); - List getRefines(); + /** + * 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(); - void addRefine(RefineHolder refine); - + /** + * Add refine statement. + * + * @param refine + * new RefineHolder object + */ + void addRefine(RefineBuilder refine); + + /** + * Add refine node. + * + * @param refineNode + * refined DataSchemaNodeBuilder object + */ void addRefineNode(DataSchemaNodeBuilder refineNode); + /** + * Build new UsesNode object. + * + * + * @return UsesNode Instance of {@link UsesNode} described by this builder. + */ + @Override UsesNode build(); - Set getTargetChildren(); - - void setTargetChildren(Set targetChildren); - - Set getTargetGroupings(); - - void setTargetGroupings(Set targetGroupings); - - Set getTargetTypedefs(); - - void setTargetTypedefs(Set targetTypedefs); - - List getTargetUnknownNodes(); - - void setTargetUnknownNodes(List targetUnknownNodes); - - boolean isCopy(); - - boolean isDataCollected(); - - void setDataCollected(boolean dataCollected); - - boolean isParentUpdated(); - - void setParentUpdated(boolean parentUpdated); + /** + * + * Returns true if uses node was resolved and {@link #getGroupingBuilder()} + * was instantiated for parent done of this node. + * + * @return true if uses node was resolved and associated nodes were instantiated in parent node. + */ + boolean isResolved(); + + /** + * + * Sets state of instantiation of {@link #getGroupingBuilder()} + * into parent node of this node. + * + * @deprecated Do not use this, this should be internal to the implementation + * and public API contract. + * + * @param resolved resolved + */ + @Deprecated + void setResolved(boolean resolved); }