import org.opendaylight.yangtools.yang.parser.spi.source.ModulesDeviatedByModules;
import org.opendaylight.yangtools.yang.parser.spi.source.PrefixToModule;
import org.opendaylight.yangtools.yang.parser.spi.source.QNameToStatementDefinition;
-import org.opendaylight.yangtools.yang.parser.spi.source.StmtOrderingNamespace;
import org.opendaylight.yangtools.yang.parser.spi.source.SupportedFeaturesNamespace;
import org.opendaylight.yangtools.yang.parser.spi.validation.ValidationBundlesNamespace;
import org.opendaylight.yangtools.yang.parser.spi.validation.ValidationBundlesNamespace.ValidationBundleType;
.addSupport(FeatureStatementSupport.getInstance())
.addSupport(PositionStatementSupport.getInstance())
.addSupport(ValueStatementSupport.getInstance())
- .addSupport(StmtOrderingNamespace.BEHAVIOUR)
.build();
private static final Map<ModelProcessingPhase, StatementSupportBundle> RFC7950_BUNDLES =
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext.Mutable;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContextUtils;
import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
-import org.opendaylight.yangtools.yang.parser.spi.source.StmtOrderingNamespace;
import org.opendaylight.yangtools.yang.parser.spi.validation.ValidationBundlesNamespace;
import org.opendaylight.yangtools.yang.parser.spi.validation.ValidationBundlesNamespace.ValidationBundleType;
import org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementContextBase;
try {
copyFromSourceToTarget(augmentSourceCtx, augmentTargetCtx);
augmentTargetCtx.addEffectiveSubstatement(augmentSourceCtx);
- updateAugmentOrder(augmentSourceCtx);
} catch (final SourceException e) {
LOG.warn("Failed to add augmentation {} defined at {}",
augmentTargetCtx.getStatementSourceReference(),
}
}
- private void updateAugmentOrder(final StatementContextBase<?, ?, ?> augmentSourceCtx) {
- final Integer prev = augmentSourceCtx.getFromNamespace(StmtOrderingNamespace.class,
- YangStmtMapping.AUGMENT);
- final int currentOrder = prev == null ? 1 : prev + 1;
- augmentSourceCtx.addToNs(StmtOrderingNamespace.class, YangStmtMapping.AUGMENT, currentOrder);
- }
-
@Override
public void prerequisiteFailed(final Collection<? extends Prerequisite<?>> failed) {
/*
+++ /dev/null
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.parser.spi.source;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.yang.model.api.YangStmtMapping;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
-import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
-
-/**
- * Map of statement order.
- */
-public interface StmtOrderingNamespace extends IdentifierNamespace<YangStmtMapping, Integer> {
- NamespaceBehaviour<YangStmtMapping, Integer, @NonNull StmtOrderingNamespace> BEHAVIOUR =
- NamespaceBehaviour.global(StmtOrderingNamespace.class);
-
-}
\ No newline at end of file
assertNotNull(ModuleNameToModuleQName.BEHAVIOUR);
assertNotNull(ModulesDeviatedByModules.BEHAVIOUR);
assertNotNull(PrefixToModule.BEHAVIOUR);
- assertNotNull(StmtOrderingNamespace.BEHAVIOUR);
assertNotNull(SupportedFeaturesNamespace.BEHAVIOUR);
}
}