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

Java LeafSchemaNode类代码示例

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

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



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

示例1: createInnerAttribute

import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; //导入依赖的package包/类
private static AttributeIfc createInnerAttribute(
        final DataSchemaNode dataSchemaNode,
        final TypeProviderWrapper typeProviderWrapper, final String packageName) {
    final Class<? extends DataSchemaNode> type = isAllowedType(dataSchemaNode);

    if (type.equals(LeafSchemaNode.class)) {
        return new JavaAttribute((LeafSchemaNode) dataSchemaNode,
                typeProviderWrapper);
    } else if (type.equals(ListSchemaNode.class)) {
        return ListAttribute.create((ListSchemaNode) dataSchemaNode,
                typeProviderWrapper, packageName);
    } else if (type.equals(LeafListSchemaNode.class)) {
        return ListAttribute.create((LeafListSchemaNode) dataSchemaNode,
                typeProviderWrapper);
    } else if (type.equals(ContainerSchemaNode.class)) {
        return TOAttribute.create((ContainerSchemaNode) dataSchemaNode,
                typeProviderWrapper, packageName);
    }

    throw new IllegalStateException("This should never happen");
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:22,代码来源:TOAttribute.java


示例2: getReturnTypeAttribute

import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; //导入依赖的package包/类
private static AttributeIfc getReturnTypeAttribute(final DataSchemaNode child, final TypeProviderWrapper typeProviderWrapper,
        final String packageName) {
    if (child instanceof LeafSchemaNode) {
        LeafSchemaNode leaf = (LeafSchemaNode) child;
        return new JavaAttribute(leaf, typeProviderWrapper);
    } else if (child instanceof ContainerSchemaNode) {
        ContainerSchemaNode container = (ContainerSchemaNode) child;
        TOAttribute toAttribute = TOAttribute.create(container, typeProviderWrapper, packageName);
        return toAttribute;
    } else if (child instanceof ListSchemaNode) {
        return ListAttribute.create((ListSchemaNode) child, typeProviderWrapper, packageName);
    } else if (child instanceof LeafListSchemaNode) {
        return ListAttribute.create((LeafListSchemaNode) child, typeProviderWrapper);
    } else {
        throw new IllegalStateException("Unknown output data node " + child + " for rpc");
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:18,代码来源:RuntimeBeanEntry.java


示例3: fromDataSchemaNode

import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; //导入依赖的package包/类
public static DataNormalizationOperation<?> fromDataSchemaNode(final DataSchemaNode potential) {
    if (potential instanceof ContainerSchemaNode) {
        return new ContainerNormalization((ContainerSchemaNode) potential);
    } else if (potential instanceof ListSchemaNode) {

        return fromListSchemaNode((ListSchemaNode) potential);
    } else if (potential instanceof LeafSchemaNode) {
        return new LeafNormalization((LeafSchemaNode) potential);
    } else if (potential instanceof ChoiceSchemaNode) {
        return new ChoiceNodeNormalization((ChoiceSchemaNode) potential);
    } else if (potential instanceof LeafListSchemaNode) {
        return fromLeafListSchemaNode((LeafListSchemaNode) potential);
    } else if (potential instanceof AnyXmlSchemaNode) {
        return new AnyXmlNormalization( (AnyXmlSchemaNode) potential);
    }
    return null;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:18,代码来源:DataNormalizationOperation.java


示例4: emitDataSchemaNode

import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; //导入依赖的package包/类
private void emitDataSchemaNode(final DataSchemaNode child) {
    if (!super.emitInstantiated && (child.isAddedByUses() || child.isAugmenting())) {
        // We skip instantiated nodes.
        return;
    }

    if (child instanceof ContainerSchemaNode) {
        emitContainer((ContainerSchemaNode) child);
    } else if (child instanceof LeafSchemaNode) {
        emitLeaf((LeafSchemaNode) child);
    } else if (child instanceof LeafListSchemaNode) {
        emitLeafList((LeafListSchemaNode) child);
    } else if (child instanceof ListSchemaNode) {
        emitList((ListSchemaNode) child);
    } else if (child instanceof ChoiceSchemaNode) {
        emitChoice((ChoiceSchemaNode) child);
    } else if (child instanceof AnyXmlSchemaNode) {
        emitAnyxml((AnyXmlSchemaNode) child);
    } else if (child instanceof AnyDataSchemaNode) {
        emitAnydata((AnyDataSchemaNode) child);
    } else {
        throw new UnsupportedOperationException("Not supported DataSchemaNode type " + child.getClass());
    }
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:25,代码来源:SchemaContextEmitter.java


示例5: emitRefine

import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; //导入依赖的package包/类
private void emitRefine(final Entry<SchemaPath, SchemaNode> refine) {
    final SchemaPath path = refine.getKey();
    final SchemaNode value = refine.getValue();
    super.writer.startRefineNode(path);

    if (value instanceof LeafSchemaNode) {
        emitRefineLeafNodes((LeafSchemaNode) value);
    } else if (value instanceof LeafListSchemaNode) {
        emitRefineLeafListNodes((LeafListSchemaNode) value);
    } else if (value instanceof ListSchemaNode) {
        emitRefineListNodes((ListSchemaNode) value);
    } else if (value instanceof ChoiceSchemaNode) {
        emitRefineChoiceNodes((ChoiceSchemaNode) value);
    } else if (value instanceof CaseSchemaNode) {
        emitRefineCaseNodes((CaseSchemaNode) value);
    } else if (value instanceof ContainerSchemaNode) {
        emitRefineContainerNodes((ContainerSchemaNode) value);
    } else if (value instanceof AnyXmlSchemaNode) {
        emitRefineAnyxmlNodes((AnyXmlSchemaNode) value);
    }
    super.writer.endNode();

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


示例6: from

import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; //导入依赖的package包/类
public static ModificationApplyOperation from(final DataSchemaNode schemaNode,
        final DataTreeConfiguration treeConfig) {
    if (treeConfig.getTreeType() == TreeType.CONFIGURATION) {
        Preconditions.checkArgument(schemaNode.isConfiguration(),
            "Supplied %s does not belongs to configuration tree.", schemaNode.getPath());
    }
    if (schemaNode instanceof ContainerSchemaNode) {
        final ContainerSchemaNode containerSchema = (ContainerSchemaNode) schemaNode;
        if (containerSchema.isPresenceContainer()) {
            return new PresenceContainerModificationStrategy(containerSchema, treeConfig);
        }

        return new StructuralContainerModificationStrategy(containerSchema, treeConfig);
    } else if (schemaNode instanceof ListSchemaNode) {
        return fromListSchemaNode((ListSchemaNode) schemaNode, treeConfig);
    } else if (schemaNode instanceof ChoiceSchemaNode) {
        return new ChoiceModificationStrategy((ChoiceSchemaNode) schemaNode, treeConfig);
    } else if (schemaNode instanceof LeafListSchemaNode) {
        return fromLeafListSchemaNode((LeafListSchemaNode) schemaNode, treeConfig);
    } else if (schemaNode instanceof LeafSchemaNode) {
        return new LeafModificationStrategy((LeafSchemaNode) schemaNode);
    }
    throw new IllegalArgumentException("Not supported schema node type for " + schemaNode.getClass());
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:25,代码来源:SchemaAwareApplyOperation.java


示例7: fromDataSchemaNode

import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; //导入依赖的package包/类
static InstanceIdToNodes<?> fromDataSchemaNode(final DataSchemaNode potential) {
    if (potential instanceof ContainerSchemaNode) {
        return new InstanceIdToCompositeNodes.ContainerTransformation((ContainerSchemaNode) potential);
    } else if (potential instanceof ListSchemaNode) {
        return fromListSchemaNode((ListSchemaNode) potential);
    } else if (potential instanceof LeafSchemaNode) {
        return new InstanceIdToSimpleNodes.LeafNormalization((LeafSchemaNode) potential);
    } else if (potential instanceof ChoiceSchemaNode) {
        return new InstanceIdToCompositeNodes.ChoiceNodeNormalization((ChoiceSchemaNode) potential);
    } else if (potential instanceof LeafListSchemaNode) {
        return fromLeafListSchemaNode((LeafListSchemaNode) potential);
    } else if (potential instanceof AnyXmlSchemaNode) {
        return new AnyXmlNormalization((AnyXmlSchemaNode) potential);
    }
    return null;
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:17,代码来源:InstanceIdToNodes.java


示例8: addSimpleChild

import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; //导入依赖的package包/类
private AbstractNodeDataWithSchema addSimpleChild(final DataSchemaNode schema) {
    SimpleNodeDataWithSchema newChild = null;
    if (schema instanceof LeafSchemaNode) {
        newChild = new LeafNodeDataWithSchema(schema);
    } else if (schema instanceof AnyXmlSchemaNode) {
        // YangModeledAnyXmlSchemaNode is handled by addCompositeChild method.
        if (schema instanceof YangModeledAnyXmlSchemaNode) {
            return null;
        }
        newChild = new AnyXmlNodeDataWithSchema(schema);
    } else {
        return null;
    }

    AugmentationSchemaNode augSchema = null;
    if (schema.isAugmenting()) {
        augSchema = findCorrespondingAugment(getSchema(), schema);
    }
    if (augSchema != null) {
        augmentationsToChild.put(augSchema, newChild);
    } else {
        addChild(newChild);
    }
    return newChild;
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:26,代码来源:CompositeNodeDataWithSchema.java


示例9: testLeafAsRootElement

import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; //导入依赖的package包/类
@Test
public void testLeafAsRootElement() throws Exception {
    final LeafSchemaNode topLevelLeaf = (LeafSchemaNode) fooModule.getDataChildByName(
            QName.create(fooModule.getQNameModule(), "top-level-leaf"));

    final InputStream resourceAsStream = XmlToNormalizedNodesTest.class.getResourceAsStream("/bug8675/foo-5.xml");

    final XMLInputFactory factory = XMLInputFactory.newInstance();
    final XMLStreamReader reader = factory.createXMLStreamReader(resourceAsStream);

    final NormalizedNodeResult result = new NormalizedNodeResult();
    final NormalizedNodeStreamWriter streamWriter = ImmutableNormalizedNodeStreamWriter.from(result);

    final XmlParserStream xmlParser = XmlParserStream.create(streamWriter, schemaContext, topLevelLeaf);
    xmlParser.parse(reader);

    final NormalizedNode<?, ?> transformedInput = result.getResult();
    assertNotNull(transformedInput);
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:20,代码来源:Bug8675Test.java


示例10: findSchemaNodeWithLeafrefType

import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; //导入依赖的package包/类
private LeafSchemaNode findSchemaNodeWithLeafrefType(final DataNodeContainer module, final String nodeName) {
    for (final DataSchemaNode childNode : module.getChildNodes()) {
        if (childNode instanceof DataNodeContainer) {
            LeafSchemaNode leafrefFromRecursion = findSchemaNodeWithLeafrefType((DataNodeContainer) childNode,
                    nodeName);
            if (leafrefFromRecursion != null) {
                return leafrefFromRecursion;
            }
        } else if (childNode.getQName().getLocalName().equals(nodeName) && childNode instanceof LeafSchemaNode) {
            final TypeDefinition<?> leafSchemaNodeType = ((LeafSchemaNode) childNode).getType();
            if (leafSchemaNodeType instanceof LeafrefTypeDefinition) {
                return (LeafSchemaNode) childNode;
            }
        }
    }
    return null;
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:18,代码来源:XmlStreamUtilsTest.java


示例11: fromDataSchemaNode

import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; //导入依赖的package包/类
@Nullable public static DataSchemaContextNode<?> fromDataSchemaNode(final DataSchemaNode potential) {
    if (potential instanceof ContainerSchemaNode) {
        return new ContainerContextNode((ContainerSchemaNode) potential);
    } else if (potential instanceof ListSchemaNode) {
        return fromListSchemaNode((ListSchemaNode) potential);
    } else if (potential instanceof LeafSchemaNode) {
        return new LeafContextNode((LeafSchemaNode) potential);
    } else if (potential instanceof ChoiceSchemaNode) {
        return new ChoiceNodeContextNode((ChoiceSchemaNode) potential);
    } else if (potential instanceof LeafListSchemaNode) {
        return fromLeafListSchemaNode((LeafListSchemaNode) potential);
    } else if (potential instanceof AnyXmlSchemaNode) {
        return new AnyXmlContextNode((AnyXmlSchemaNode) potential);
    }
    return null;
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:17,代码来源:DataSchemaContextNode.java


示例12: assertModifier

import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; //导入依赖的package包/类
private static void assertModifier(final SchemaContext schemaContext, final ModifierKind expectedModifierKind,
        final List<String> localNamePath) {
    final SchemaNode findNode = findNode(schemaContext, localNamePath);
    assertTrue(findNode instanceof LeafSchemaNode);
    final LeafSchemaNode myLeaf = (LeafSchemaNode) findNode;

    final TypeDefinition<? extends TypeDefinition<?>> type = myLeaf.getType();
    assertTrue(type instanceof StringTypeDefinition);
    final StringTypeDefinition stringType = (StringTypeDefinition) type;

    final List<PatternConstraint> patternConstraints = stringType.getPatternConstraints();
    assertEquals(1, patternConstraints.size());

    final PatternConstraint patternConstraint = patternConstraints.iterator().next();
    assertEquals(Optional.ofNullable(expectedModifierKind), patternConstraint.getModifier());
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:17,代码来源:Bug6870Test.java


示例13: testIdentityrefWithMultipleBaseIdentities

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

    final Module foo = schemaContext.findModule("foo", Revision.of("2017-01-11")).get();
    final Set<IdentitySchemaNode> identities = foo.getIdentities();
    assertEquals(3, identities.size());

    final LeafSchemaNode idrefLeaf = (LeafSchemaNode) foo.getDataChildByName(QName.create(foo.getQNameModule(),
            "idref-leaf"));
    assertNotNull(idrefLeaf);

    final IdentityrefTypeDefinition idrefType = (IdentityrefTypeDefinition) idrefLeaf.getType();
    final Set<IdentitySchemaNode> referencedIdentities = idrefType.getIdentities();
    assertEquals(3, referencedIdentities.size());
    assertEquals(identities, referencedIdentities);
    assertEquals("id-a", idrefType.getIdentities().iterator().next().getQName().getLocalName());
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:20,代码来源:IdentityrefStatementTest.java


示例14: checkInterfacesModuleSimpleTest

import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; //导入依赖的package包/类
private static void checkInterfacesModuleSimpleTest(final SchemaContext context,
        final Revision rev20100924, final QName dateTimeTypeDef20100924) {
    URI interfacesNS = URI.create("urn:ietf:params:xml:ns:yang:ietf-interfaces");
    Revision rev20121115 = Revision.of("2012-11-15");
    final QNameModule interfacesNS20121115 = QNameModule.create(interfacesNS, rev20121115);
    QName lastChange = QName.create(interfacesNS20121115, "last-change");

    Module interfacesModule20121115 = context.findModule("ietf-interfaces", rev20121115).get();
    DataSchemaNode leafLastChange = interfacesModule20121115.getDataChildByName(lastChange);
    assertNotNull(leafLastChange);

    assertTrue(leafLastChange instanceof LeafSchemaNode);
    QName lastChangeTypeQName = ((LeafSchemaNode) leafLastChange).getType().getQName();
    assertEquals(dateTimeTypeDef20100924, lastChangeTypeQName);

    Set<ModuleImport> imports = interfacesModule20121115.getImports();
    assertEquals(1, imports.size());
    ModuleImport interfacesImport = imports.iterator().next();
    assertEquals("ietf-yang-types", interfacesImport.getModuleName());
    assertEquals(Optional.of(rev20100924), interfacesImport.getRevision());
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:22,代码来源:MoreRevisionsTest.java


示例15: checkNetconfMonitoringModuleSimpleTest

import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; //导入依赖的package包/类
private static void checkNetconfMonitoringModuleSimpleTest(final SchemaContext context,
        final Revision rev20130715, final QName dateTimeTypeDef20130715) {
    URI monitoringNS = URI.create("urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring");
    final QNameModule monitoring19700101 = QNameModule.create(monitoringNS);
    QName lockedTime = QName.create(monitoring19700101, "locked-time");

    Module monitoringModule19700101 = context.findModule("ietf-netconf-monitoring").get();
    DataSchemaNode leafLockedTime = monitoringModule19700101.getDataChildByName(lockedTime);
    assertNotNull(leafLockedTime);

    assertTrue(leafLockedTime instanceof LeafSchemaNode);
    QName lockedTimeTypeQName = ((LeafSchemaNode) leafLockedTime).getType().getQName();
    assertEquals(dateTimeTypeDef20130715, lockedTimeTypeQName);

    Set<ModuleImport> imports = monitoringModule19700101.getImports();
    assertEquals(1, imports.size());
    ModuleImport monitoringImport = imports.iterator().next();
    assertEquals("ietf-yang-types", monitoringImport.getModuleName());
    assertEquals(Optional.of(rev20130715), monitoringImport.getRevision());
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:21,代码来源:MoreRevisionsTest.java


示例16: extensionsTest

import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; //导入依赖的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


示例17: getEffectiveUnits

import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; //导入依赖的package包/类
private static UnitsEffectiveStatement getEffectiveUnits(final Module module, final QName containerQName,
        final QName leafQName) {
    UnitsEffectiveStatement units = null;

    final ContainerSchemaNode cont = (ContainerSchemaNode) module.getDataChildByName(containerQName);
    assertNotNull(cont);
    final LeafSchemaNode leaf = (LeafSchemaNode) cont.getDataChildByName(leafQName);
    assertNotNull(leaf);

    for (EffectiveStatement<?, ?> effStmt : ((LeafEffectiveStatement) leaf).effectiveSubstatements()) {
        if (effStmt instanceof UnitsEffectiveStatement) {
            units = (UnitsEffectiveStatement) effStmt;
            break;
        }
    }

    return units;
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:19,代码来源:Bug6972Test.java


示例18: testDeviateReplaceOfImplicitSubstatements

import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; //导入依赖的package包/类
@Test
public void testDeviateReplaceOfImplicitSubstatements() throws Exception {
    final SchemaContext schemaContext = StmtTestUtils.parseYangSources("/bugs/bug9244/");
    assertNotNull(schemaContext);

    final Module barModule = schemaContext.findModule("bar", Revision.of("2017-10-13")).get();
    final ContainerSchemaNode barCont = (ContainerSchemaNode) barModule.getDataChildByName(
            QName.create(barModule.getQNameModule(), "bar-cont"));
    assertNotNull(barCont);
    assertFalse(barCont.isConfiguration());

    final LeafListSchemaNode barLeafList = (LeafListSchemaNode) barModule.getDataChildByName(
            QName.create(barModule.getQNameModule(), "bar-leaf-list"));
    assertNotNull(barLeafList);
    final ElementCountConstraint constraint = barLeafList.getElementCountConstraint().get();
    assertEquals(5, constraint.getMinElements().intValue());
    assertEquals(10, constraint.getMaxElements().intValue());

    final LeafSchemaNode barLeaf = (LeafSchemaNode) barModule.getDataChildByName(
            QName.create(barModule.getQNameModule(), "bar-leaf"));
    assertNotNull(barLeaf);
    assertTrue(barLeaf.isMandatory());
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:24,代码来源:Bug9244Test.java


示例19: testAddedByUsesLeafTypeQName

import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; //导入依赖的package包/类
@Test
public void testAddedByUsesLeafTypeQName() throws Exception {
    final SchemaContext loadModules = TestUtils.loadModules(getClass().getResource("/added-by-uses-leaf-test")
            .toURI());
    assertEquals(2, loadModules.getModules().size());
    foo = TestUtils.findModule(loadModules, "foo").get();
    final Module imp = TestUtils.findModule(loadModules, "import-module").get();

    final LeafSchemaNode leaf = (LeafSchemaNode) ((ContainerSchemaNode) foo.getDataChildByName(QName.create(
            foo.getQNameModule(), "my-container")))
            .getDataChildByName(QName.create(foo.getQNameModule(), "my-leaf"));

    TypeDefinition<?> impType = null;
    final Set<TypeDefinition<?>> typeDefinitions = imp.getTypeDefinitions();
    for (final TypeDefinition<?> typeDefinition : typeDefinitions) {
        if (typeDefinition.getQName().getLocalName().equals("imp-type")) {
            impType = typeDefinition;
            break;
        }
    }

    assertNotNull(impType);
    assertEquals(leaf.getType().getQName(), impType.getQName());
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:25,代码来源:GroupingTest.java


示例20: testAugmentInUsesResolving

import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; //导入依赖的package包/类
@Test
public void testAugmentInUsesResolving() throws Exception {
    final SchemaContext context = TestUtils.loadModules(getClass().getResource("/augment-test/augment-in-uses")
        .toURI());
    assertEquals(1, context.getModules().size());

    final Module test = context.getModules().iterator().next();
    final DataNodeContainer links = (DataNodeContainer) test.getDataChildByName(QName.create(test.getQNameModule(),
            "links"));
    final DataNodeContainer link = (DataNodeContainer) links.getDataChildByName(QName.create(test.getQNameModule(),
            "link"));
    final DataNodeContainer nodes = (DataNodeContainer) link.getDataChildByName(QName.create(test.getQNameModule(),
            "nodes"));
    final ContainerSchemaNode node = (ContainerSchemaNode) nodes.getDataChildByName(QName.create(
            test.getQNameModule(), "node"));
    final Set<AugmentationSchemaNode> augments = node.getAvailableAugmentations();
    assertEquals(1, augments.size());
    assertEquals(1, node.getChildNodes().size());
    final LeafSchemaNode id = (LeafSchemaNode) node.getDataChildByName(QName.create(test.getQNameModule(), "id"));
    assertTrue(id.isAugmenting());
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:22,代码来源:AugmentTest.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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