Revert Merge "Bug 2366: new parser - Types & TypeDefs"
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / IdentityRefSpecificationImpl.java
index 37df53b9b6b34d91061d6e24781859bcbd9fc746..bd2b1e7c0a67a5a05fdcd86f7073d5b93697edc8 100644 (file)
@@ -1,4 +1,4 @@
-/*
+/**
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -7,11 +7,6 @@
  */
 package org.opendaylight.yangtools.yang.parser.stmt.rfc6020;
 
-import com.google.common.base.Preconditions;
-import org.opendaylight.yangtools.yang.model.api.stmt.BaseStatement;
-import org.opendaylight.yangtools.yang.parser.spi.IdentityNamespace;
-import org.opendaylight.yangtools.yang.parser.spi.TypeNamespace;
-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.meta.AbstractStatementSupport;
 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractDeclaredStatement;
@@ -19,13 +14,10 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
-import org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementContextBase;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.IdentityRefSpecificationEffectiveStatementImpl;
 
-import javax.annotation.Nonnull;
-import java.util.Map;
-
-public class IdentityRefSpecificationImpl extends AbstractDeclaredStatement<String> implements TypeStatement.IdentityRefSpecification {
+public class IdentityRefSpecificationImpl extends
+        AbstractDeclaredStatement<String> implements
+        TypeStatement.IdentityRefSpecification {
 
     protected IdentityRefSpecificationImpl(
             StmtContext<String, TypeStatement.IdentityRefSpecification, ?> context) {
@@ -37,7 +29,7 @@ public class IdentityRefSpecificationImpl extends AbstractDeclaredStatement<Stri
             AbstractStatementSupport<String, TypeStatement.IdentityRefSpecification, EffectiveStatement<String, TypeStatement.IdentityRefSpecification>> {
 
         public Definition() {
-            super(Rfc6020Mapping.TYPE);
+            super(Rfc6020Mapping.BASE);
         }
 
         @Override
@@ -55,14 +47,7 @@ public class IdentityRefSpecificationImpl extends AbstractDeclaredStatement<Stri
         @Override
         public EffectiveStatement<String, TypeStatement.IdentityRefSpecification> createEffective(
                 StmtContext<String, TypeStatement.IdentityRefSpecification, EffectiveStatement<String, TypeStatement.IdentityRefSpecification>> ctx) {
-            return new IdentityRefSpecificationEffectiveStatementImpl(ctx);
-        }
-
-        @Override
-        public void onFullDefinitionDeclared(StmtContext.Mutable<String, IdentityRefSpecification, EffectiveStatement<String, IdentityRefSpecification>> stmt) throws SourceException {
-            //FIXME:
-//            StatementContextBase<?, ?, ?> stmtCtx = (StatementContextBase<?, ?, ?>) stmt.getFromNamespace(IdentityNamespace.class, Utils.qNameFromArgument(StmtContextUtils.findFirstDeclaredSubstatement(stmt, BaseStatement.class), (String) StmtContextUtils.findFirstDeclaredSubstatement(stmt, BaseStatement.class).getStatementArgument()));
-//            Preconditions.checkArgument(stmtCtx != null, "Identity '%s' doesn't exist in given scope (module, imported submodules)", stmt.getStatementArgument());
+            throw new UnsupportedOperationException();
         }
     }
 
@@ -71,10 +56,4 @@ public class IdentityRefSpecificationImpl extends AbstractDeclaredStatement<Stri
         return argument();
     }
 
-    @Nonnull
-    @Override
-    public BaseStatement getBase() {
-        return firstDeclared(BaseStatement.class);
-    }
-
 }