Promote BaseStatementSupport to parser.spi.meta
[yangtools.git] / yang / odlext-parser-support / src / main / java / org / opendaylight / yangtools / odlext / parser / AnyxmlSchemaLocationStatementSupport.java
index a0d73752236a80d08333aab9e390c18b96f4e2b2..40d6bce0435327741e955e73be001fc49dab192f 100644 (file)
@@ -17,13 +17,14 @@ import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier;
 import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.ArgumentUtils;
-import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.BaseStatementSupport;
+import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
+import org.opendaylight.yangtools.yang.parser.spi.meta.EffectiveStmtCtx.Current;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext.Mutable;
 import org.opendaylight.yangtools.yang.parser.spi.meta.SubstatementValidator;
 
 public final class AnyxmlSchemaLocationStatementSupport
-        extends BaseStatementSupport<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement,
+        extends AbstractStatementSupport<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement,
             AnyxmlSchemaLocationEffectiveStatement> {
     private static final AnyxmlSchemaLocationStatementSupport INSTANCE =
             new AnyxmlSchemaLocationStatementSupport(ANYXML_SCHEMA_LOCATION);
@@ -31,7 +32,7 @@ public final class AnyxmlSchemaLocationStatementSupport
     private final SubstatementValidator validator;
 
     private AnyxmlSchemaLocationStatementSupport(final StatementDefinition definition) {
-        super(definition);
+        super(definition, CopyPolicy.DECLARED_COPY);
         validator = SubstatementValidator.builder(definition).build();
     }
 
@@ -60,7 +61,7 @@ public final class AnyxmlSchemaLocationStatementSupport
     protected AnyxmlSchemaLocationStatement createDeclared(
             final StmtContext<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement, ?> ctx,
             final ImmutableList<? extends DeclaredStatement<?>> substatements) {
-        return new AnyxmlSchemaLocationStatementImpl(ctx, substatements);
+        return new AnyxmlSchemaLocationStatementImpl(ctx.getRawArgument(), ctx.getArgument(), substatements);
     }
 
     @Override
@@ -71,16 +72,8 @@ public final class AnyxmlSchemaLocationStatementSupport
 
     @Override
     protected AnyxmlSchemaLocationEffectiveStatement createEffective(
-            final StmtContext<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement,
-                AnyxmlSchemaLocationEffectiveStatement> ctx, final AnyxmlSchemaLocationStatement declared,
+            final Current<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement> stmt,
             final ImmutableList<? extends EffectiveStatement<?, ?>> substatements) {
-        return new AnyxmlSchemaLocationEffectiveStatementImpl(ctx, substatements);
-    }
-
-    @Override
-    protected AnyxmlSchemaLocationEffectiveStatement createEmptyEffective(
-            final StmtContext<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement,
-                AnyxmlSchemaLocationEffectiveStatement> ctx, final AnyxmlSchemaLocationStatement declared) {
-        return createEffective(ctx, declared, ImmutableList.of());
+        return new AnyxmlSchemaLocationEffectiveStatementImpl(stmt, substatements);
     }
 }
\ No newline at end of file