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


Java FeatureDefinition类代码示例

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


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

示例1: emitBodyNodes

import org.opendaylight.yangtools.yang.model.api.FeatureDefinition; //导入依赖的package包/类
private void emitBodyNodes(final Module input) {

            for (final ExtensionDefinition extension : input.getExtensionSchemaNodes()) {
                emitExtension(extension);
            }
            for (final FeatureDefinition definition : input.getFeatures()) {
                emitFeature(definition);
            }
            for (final IdentitySchemaNode identity : input.getIdentities()) {
                emitIdentity(identity);
            }
            for (final Deviation deviation : input.getDeviations()) {
                emitDeviation(deviation);
            }

            emitDataNodeContainer(input);

            for (final AugmentationSchemaNode augmentation : input.getAugmentations()) {
                emitAugment(augmentation);
            }
            for (final RpcDefinition rpc : input.getRpcs()) {
                emitRpc(rpc);
            }

            emitNotifications(input.getNotifications());
        }
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:27,代码来源:SchemaContextEmitter.java

示例2: testFeature

import org.opendaylight.yangtools.yang.model.api.FeatureDefinition; //导入依赖的package包/类
@Test
public void testFeature() {
    Module testModule = TestUtils.findModule(context, "yang-with-features").get();
    assertNotNull(testModule);

    Set<FeatureDefinition> features = testModule.getFeatures();
    assertEquals(2, features.size());

    Iterator<FeatureDefinition> featuresIterator = features.iterator();
    FeatureDefinition feature = featuresIterator.next();

    assertThat(feature.getQName().getLocalName(), anyOf(is("arbitrary-names"), is("pre-provisioning")));

    feature = featuresIterator.next();

    assertThat(feature.getQName().getLocalName(), anyOf(is("arbitrary-names"), is("pre-provisioning")));
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:18,代码来源:YinFileFeatureStmtTest.java

示例3: emitFeature

import org.opendaylight.yangtools.yang.model.api.FeatureDefinition; //导入依赖的package包/类
private void emitFeature(final FeatureDefinition definition) {
    super.writer.startFeatureNode(definition.getQName());

    // FIXME: BUG-2444: FIXME: BUG-2444: Expose ifFeature
    // *(ifFeatureNode )
    emitDocumentedNode(definition);
    super.writer.endNode();
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:9,代码来源:SchemaContextEmitter.java

示例4: includedFeaturesTest

import org.opendaylight.yangtools.yang.model.api.FeatureDefinition; //导入依赖的package包/类
@Test
public void includedFeaturesTest() {
    final Module testModule = result.findModules("root-module").iterator().next();
    assertNotNull(testModule);

    final Set<FeatureDefinition> features = testModule.getFeatures();
    assertEquals(2, features.size());

    final Iterator<FeatureDefinition> featuresIterator = features.iterator();
    FeatureDefinition feature = featuresIterator.next();
    assertThat(feature.getQName().getLocalName(), anyOf(is("new-feature1"), is("new-feature2")));
    feature = featuresIterator.next();
    assertThat(feature.getQName().getLocalName(), anyOf(is("new-feature1"), is("new-feature2")));
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:15,代码来源:IncludedStmtsTest.java

示例5: getFeatures

import org.opendaylight.yangtools.yang.model.api.FeatureDefinition; //导入依赖的package包/类
@Override
public Set<FeatureDefinition> getFeatures() {
    return features;
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:5,代码来源:AbstractEffectiveModule.java

示例6: effectiveBuildTest

import org.opendaylight.yangtools.yang.model.api.FeatureDefinition; //导入依赖的package包/类
@Test
public void effectiveBuildTest() throws SourceException, ReactorException {
    SchemaContext result = RFC7950Reactors.defaultReactor().newBuild()
            .addSources(ROOT_MODULE, IMPORTED_MODULE, SUBMODULE)
            .buildEffective();

    assertNotNull(result);

    Module rootModule = result.findModules("root").iterator().next();
    assertNotNull(rootModule);

    assertEquals("root-pref", rootModule.getPrefix());
    assertEquals(YangVersion.VERSION_1, rootModule.getYangVersion());
    assertEquals(Optional.of("cisco"), rootModule.getOrganization());
    assertEquals(Optional.of("cisco email"), rootModule.getContact());

    final ContainerSchemaNode contSchemaNode = (ContainerSchemaNode) rootModule.getDataChildByName(CONT);
    assertNotNull(contSchemaNode);

    final Set<AugmentationSchemaNode> augmentations = rootModule.getAugmentations();
    assertEquals(1, augmentations.size());
    assertEquals(CONT_SCHEMA_PATH, augmentations.iterator().next().getTargetPath());

    final Set<ModuleImport> imports = rootModule.getImports();
    assertEquals(1, imports.size());
    final ModuleImport importStmt = imports.iterator().next();
    assertNotNull(importStmt);
    assertEquals("imported", importStmt.getModuleName());
    assertEquals(Optional.of(REVISION), importStmt.getRevision());
    assertEquals("imp-pref", importStmt.getPrefix());

    final Set<Module> submodules = rootModule.getSubmodules();
    assertEquals(1, submodules.size());
    assertEquals("submod", submodules.iterator().next().getName());

    final Set<NotificationDefinition> notifications = rootModule.getNotifications();
    assertEquals(1, notifications.size());
    assertEquals("notif1", notifications.iterator().next().getQName().getLocalName());

    final Set<RpcDefinition> rpcs = rootModule.getRpcs();
    assertEquals(1, rpcs.size());
    assertEquals("rpc1", rpcs.iterator().next().getQName().getLocalName());

    final Set<Deviation> deviations = rootModule.getDeviations();
    assertEquals(1, deviations.size());
    final Deviation deviationStmt = deviations.iterator().next();
    assertNotNull(deviationStmt);
    final QNameModule importedModuleQName = QNameModule.create(URI.create("imported"), REVISION);
    final QName importedContQName = QName.create(importedModuleQName, "cont");
    final SchemaPath importedContSchemaPath = SchemaPath.create(true, importedContQName);
    assertEquals(importedContSchemaPath, deviationStmt.getTargetPath());
    assertEquals(DeviateKind.ADD, deviationStmt.getDeviates().iterator().next().getDeviateType());
    assertEquals(Optional.of("deviate reference"), deviationStmt.getReference());

    final Set<IdentitySchemaNode> identities = rootModule.getIdentities();
    assertEquals(1, identities.size());
    assertEquals("identity1", identities.iterator().next().getQName().getLocalName());

    final Set<FeatureDefinition> features = rootModule.getFeatures();
    assertEquals(1, features.size());
    final FeatureDefinition featureStmt = features.iterator().next();
    assertNotNull(featureStmt);
    assertEquals(FEATURE1, featureStmt.getQName());
    assertEquals(FEATURE1_SCHEMA_PATH, featureStmt.getPath());
    assertEquals(Optional.of("feature1 description"), featureStmt.getDescription());
    assertEquals(Optional.of("feature1 reference"), featureStmt.getReference());
    assertEquals(Status.CURRENT, featureStmt.getStatus());

    final List<ExtensionDefinition> extensionSchemaNodes = rootModule.getExtensionSchemaNodes();
    assertEquals(1, extensionSchemaNodes.size());
    assertEquals("ext1", extensionSchemaNodes.iterator().next().getQName().getLocalName());
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:73,代码来源:EffectiveModuleTest.java

示例7: testFeature

import org.opendaylight.yangtools.yang.model.api.FeatureDefinition; //导入依赖的package包/类
@Test
public void testFeature() {
    final Set<FeatureDefinition> features = baz.getFeatures();
    assertEquals(1, features.size());
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:6,代码来源:YangParserTest.java


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