Organize Import to conform to Checkstyle guidelines.
[netconf.git] / restconf / sal-rest-docgen / src / main / java / org / opendaylight / netconf / sal / rest / doc / impl / ModelGenerator.java
index 04b80b94ce127333f1b63ffb448eb54409a67076..fdbd7b4997120c5572fca34b79f6a4befd201ce4 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.netconf.sal.rest.doc.impl;
 
 import static org.opendaylight.netconf.sal.rest.doc.util.RestDocgenUtil.resolveNodesName;
+
 import com.google.common.base.Preconditions;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -49,7 +50,6 @@ import org.opendaylight.yangtools.yang.model.api.type.LengthConstraint;
 import org.opendaylight.yangtools.yang.model.api.type.StringTypeDefinition;
 import org.opendaylight.yangtools.yang.model.api.type.UnionTypeDefinition;
 import org.opendaylight.yangtools.yang.model.api.type.UnsignedIntegerTypeDefinition;
-import org.opendaylight.yangtools.yang.model.util.ExtendedType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -420,9 +420,7 @@ public class ModelGenerator {
     }
 
     private void processTypeDef(final TypeDefinition<?> leafTypeDef, final JSONObject property) throws JSONException {
-        if (leafTypeDef instanceof ExtendedType) {
-            processExtendedType(leafTypeDef, property);
-        } else if (leafTypeDef instanceof BinaryTypeDefinition) {
+        if (leafTypeDef instanceof BinaryTypeDefinition) {
             processBinaryType((BinaryTypeDefinition) leafTypeDef, property);
         } else if (leafTypeDef instanceof BitsTypeDefinition) {
             processBitsType((BitsTypeDefinition) leafTypeDef, property);
@@ -444,25 +442,6 @@ public class ModelGenerator {
         }
     }
 
-    private void processExtendedType(final TypeDefinition<?> leafTypeDef, final JSONObject property) throws JSONException {
-        TypeDefinition<?> leafBaseType = leafTypeDef.getBaseType();
-        if (leafBaseType instanceof ExtendedType) {
-            // recursively process an extended type until we hit a base type
-            processExtendedType(leafBaseType, property);
-        } else {
-            List<LengthConstraint> lengthConstraints = ((ExtendedType) leafTypeDef).getLengthConstraints();
-            for (LengthConstraint lengthConstraint : lengthConstraints) {
-                Number min = lengthConstraint.getMin();
-                Number max = lengthConstraint.getMax();
-                property.putOpt(MIN_LENGTH_KEY, min);
-                property.putOpt(MAX_LENGTH_KEY, max);
-            }
-            String jsonType = jsonTypeFor(leafBaseType);
-            property.putOpt(TYPE_KEY, jsonType);
-        }
-
-    }
-
     private static void processBinaryType(final BinaryTypeDefinition binaryType, final JSONObject property) throws JSONException {
         property.put(TYPE_KEY, STRING);
         JSONObject media = new JSONObject();