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

Java ListSchemaNode类代码示例

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

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



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

示例1: createInnerAttribute

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

import org.opendaylight.yangtools.yang.model.api.ListSchemaNode; //导入依赖的package包/类
private void emitList(final ListSchemaNode child) {
    super.writer.startListNode(child.getQName());
    child.getWhenCondition().ifPresent(this::emitWhen);

    // FIXME: BUG-2444: *(ifFeatureNode )
    child.getMustConstraints().forEach(this::emitMust);
    emitKey(child.getKeyDefinition());
    emitUniqueConstraints(child.getUniqueConstraints());
    emitConfigNode(child.isConfiguration());
    child.getElementCountConstraint().ifPresent(this::emitCountConstraint);
    emitOrderedBy(child.isUserOrdered());
    emitDocumentedNode(child);
    emitDataNodeContainer(child);
    emitUnknownStatementNodes(child.getUnknownSchemaNodes());
    emitNotifications(child.getNotifications());
    emitActions(child.getActions());
    super.writer.endNode();

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


示例6: emitRefine

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


示例7: createRoot

import org.opendaylight.yangtools.yang.model.api.ListSchemaNode; //导入依赖的package包/类
private static NormalizedNode<?, ?> createRoot(final DataNodeContainer schemaNode,
        final YangInstanceIdentifier path) {
    if (path.isEmpty()) {
        Preconditions.checkArgument(schemaNode instanceof ContainerSchemaNode,
            "Conceptual tree root has to be a container, not %s", schemaNode);
        return ROOT_CONTAINER;
    }

    final PathArgument arg = path.getLastPathArgument();
    if (schemaNode instanceof ContainerSchemaNode) {
        Preconditions.checkArgument(arg instanceof NodeIdentifier, "Mismatched container %s path %s", schemaNode,
            path);
        return ImmutableContainerNodeBuilder.create().withNodeIdentifier((NodeIdentifier) arg).build();
    } else if (schemaNode instanceof ListSchemaNode) {
        // This can either be a top-level list or its individual entry
        if (arg instanceof NodeIdentifierWithPredicates) {
            return ImmutableNodes.mapEntryBuilder().withNodeIdentifier((NodeIdentifierWithPredicates) arg).build();
        }
        Preconditions.checkArgument(arg instanceof NodeIdentifier, "Mismatched list %s path %s", schemaNode, path);
        return ImmutableNodes.mapNodeBuilder().withNodeIdentifier((NodeIdentifier) arg).build();
    } else {
        throw new IllegalArgumentException("Unsupported root schema " + schemaNode);
    }
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:25,代码来源:InMemoryDataTreeFactory.java


示例8: from

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


示例9: fromDataSchemaNode

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


示例10: createContributorListEntry

import org.opendaylight.yangtools.yang.model.api.ListSchemaNode; //导入依赖的package包/类
private static MapEntryNode createContributorListEntry(
        final String loginVal, final String contributorNameVal,
        final String odlProjectNameVal, final String odlProjectDescVal,
        final ListSchemaNode contributorListSchemaNode) {

    final LeafNode<String> loginLeaf = ImmutableNodes.leafNode(login,
            loginVal);
    final LeafNode<String> contributorNameLeaf = ImmutableNodes.leafNode(
            contributorName, contributorNameVal);
    final LeafNode<String> odlProjectNameLeafRef = ImmutableNodes.leafNode(
            odlProjectName, odlProjectNameVal);
    final LeafNode<String> odlProjectDescLeafRef = ImmutableNodes.leafNode(
            odlProjectDesc, odlProjectDescVal);

    return Builders.mapEntryBuilder(contributorListSchemaNode)
            .addChild(loginLeaf)
            .addChild(contributorNameLeaf)
            .addChild(odlProjectNameLeafRef)
            .addChild(odlProjectDescLeafRef)
            .build();
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:22,代码来源:DataTreeCandidateValidatorTest.java


示例11: createOdlContainer

import org.opendaylight.yangtools.yang.model.api.ListSchemaNode; //导入依赖的package包/类
private static ContainerNode createOdlContainer(
        final ContainerSchemaNode container) {

    final ListSchemaNode projListSchemaNode = (ListSchemaNode) container
            .getDataChildByName(project);

    final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> odlProjectContainerBldr = Builders
            .containerBuilder(container);

    final MapNode projectMap = createProjectList(projListSchemaNode);
    odlProjectContainerBldr.addChild(projectMap);

    final ContainerNode odlProjectContainer = odlProjectContainerBldr
            .build();

    return odlProjectContainer;
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:18,代码来源:DataTreeCandidateValidatorTest.java


示例12: createProjectList

import org.opendaylight.yangtools.yang.model.api.ListSchemaNode; //导入依赖的package包/类
private static MapNode createProjectList(
        final ListSchemaNode projListSchemaNode) {

    final CollectionNodeBuilder<MapEntryNode, MapNode> projectMapBldr = Builders
            .mapBuilder(projListSchemaNode);

    final MapEntryNode projMapEntry1 = createProjectListEntry("Yangtools",
            "Yangtools description ...", "Leader of Yangtools",
            "Owner of Yangtools", projListSchemaNode);
    final MapEntryNode projMapEntry2 = createProjectListEntry("MD-SAL",
            "MD-SAL description ...", "Leader of MD-SAL",
            "Owner of MD-SAL", projListSchemaNode);
    final MapEntryNode projMapEntry3 = createProjectListEntry("Controller",
            "Controller description ...", "Leader of Controller",
            "Owner of Controller", projListSchemaNode);

    projectMapBldr.addChild(projMapEntry1);
    projectMapBldr.addChild(projMapEntry2);
    projectMapBldr.addChild(projMapEntry3);

    final MapNode projectMap = projectMapBldr.build();

    return projectMap;
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:25,代码来源:DataTreeCandidateValidatorTest.java


示例13: createProjectListEntry

import org.opendaylight.yangtools.yang.model.api.ListSchemaNode; //导入依赖的package包/类
private static MapEntryNode createProjectListEntry(final String nameVal,
        final String descVal, final String leadVal, final String ownerVal,
        final ListSchemaNode projListSchemaNode) {

    final LeafNode<String> nameLeaf = ImmutableNodes
            .leafNode(name, nameVal);
    final LeafNode<String> descLeaf = ImmutableNodes
            .leafNode(desc, descVal);
    final LeafNode<String> leadLeafRef = ImmutableNodes.leafNode(lead,
            leadVal);
    final LeafNode<String> ownerLeafRef = ImmutableNodes.leafNode(owner,
            ownerVal);

    final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> projMapEntryBldr = Builders
            .mapEntryBuilder(projListSchemaNode);

    projMapEntryBldr.addChild(nameLeaf);
    projMapEntryBldr.addChild(descLeaf);
    projMapEntryBldr.addChild(leadLeafRef);
    projMapEntryBldr.addChild(ownerLeafRef);
    final MapEntryNode projMapEntry = projMapEntryBldr.build();

    return projMapEntry;
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:25,代码来源:DataTreeCandidateValidatorTest.java


示例14: createBasicContributorList

import org.opendaylight.yangtools.yang.model.api.ListSchemaNode; //导入依赖的package包/类
private static MapNode createBasicContributorList(
        final ListSchemaNode contributorListSchemaNode) {

    final CollectionNodeBuilder<MapEntryNode, MapNode> contributorMapBldr = Builders
            .mapBuilder(contributorListSchemaNode);

    final MapEntryNode contributorMapEntry1 = createContributorListEntry(
            "Leader of Yangtools", "Yangtools Leader name", "Yangtools",
            "Yangtools description ...", contributorListSchemaNode);
    final MapEntryNode contributorMapEntry2 = createContributorListEntry(
            "Leader of MD-SAL", "MD-SAL Leader name", "MD-SAL",
            "MD-SAL description ...", contributorListSchemaNode);
    final MapEntryNode contributorMapEntry3 = createContributorListEntry(
            "Leader of Controller", "Controller Leader name", "Controller",
            "Controller description ...", contributorListSchemaNode);

    contributorMapBldr.addChild(contributorMapEntry1);
    contributorMapBldr.addChild(contributorMapEntry2);
    contributorMapBldr.addChild(contributorMapEntry3);

    final MapNode contributorMap = contributorMapBldr.build();

    return contributorMap;
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:25,代码来源:DataTreeCandidateValidatorTest.java


示例15: createDevTypeListEntry

import org.opendaylight.yangtools.yang.model.api.ListSchemaNode; //导入依赖的package包/类
private static MapEntryNode createDevTypeListEntry(final String type1Val, final String type2Val,
        final String type3Val, final String descVal, final ListSchemaNode devTypeListSchemaNode) {

    final LeafNode<String> type1Leaf = ImmutableNodes.leafNode(type1, type1Val);
    final LeafNode<String> type2Leaf = ImmutableNodes.leafNode(type2, type2Val);
    final LeafNode<String> type3Leaf = ImmutableNodes.leafNode(type3, type3Val);
    final LeafNode<String> descLeaf = ImmutableNodes.leafNode(desc, descVal);

    final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> devTypeMapEntryBldr = Builders
            .mapEntryBuilder(devTypeListSchemaNode);

    devTypeMapEntryBldr.addChild(type1Leaf);
    devTypeMapEntryBldr.addChild(type2Leaf);
    devTypeMapEntryBldr.addChild(type3Leaf);
    devTypeMapEntryBldr.addChild(descLeaf);

    return devTypeMapEntryBldr.build();
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:19,代码来源:DataTreeCandidateValidatorTest3.java


示例16: createDeviceListEntry

import org.opendaylight.yangtools.yang.model.api.ListSchemaNode; //导入依赖的package包/类
private static MapEntryNode createDeviceListEntry(final String type1TextVal, final String type2TextVal,
        final String type3TextVal, final String descVal, final int snVal, final String defaultIpVal,
        final ListSchemaNode devicesListSchemaNode) {

    final LeafNode<String> typeText1Leaf = ImmutableNodes.leafNode(typeText1, type1TextVal);
    final LeafNode<String> typeText2Leaf = ImmutableNodes.leafNode(typeText2, type2TextVal);
    final LeafNode<String> typeText3Leaf = ImmutableNodes.leafNode(typeText3, type3TextVal);
    final LeafNode<String> descLeaf = ImmutableNodes.leafNode(devDesc, descVal);
    final LeafNode<Integer> snValLeaf = ImmutableNodes.leafNode(sn, snVal);
    final LeafNode<String> defaultIpLeaf = ImmutableNodes.leafNode(defaultIp, defaultIpVal);

    final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> devicesMapEntryBldr = Builders
            .mapEntryBuilder(devicesListSchemaNode);

    devicesMapEntryBldr.addChild(typeText1Leaf);
    devicesMapEntryBldr.addChild(typeText2Leaf);
    devicesMapEntryBldr.addChild(typeText3Leaf);
    devicesMapEntryBldr.addChild(descLeaf);
    devicesMapEntryBldr.addChild(snValLeaf);
    devicesMapEntryBldr.addChild(defaultIpLeaf);

    return devicesMapEntryBldr.build();
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:24,代码来源:DataTreeCandidateValidatorTest3.java


示例17: createDeviceList

import org.opendaylight.yangtools.yang.model.api.ListSchemaNode; //导入依赖的package包/类
private static MapNode createDeviceList(final ListSchemaNode deviceListSchemaNode) {

        final CollectionNodeBuilder<MapEntryNode, MapNode> devicesMapBldr = Builders.mapBuilder(deviceListSchemaNode);

        devicesMapBldr.addChild(createDeviceListEntry("dev_type_1", "typedesc1", 123456, "192.168.0.1",
                deviceListSchemaNode));
        devicesMapBldr.addChild(createDeviceListEntry("dev_type_2", "typedesc2", 123457, "192.168.0.1",
                deviceListSchemaNode));
        devicesMapBldr.addChild(createDeviceListEntry("dev_type_2", "typedesc3", 123457, "192.168.0.1",
                deviceListSchemaNode));
        devicesMapBldr.addChild(createDeviceListEntry("dev_type_1", "typedesc2", 123458, "192.168.0.1",
                deviceListSchemaNode));
        devicesMapBldr
                .addChild(createDeviceListEntry("unknown", "unknown", 123457, "192.168.0.1", deviceListSchemaNode));

        return devicesMapBldr.build();
    }
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:18,代码来源:DataTreeCandidateValidatorTest2.java


示例18: createDeviceListEntry

import org.opendaylight.yangtools.yang.model.api.ListSchemaNode; //导入依赖的package包/类
private static MapEntryNode createDeviceListEntry(final String typeTextVal, final String descVal, final int snVal,
        final String defaultIpVal, final ListSchemaNode devicesListSchemaNode) {

    final LeafNode<String> typeTextLeaf = ImmutableNodes.leafNode(typeText, typeTextVal);
    final LeafNode<String> descLeaf = ImmutableNodes.leafNode(devDesc, descVal);
    final LeafNode<Integer> snValLeaf = ImmutableNodes.leafNode(sn, snVal);
    final LeafNode<String> defaultIpLeaf = ImmutableNodes.leafNode(defaultIp, defaultIpVal);

    final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> devicesMapEntryBldr = Builders
            .mapEntryBuilder(devicesListSchemaNode);

    devicesMapEntryBldr.addChild(typeTextLeaf);
    devicesMapEntryBldr.addChild(descLeaf);
    devicesMapEntryBldr.addChild(snValLeaf);
    devicesMapEntryBldr.addChild(defaultIpLeaf);

    return devicesMapEntryBldr.build();
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:19,代码来源:DataTreeCandidateValidatorTest2.java


示例19: testListAsRootElement

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

    final InputStream resourceAsStream = XmlToNormalizedNodesTest.class.getResourceAsStream("/bug8675/foo-3.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, topLevelList);
    xmlParser.parse(reader);

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


示例20: caseShortHandAugmentingTest

import org.opendaylight.yangtools.yang.model.api.ListSchemaNode; //导入依赖的package包/类
@Test
public void caseShortHandAugmentingTest() throws Exception {
    final SchemaContext context = StmtTestUtils.parseYangSources("/choice-case-type-test-models");

    assertNotNull(context);

    final String rev = "2013-07-01";
    final String ns = "urn:ietf:params:xml:ns:yang:choice-monitoring";
    final String nsAug = "urn:ietf:params:xml:ns:yang:augment-monitoring";

    final ContainerSchemaNode netconf = (ContainerSchemaNode) context.getDataChildByName(QName.create(ns, rev,
            "netconf-state"));
    final ContainerSchemaNode datastores = (ContainerSchemaNode) netconf.getDataChildByName(QName.create(ns, rev,
            "datastores"));
    final ListSchemaNode datastore = (ListSchemaNode) datastores.getDataChildByName(QName.create(ns, rev,
            "datastore"));
    final ContainerSchemaNode locks = (ContainerSchemaNode) datastore.getDataChildByName(QName.create(ns, rev,
            "locks"));
    final ChoiceSchemaNode lockType = (ChoiceSchemaNode) locks.getDataChildByName(QName
            .create(ns, rev, "lock-type"));

    final CaseSchemaNode leafAugCase = lockType.findCaseNodes("leaf-aug-case").iterator().next();
    assertTrue(leafAugCase.isAugmenting());
    final DataSchemaNode leafAug = leafAugCase.getDataChildByName(QName.create(nsAug, rev, "leaf-aug-case"));
    assertFalse(leafAug.isAugmenting());
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:27,代码来源:AugmentProcessTest.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java XIncludeAwareParserConfiguration类代码示例发布时间:2022-05-23
下一篇:
Java ComponentObject类代码示例发布时间: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