当前位置: 首页>>代码示例>>Java>>正文


Java GroupingDefinition.getChildNodes方法代码示例

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


在下文中一共展示了GroupingDefinition.getChildNodes方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: checkIsAddedByUses

import org.opendaylight.yangtools.yang.model.api.GroupingDefinition; //导入方法依赖的package包/类
public static void checkIsAddedByUses(final GroupingDefinition node, final boolean expected) {
    assertEquals(expected, node.isAddedByUses());
    for (DataSchemaNode child : node.getChildNodes()) {
        checkIsAddedByUses(child, expected);
    }
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:7,代码来源:TestUtils.java


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