X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-docgen%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frest%2Fdoc%2Fimpl%2FModelGenerator.java;h=95bb1a094371db4f17d38c310c0043b07006c5c3;hp=8bac0d211e71cb2d88969c72d9b3f21a9fb00919;hb=cf1a8da1f3ee11170ce05611d85d15b1aceed8e8;hpb=44c747db358bf0d49434d5f818121286b5928d4a diff --git a/opendaylight/md-sal/sal-rest-docgen/src/main/java/org/opendaylight/controller/sal/rest/doc/impl/ModelGenerator.java b/opendaylight/md-sal/sal-rest-docgen/src/main/java/org/opendaylight/controller/sal/rest/doc/impl/ModelGenerator.java index 8bac0d211e..95bb1a0943 100644 --- a/opendaylight/md-sal/sal-rest-docgen/src/main/java/org/opendaylight/controller/sal/rest/doc/impl/ModelGenerator.java +++ b/opendaylight/md-sal/sal-rest-docgen/src/main/java/org/opendaylight/controller/sal/rest/doc/impl/ModelGenerator.java @@ -126,9 +126,8 @@ public class ModelGenerator { JSONException { String moduleName = module.getName(); - Set childNodes = module.getChildNodes(); - for (DataSchemaNode childNode : childNodes) { + for (DataSchemaNode childNode : module.getChildNodes()) { JSONObject configModuleJSON = null; JSONObject operationalModuleJSON = null; @@ -271,13 +270,12 @@ public class ModelGenerator { String containerDescription = container.getDescription(); moduleJSON.put(DESCRIPTION_KEY, containerDescription); - Set containerChildren = container.getChildNodes(); - JSONObject properties = processChildren(containerChildren, moduleName, models, isConfig); + JSONObject properties = processChildren(container.getChildNodes(), moduleName, models, isConfig); moduleJSON.put(PROPERTIES_KEY, properties); return moduleJSON; } - private JSONObject processChildren(Set nodes, String moduleName, + private JSONObject processChildren(Iterable nodes, String moduleName, JSONObject models) throws JSONException, IOException { return processChildren(nodes, moduleName, models, null); } @@ -292,7 +290,7 @@ public class ModelGenerator { * @throws JSONException * @throws IOException */ - private JSONObject processChildren(Set nodes, String moduleName, + private JSONObject processChildren(Iterable nodes, String moduleName, JSONObject models, Boolean isConfig) throws JSONException, IOException { JSONObject properties = new JSONObject(); @@ -418,11 +416,10 @@ public class ModelGenerator { private JSONObject processListSchemaNode(ListSchemaNode listNode, String moduleName, JSONObject models, Boolean isConfig) throws JSONException, IOException { - Set listChildren = listNode.getChildNodes(); String fileName = (BooleanUtils.isNotFalse(isConfig)?OperationBuilder.CONFIG:OperationBuilder.OPERATIONAL) + listNode.getQName().getLocalName(); - JSONObject childSchemaProperties = processChildren(listChildren, moduleName, models); + JSONObject childSchemaProperties = processChildren(listNode.getChildNodes(), moduleName, models); JSONObject childSchema = getSchemaTemplate(); childSchema.put(TYPE_KEY, OBJECT_TYPE); childSchema.put(PROPERTIES_KEY, childSchemaProperties);