當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。