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


Java ListSchemaNode类代码示例

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


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


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