/*
- * Copyright (c) 2017 Pantheon Technologies, s.r.o. and others. All rights reserved.
+ * Copyright (c) 2020 PANTHEON.tech, s.r.o. 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,
import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
/**
- * Class providing necessary support for processing a YANG statements which has a {@link QName} argument. In addition
- * to functions of {@link AbstractStatementSupport}, it takes care of adapting QNames across modules.
+ * Specialization of {@link AbstractStatementSupport} for QName statement arguments.
*
- * @param <D>
- * Declared Statement representation
- * @param <E>
- * Effective Statement representation
+ * @param <D> Declared Statement representation
+ * @param <E> Effective Statement representation
*/
@Beta
public abstract class AbstractQNameStatementSupport<D extends DeclaredStatement<QName>,
E extends EffectiveStatement<QName, D>> extends AbstractStatementSupport<QName, D, E> {
-
- protected AbstractQNameStatementSupport(final StatementDefinition publicDefinition) {
- super(publicDefinition);
+ protected AbstractQNameStatementSupport(final StatementDefinition publicDefinition,
+ final StatementPolicy<QName, D> policy) {
+ super(publicDefinition, policy);
}
@Override
public QName adaptArgumentValue(final StmtContext<QName, D, E> ctx, final QNameModule targetModule) {
- return ctx.getFromNamespace(QNameCacheNamespace.class,
- QName.create(targetModule, ctx.getStatementArgument().getLocalName()));
+ return ctx.getArgument().bindTo(targetModule).intern();
}
}