本文整理汇总了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());
}
示例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);
}
示例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());
}
示例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());
}
示例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();
}
示例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);
}
}