Promote BaseQNameStatementSupport
[yangtools.git] / yang / yang-parser-spi / src / main / java / org / opendaylight / yangtools / yang / parser / spi / meta / AbstractQNameStatementSupport.java
index 74b8e75f40cb347e113c219c460604b80aba376b..1de79efc36395c5e7cd65fbbe6bd43be64ab10df 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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,
@@ -15,24 +15,26 @@ import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 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,
+            final StatementPolicy<QName, D> policy) {
+        super(publicDefinition, policy);
+    }
 
-    protected AbstractQNameStatementSupport(final StatementDefinition publicDefinition) {
-        super(publicDefinition);
+    @Deprecated
+    protected AbstractQNameStatementSupport(final StatementDefinition publicDefinition, final CopyPolicy copyPolicy) {
+        super(publicDefinition, copyPolicy);
     }
 
     @Override
     public QName adaptArgumentValue(final StmtContext<QName, D, E> ctx, final QNameModule targetModule) {
-        return ctx.getFromNamespace(QNameCacheNamespace.class, ctx.getStatementArgument().withModule(targetModule));
+        return ctx.getArgument().bindTo(targetModule).intern();
     }
 }