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

Java LeafListSchemaNode类代码示例

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

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



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

示例1: createInnerAttribute

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

import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode; //导入依赖的package包/类
private void emitLeafList(final LeafListSchemaNode child) {
    super.writer.startLeafListNode(child.getQName());

    child.getWhenCondition().ifPresent(this::emitWhen);
    // FIXME: BUG-2444: *(ifFeatureNode )
    emitTypeNode(child.getPath(), child.getType());
    child.getType().getUnits().ifPresent(this::emitUnitsNode);
    // FIXME: BUG-2444: unitsNode /Optional
    child.getMustConstraints().forEach(this::emitMust);
    emitConfigNode(child.isConfiguration());
    emitDefaultNodes(child.getDefaults());
    child.getElementCountConstraint().ifPresent(this::emitCountConstraint);
    emitOrderedBy(child.isUserOrdered());
    emitDocumentedNode(child);
    emitUnknownStatementNodes(child.getUnknownSchemaNodes());
    super.writer.endNode();
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:18,代码来源:SchemaContextEmitter.java


示例6: emitRefine

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

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


示例8: fromDataSchemaNode

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


示例9: testLeafListAsRootElement

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

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

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


示例10: testDeviateReplaceOfImplicitSubstatements

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


示例11: fromDataSchemaNode

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

import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode; //导入依赖的package包/类
AbstractNodeDataWithSchema addCompositeChild(final DataSchemaNode schema) {
    final CompositeNodeDataWithSchema newChild;

    if (schema instanceof ListSchemaNode) {
        newChild = new ListNodeDataWithSchema(schema);
    } else if (schema instanceof LeafListSchemaNode) {
        newChild = new LeafListNodeDataWithSchema(schema);
    } else if (schema instanceof ContainerSchemaNode) {
        newChild = new ContainerNodeDataWithSchema(schema);
    } else if (schema instanceof YangModeledAnyXmlSchemaNode) {
        newChild = new YangModeledAnyXmlNodeDataWithSchema((YangModeledAnyXmlSchemaNode)schema);
    } else {
        newChild = new CompositeNodeDataWithSchema(schema);
    }

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


示例13: addSchemaNodeToBuilderAsMethod

import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode; //导入依赖的package包/类
private void addSchemaNodeToBuilderAsMethod(final String basePackageName, final DataSchemaNode schemaNode,
        final GeneratedTypeBuilder typeBuilder) {
    if (schemaNode != null && typeBuilder != null) {
        if (schemaNode instanceof LeafSchemaNode) {
            resolveLeafSchemaNodeAsMethod(typeBuilder, (LeafSchemaNode) schemaNode);
        } else if (schemaNode instanceof LeafListSchemaNode) {
            resolveLeafListSchemaNode(typeBuilder, (LeafListSchemaNode) schemaNode);
        } else if (schemaNode instanceof ContainerSchemaNode) {
            resolveContainerSchemaNode(basePackageName, typeBuilder, (ContainerSchemaNode) schemaNode);
        } else if (schemaNode instanceof ListSchemaNode) {
            resolveListSchemaNode(basePackageName, typeBuilder, (ListSchemaNode) schemaNode);
        } else if (schemaNode instanceof ChoiceNode) {
            resolveChoiceSchemaNode(basePackageName, typeBuilder, (ChoiceNode) schemaNode);
        }
    }
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:17,代码来源:BindingGeneratorImpl.java


示例14: resolveLeafListSchemaNode

import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode; //导入依赖的package包/类
private boolean resolveLeafListSchemaNode(final GeneratedTypeBuilder typeBuilder, final LeafListSchemaNode node) {
    if ((node != null) && (typeBuilder != null)) {
        final String nodeName = node.getQName().getLocalName();
        String nodeDesc = node.getDescription();
        if (nodeDesc == null) {
            nodeDesc = "";
        }

        if (nodeName != null && !node.isAddedByUses()) {
            final TypeDefinition<?> type = node.getType();
            final Type listType = Types.listTypeFor(typeProvider.javaTypeForSchemaDefinitionType(type));

            constructGetter(typeBuilder, nodeName, nodeDesc, listType);
            return true;
        }
    }
    return false;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:19,代码来源:BindingGeneratorImpl.java


示例15: addSchemaNodeToListBuilders

import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode; //导入依赖的package包/类
private void addSchemaNodeToListBuilders(final String basePackageName, final DataSchemaNode schemaNode,
        final GeneratedTypeBuilder typeBuilder, final GeneratedTOBuilder genTOBuilder, final List<String> listKeys) {
    if (schemaNode == null) {
        throw new IllegalArgumentException("Data Schema Node cannot be NULL!");
    }

    if (typeBuilder == null) {
        throw new IllegalArgumentException("Generated Type Builder cannot be NULL!");
    }

    if (schemaNode instanceof LeafSchemaNode) {
        final LeafSchemaNode leaf = (LeafSchemaNode) schemaNode;
        if (!isPartOfListKey(leaf, listKeys)) {
            resolveLeafSchemaNodeAsMethod(typeBuilder, leaf);
        } else {
            resolveLeafSchemaNodeAsProperty(genTOBuilder, leaf, true);
        }
    } else if (schemaNode instanceof LeafListSchemaNode) {
        resolveLeafListSchemaNode(typeBuilder, (LeafListSchemaNode) schemaNode);
    } else if (schemaNode instanceof ContainerSchemaNode) {
        resolveContainerSchemaNode(basePackageName, typeBuilder, (ContainerSchemaNode) schemaNode);
    } else if (schemaNode instanceof ListSchemaNode) {
        resolveListSchemaNode(basePackageName, typeBuilder, (ListSchemaNode) schemaNode);
    }
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:26,代码来源:BindingGeneratorImpl.java


示例16: JavaAttribute

import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode; //导入依赖的package包/类
public JavaAttribute(final LeafListSchemaNode leaf,
        final TypeProviderWrapper typeProviderWrapper) {
    super(leaf);
    this.type = typeProviderWrapper.getType(leaf);
    this.typeDefinition = leaf.getType();
    this.typeProviderWrapper = typeProviderWrapper;
    this.nullableDefault = this.nullableDefaultWrappedForCode = null;
    this.nullableDescription = leaf.getDescription();
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:10,代码来源:JavaAttribute.java


示例17: getType

import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode; //导入依赖的package包/类
public Type getType(final LeafListSchemaNode leaf) {
    Type javaType;
    try {
        javaType = this.typeProvider.javaTypeForSchemaDefinitionType(
                leaf.getType(), leaf);
        if (javaType == null) {
            throw new IllegalArgumentException(
                    "Unknown type received for  " + leaf.toString());
        }
    } catch (final IllegalArgumentException e) {
        throw new IllegalArgumentException("Error while resolving type of "
                + leaf, e);
    }
    return javaType;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:16,代码来源:TypeProviderWrapper.java


示例18: leafSetEntryNode

import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode; //导入依赖的package包/类
@Override
public final void leafSetEntryNode(final QName name, final Object value) throws IOException {
    final LeafListSchemaNode schema = tracker.leafSetEntryNode(name);
    final JSONCodec<?> codec = codecs.codecFor(schema);
    context.emittingChild(codecs.getSchemaContext(), writer);
    writeValue(value, codec);
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:8,代码来源:JSONNormalizedNodeStreamWriter.java


示例19: emitRefineLeafListNodes

import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode; //导入依赖的package包/类
private void emitRefineLeafListNodes(final LeafListSchemaNode value) {
    final LeafListSchemaNode original = getOriginalChecked(value);

    // emitMustNodes(child.getConstraints().getMustConstraints());
    if (Objects.deepEquals(original.isConfiguration(), value.isConfiguration())) {
        emitConfigNode(value.isConfiguration());
    }

    emitRefinedMinMaxNodes(value.getElementCountConstraint(), original.getElementCountConstraint());
    emitDocumentedNodeRefine(original, value);

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


示例20: startLeafSet

import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode; //导入依赖的package包/类
public LeafListSchemaNode startLeafSet(final NodeIdentifier name) {
    final SchemaNode schema = getSchema(name);

    checkArgument(schema instanceof LeafListSchemaNode, "Node %s is not a leaf-list", schema.getPath());
    schemaStack.push(schema);
    return (LeafListSchemaNode)schema;
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:8,代码来源:SchemaTracker.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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