• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java GroupingDefinition类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.opendaylight.yangtools.yang.model.api.GroupingDefinition的典型用法代码示例。如果您正苦于以下问题:Java GroupingDefinition类的具体用法?Java GroupingDefinition怎么用?Java GroupingDefinition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GroupingDefinition类属于org.opendaylight.yangtools.yang.model.api包,在下文中一共展示了GroupingDefinition类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testActionStatementInDataContainers

import org.opendaylight.yangtools.yang.model.api.GroupingDefinition; //导入依赖的package包/类
@Test
public void testActionStatementInDataContainers() throws Exception {
    final SchemaContext schemaContext = StmtTestUtils.parseYangSource("/rfc7950/action-stmt/foo.yang");
    assertNotNull(schemaContext);

    assertContainsActions(schemaContext, "root", "grp-action", "aug-action");
    assertContainsActions(schemaContext, "top-list", "top-list-action");
    assertContainsActions(schemaContext, "top", "top-action");

    final Set<GroupingDefinition> groupings = schemaContext.getGroupings();
    assertEquals(1, groupings.size());
    assertContainsActions(groupings.iterator().next(), "grp-action");

    final Set<Module> modules = schemaContext.getModules();
    assertEquals(1, modules.size());
    final Module foo = modules.iterator().next();
    final Set<AugmentationSchemaNode> augmentations = foo.getAugmentations();
    assertEquals(1, augmentations.size());
    assertContainsActions(augmentations.iterator().next(), "aug-action", "grp-action");
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:21,代码来源:ActionStatementTest.java


示例2: notificationsInDataContainersTest

import org.opendaylight.yangtools.yang.model.api.GroupingDefinition; //导入依赖的package包/类
@Test
public void notificationsInDataContainersTest() throws Exception {
    final SchemaContext schemaContext = StmtTestUtils
            .parseYangSource("/rfc7950/notifications-in-data-nodes/foo.yang");
    assertNotNull(schemaContext);

    assertContainsNotifications(schemaContext, "root", "grp-notification", "aug-notification");
    assertContainsNotifications(schemaContext, "top-list", "top-list-notification");
    assertContainsNotifications(schemaContext, "top", "top-notification");

    final Set<GroupingDefinition> groupings = schemaContext.getGroupings();
    assertEquals(1, groupings.size());
    assertContainsNotifications(groupings.iterator().next(), "grp-notification");

    final Set<Module> modules = schemaContext.getModules();
    assertEquals(1, modules.size());
    final Module foo = modules.iterator().next();
    final Set<AugmentationSchemaNode> augmentations = foo.getAugmentations();
    assertEquals(1, augmentations.size());
    assertContainsNotifications(augmentations.iterator().next(), "aug-notification", "grp-notification");
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:22,代码来源:Bug6897Test.java


示例3: findDataSchemaNodeTest2

import org.opendaylight.yangtools.yang.model.api.GroupingDefinition; //导入依赖的package包/类
@Test
public void findDataSchemaNodeTest2() throws URISyntaxException, IOException, YangSyntaxErrorException,
        ReactorException {
    // findDataSchemaNode(final SchemaContext context, final Module module,
    // final RevisionAwareXPath nonCondXPath) {

    final SchemaContext context = TestUtils.parseYangSources("/schema-context-util-test");
    final Module module = context.findModule(new URI("uri:my-module"), Revision.of("2014-10-07")).get();

    final GroupingDefinition grouping = getGroupingByName(module, "my-grouping");
    final SchemaNode testNode = grouping.getDataChildByName(QName.create(module.getQNameModule(),
            "my-leaf-in-gouping2"));

    final RevisionAwareXPath xpath = new RevisionAwareXPathImpl("my:my-grouping/my:my-leaf-in-gouping2", true);

    final SchemaNode foundNode = SchemaContextUtil.findDataSchemaNode(context, module, xpath);

    assertNotNull(foundNode);
    assertNotNull(testNode);
    assertEquals(testNode, foundNode);

}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:23,代码来源:SchemaContextUtilTest.java


示例4: extensionsTest

import org.opendaylight.yangtools.yang.model.api.GroupingDefinition; //导入依赖的package包/类
@Test
public void extensionsTest() throws ReactorException {
    SchemaContext result = RFC7950Reactors.defaultReactor().newBuild().addSource(YANG_EXT).buildEffective();
    assertNotNull(result);

    Set<GroupingDefinition> groupings = result.getGroupings();
    assertEquals(1, groupings.size());

    GroupingDefinition grp = groupings.iterator().next();

    Collection<DataSchemaNode> childNodes = grp.getChildNodes();
    assertEquals(1, childNodes.size());
    DataSchemaNode child = childNodes.iterator().next();

    assertTrue(child instanceof LeafSchemaNode);
    LeafSchemaNode leaf = (LeafSchemaNode) child;

    assertNotNull(leaf.getType());
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:20,代码来源:EffectiveBuildTest.java


示例5: testOrderingNestedChildNodes2

import org.opendaylight.yangtools.yang.model.api.GroupingDefinition; //导入依赖的package包/类
@Test
public void testOrderingNestedChildNodes2() throws Exception {
    final Set<GroupingDefinition> groupings = baz.getGroupings();
    assertEquals(1, groupings.size());
    final GroupingDefinition target = groupings.iterator().next();

    final Collection<DataSchemaNode> childNodes = target.getChildNodes();
    final String[] expectedOrder = { "data", "how", "address", "port", "addresses" };
    final String[] actualOrder = new String[childNodes.size()];

    int offset = 0;
    for (final DataSchemaNode child : childNodes) {
        actualOrder[offset] = child.getQName().getLocalName();
        offset++;
    }
    assertArrayEquals(expectedOrder, actualOrder);
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:18,代码来源:OrderingTest.java


示例6: allGroupingsToGenTypes

import org.opendaylight.yangtools.yang.model.api.GroupingDefinition; //导入依赖的package包/类
private List<Type> allGroupingsToGenTypes(final Module module) {
    final List<Type> genTypes = new ArrayList<>();
    final String basePackageName = moduleNamespaceToPackageName(module);
    final Set<GroupingDefinition> groupings = module.getGroupings();
    List<GroupingDefinition> groupingsSortedByDependencies;
    // groupingsSortedByDependencies =
    // sortGroupingDefinitionsByUses(groupings);
    groupingsSortedByDependencies = GroupingDefinitionDependencySort.sort(groupings);

    for (final GroupingDefinition grouping : groupingsSortedByDependencies) {
        GeneratedType genType = groupingToGenType(basePackageName, grouping);
        genTypes.add(genType);
        SchemaPath schemaPath = grouping.getPath();
        allGroupings.put(schemaPath, genType);
    }
    return genTypes;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:18,代码来源:BindingGeneratorImpl.java


示例7: emitDataNodeContainer

import org.opendaylight.yangtools.yang.model.api.GroupingDefinition; //导入依赖的package包/类
private void emitDataNodeContainer(final DataNodeContainer input) {
    for (final TypeDefinition<?> typedef : input.getTypeDefinitions()) {
        emitTypedefNode(typedef);
    }
    for (final GroupingDefinition grouping : input.getGroupings()) {
        emitGrouping(grouping);
    }
    for (final DataSchemaNode child : input.getChildNodes()) {
        emitDataSchemaNode(child);
    }
    for (final UsesNode usesNode : input.getUses()) {
        emitUsesNode(usesNode);
    }
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:15,代码来源:SchemaContextEmitter.java


示例8: emitGrouping

import org.opendaylight.yangtools.yang.model.api.GroupingDefinition; //导入依赖的package包/类
private void emitGrouping(final GroupingDefinition grouping) {
    super.writer.startGroupingNode(grouping.getQName());
    emitDocumentedNode(grouping);
    emitDataNodeContainer(grouping);
    emitUnknownStatementNodes(grouping.getUnknownSchemaNodes());
    emitNotifications(grouping.getNotifications());
    emitActions(grouping.getActions());
    super.writer.endNode();

}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:11,代码来源:SchemaContextEmitter.java


示例9: emitOperationBody

import org.opendaylight.yangtools.yang.model.api.GroupingDefinition; //导入依赖的package包/类
private void emitOperationBody(final OperationDefinition rpc) {
    // FIXME: BUG-2444: *(ifFeatureNode )
    emitDocumentedNode(rpc);

    for (final TypeDefinition<?> typedef : rpc.getTypeDefinitions()) {
        emitTypedefNode(typedef);
    }
    for (final GroupingDefinition grouping : rpc.getGroupings()) {
        emitGrouping(grouping);
    }
    emitInput(rpc.getInput());
    emitOutput(rpc.getOutput());
    emitUnknownStatementNodes(rpc.getUnknownSchemaNodes());
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:15,代码来源:SchemaContextEmitter.java


示例10: RpcEffectiveStatementImpl

import org.opendaylight.yangtools.yang.model.api.GroupingDefinition; //导入依赖的package包/类
RpcEffectiveStatementImpl(final StmtContext<QName, RpcStatement,
        EffectiveStatement<QName, RpcStatement>> ctx) {
    super(ctx);
    input = findAsContainer(this, InputEffectiveStatement.class);
    output = findAsContainer(this, OutputEffectiveStatement.class);

    // initSubstatements
    Set<GroupingDefinition> groupingsInit = new HashSet<>();
    Set<TypeDefinition<?>> mutableTypeDefinitions = new LinkedHashSet<>();
    for (EffectiveStatement<?, ?> effectiveStatement : effectiveSubstatements()) {
        if (effectiveStatement instanceof GroupingDefinition) {
            GroupingDefinition groupingDefinition = (GroupingDefinition) effectiveStatement;
            groupingsInit.add(groupingDefinition);
        }
        if (effectiveStatement instanceof TypedefEffectiveStatement) {
            TypedefEffectiveStatement typeDef = (TypedefEffectiveStatement) effectiveStatement;
            TypeDefinition<?> type = typeDef.getTypeDefinition();
            if (!mutableTypeDefinitions.contains(type)) {
                mutableTypeDefinitions.add(type);
            } else {
                throw EffectiveStmtUtils.createNameCollisionSourceException(ctx, effectiveStatement);
            }
        }
    }
    this.groupings = ImmutableSet.copyOf(groupingsInit);
    this.typeDefinitions = ImmutableSet.copyOf(mutableTypeDefinitions);
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:28,代码来源:RpcEffectiveStatementImpl.java


示例11: ActionEffectiveStatementImpl

import org.opendaylight.yangtools.yang.model.api.GroupingDefinition; //导入依赖的package包/类
ActionEffectiveStatementImpl(
        final StmtContext<QName, ActionStatement, EffectiveStatement<QName, ActionStatement>> ctx) {
    super(ctx);

    input = findAsContainer(this, InputEffectiveStatement.class);
    output = findAsContainer(this, OutputEffectiveStatement.class);

    // initSubstatements
    final Set<GroupingDefinition> groupingsInit = new HashSet<>();
    final Set<TypeDefinition<?>> mutableTypeDefinitions = new LinkedHashSet<>();
    for (final EffectiveStatement<?, ?> effectiveStatement : effectiveSubstatements()) {
        if (effectiveStatement instanceof GroupingDefinition) {
            final GroupingDefinition groupingDefinition = (GroupingDefinition) effectiveStatement;
            groupingsInit.add(groupingDefinition);
        }
        if (effectiveStatement instanceof TypedefEffectiveStatement) {
            final TypedefEffectiveStatement typeDef = (TypedefEffectiveStatement) effectiveStatement;
            final TypeDefinition<?> type = typeDef.getTypeDefinition();
            if (!mutableTypeDefinitions.contains(type)) {
                mutableTypeDefinitions.add(type);
            } else {
                throw EffectiveStmtUtils.createNameCollisionSourceException(ctx, effectiveStatement);
            }
        }
    }
    this.groupings = ImmutableSet.copyOf(groupingsInit);
    this.typeDefinitions = ImmutableSet.copyOf(mutableTypeDefinitions);

    // initCopyType
    final CopyHistory copyTypesFromOriginal = ctx.getCopyHistory();
    if (copyTypesFromOriginal.contains(CopyType.ADDED_BY_USES_AUGMENTATION)) {
        this.augmenting = true;
        this.addedByUses = true;
    } else {
        this.augmenting = copyTypesFromOriginal.contains(CopyType.ADDED_BY_AUGMENTATION);
        this.addedByUses = copyTypesFromOriginal.contains(CopyType.ADDED_BY_USES);
    }
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:39,代码来源:ActionEffectiveStatementImpl.java


示例12: getGroupingByName

import org.opendaylight.yangtools.yang.model.api.GroupingDefinition; //导入依赖的package包/类
private static GroupingDefinition getGroupingByName(final DataNodeContainer dataNodeContainer, final String name) {
    for (final GroupingDefinition grouping : dataNodeContainer.getGroupings()) {
        if (grouping.getQName().getLocalName().equals(name)) {
            return grouping;
        }
    }
    return null;
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:9,代码来源:SchemaContextUtilTest.java


示例13: testGrouping

import org.opendaylight.yangtools.yang.model.api.GroupingDefinition; //导入依赖的package包/类
@Test
public void testGrouping() throws URISyntaxException {
    final Module testModule = TestUtils.findModule(context, "config").get();
    assertNotNull(testModule);

    final Set<GroupingDefinition> groupings = testModule.getGroupings();
    assertEquals(1, groupings.size());

    final Iterator<GroupingDefinition> groupingsIterator = groupings.iterator();
    final GroupingDefinition grouping = groupingsIterator.next();
    assertEquals("service-ref", grouping.getQName().getLocalName());
    assertEquals(Optional.of("Type of references to a particular service instance. This type\n"
            + "can be used when defining module configuration to refer to a\n"
            + "particular service instance. Containers using this grouping\n"
            + "should not define anything else. The run-time implementation\n"
            + "is expected to inject a reference to the service as the value\n"
            + "of the container."), grouping.getDescription());

    final Collection<DataSchemaNode> children = grouping.getChildNodes();
    assertEquals(2, children.size());

    final LeafSchemaNode leaf1 = (LeafSchemaNode) grouping.getDataChildByName(QName.create(
            testModule.getQNameModule(), "type"));
    assertNotNull(leaf1);
    assertTrue(leaf1.isMandatory());

    final LeafSchemaNode leaf2 = (LeafSchemaNode) grouping.getDataChildByName(QName.create(
            testModule.getQNameModule(), "name"));
    assertNotNull(leaf2);
    assertTrue(leaf2.isMandatory());
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:32,代码来源:YinFileGroupingStmtTest.java


示例14: testGrouping

import org.opendaylight.yangtools.yang.model.api.GroupingDefinition; //导入依赖的package包/类
@Test
public void testGrouping() {
    final Module testModule = TestUtils.findModule(ctx, "baz").get();
    final Set<GroupingDefinition> groupings = testModule.getGroupings();
    assertEquals(1, groupings.size());
    final GroupingDefinition grouping = groupings.iterator().next();
    final Collection<DataSchemaNode> children = grouping.getChildNodes();
    assertEquals(5, children.size());
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:10,代码来源:GroupingTest.java


示例15: getGroupings

import org.opendaylight.yangtools.yang.model.api.GroupingDefinition; //导入依赖的package包/类
@Override
public Set<GroupingDefinition> getGroupings() {
    final Set<GroupingDefinition> result = new LinkedHashSet<>();
    for (Module module : getModules()) {
        result.addAll(module.getGroupings());
    }
    return Collections.unmodifiableSet(result);
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:9,代码来源:AbstractSchemaContext.java


示例16: traverseGroupings

import org.opendaylight.yangtools.yang.model.api.GroupingDefinition; //导入依赖的package包/类
private void traverseGroupings(final DataNodeContainer dataNode) {
    final Set<GroupingDefinition> groupings = dataNode.getGroupings();
    if (groupings != null) {
        for (GroupingDefinition grouping : groupings) {
            allGroupings.add(grouping);
            traverse(grouping);
        }
    }
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:10,代码来源:DataNodeIterator.java


示例17: getGroupingByName

import org.opendaylight.yangtools.yang.model.api.GroupingDefinition; //导入依赖的package包/类
private static GroupingDefinition getGroupingByName(final DataNodeContainer dataNodeContainer, final QName name) {
    for (final GroupingDefinition grouping : dataNodeContainer.getGroupings()) {
        if (grouping.getQName().equals(name)) {
            return grouping;
        }
    }
    return null;
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:9,代码来源:SchemaContextUtil.java


示例18: testGetGroupings

import org.opendaylight.yangtools.yang.model.api.GroupingDefinition; //导入依赖的package包/类
@Test
public void testGetGroupings() {
    final Module moduleConfig = mockModule(CONFIG_NAME);
    final SchemaContext schemaContext = mockSchema(moduleConfig);
    final FilteringSchemaContextProxy filteringSchemaContextProxy = createProxySchemaCtx(schemaContext,
            new HashSet<>(), moduleConfig);

    final GroupingDefinition mockedGrouping = mock(GroupingDefinition.class);
    final Set<GroupingDefinition> groupings = Collections.singleton(mockedGrouping);
    doReturn(groupings).when(moduleConfig).getGroupings();

    final Set<GroupingDefinition> schemaContextProxyGroupings = filteringSchemaContextProxy.getGroupings();
    assertTrue(schemaContextProxyGroupings.contains(mockedGrouping));
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:15,代码来源:SchemaContextProxyTest.java


示例19: groupingToGenType

import org.opendaylight.yangtools.yang.model.api.GroupingDefinition; //导入依赖的package包/类
private GeneratedType groupingToGenType(final String basePackageName, GroupingDefinition grouping) {
    if (grouping == null) {
        return null;
    }

    final String packageName = packageNameForGeneratedType(basePackageName, grouping.getPath());
    final Set<DataSchemaNode> schemaNodes = grouping.getChildNodes();
    final GeneratedTypeBuilder typeBuilder = addDefaultInterfaceDefinition(packageName, grouping);

    resolveDataSchemaNodes(basePackageName, typeBuilder, schemaNodes);
    return typeBuilder.toInstance();
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:13,代码来源:BindingGeneratorImpl.java


示例20: addDefaultInterfaceDefinition

import org.opendaylight.yangtools.yang.model.api.GroupingDefinition; //导入依赖的package包/类
/**
 * Method instantiates new Generated Type Builder and sets the implements
 * definitions of Data Object and Augmentable.
 *
 * @param packageName
 *            Generated Type Package Name
 * @param schemaNode
 *            Schema Node definition
 * @return Generated Type Builder instance for Schema Node definition
 */
private GeneratedTypeBuilder addDefaultInterfaceDefinition(final String packageName, final SchemaNode schemaNode) {
    final GeneratedTypeBuilder builder = addRawInterfaceDefinition(packageName, schemaNode, "");
    builder.addImplementsType(Types.DATA_OBJECT);
    if (!(schemaNode instanceof GroupingDefinition)) {
        builder.addImplementsType(Types.augmentableTypeFor(builder));
    }

    if (schemaNode instanceof DataNodeContainer) {
        addInterfaceDefinition((DataNodeContainer) schemaNode, builder);
    }

    return builder;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:24,代码来源:BindingGeneratorImpl.java



注:本文中的org.opendaylight.yangtools.yang.model.api.GroupingDefinition类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SaveDocumentEvent类代码示例发布时间:2022-05-22
下一篇:
Java AclEntryScopeProto类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap