Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasFey-GIP committed Dec 11, 2024
1 parent ec97fed commit 3f05c63
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion modules/xdev/yang/application.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
--><Application applicationName="YangAppGenerator" comment="" factoryVersion="" versionName="0.1.8" xmlVersion="1.1">
--><Application applicationName="YangAppGenerator" comment="" factoryVersion="" versionName="0.1.9" xmlVersion="1.1">
<ApplicationInfo>
<RuntimeContextRequirements>
<RuntimeContextRequirement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,17 +176,17 @@ private void createMappingImpl(StringBuilder result, UseCaseMapping mapping, Imp
String loopVareName = dynListConfig.getVariable();
String loopVarPath = determineMappingValueBase(dynListConfig.getPath());
String counterVarName = String.format("i_%d", data.nextVariable++);
result.append("List<?> ").append(loopVareName).append("_list = (List<?>)").append(loopVarPath).append(";\n");
result.append("for (int ").append(counterVarName).append(" = 0; ").append(counterVarName).append(" < ");
result.append(loopVareName).append("_list.size(); ").append(counterVarName).append("++) {\n");
result.append("Object ").append(loopVareName).append(" = ").append(loopVareName).append("_list.get(").append(counterVarName).append(");\n");
result.append("List<?> ").append(loopVareName).append("_list = (List<?>)").append(loopVarPath).append(";\n")
.append("for (int ").append(counterVarName).append(" = 0; ").append(counterVarName).append(" < ")
.append(loopVareName).append("_list.size(); ").append(counterVarName).append("++) {\n")
.append("Object ").append(loopVareName).append(" = ").append(loopVareName).append("_list.get(").append(counterVarName).append(");\n");
position.add(mappingList.get(i)); // dynamic lists are hidden, but we need to keep track of opened lists anyway
} else if(Constants.TYPE_LIST.equals(mappingList.get(i).getKeyword())) {
position.add(mappingList.get(i)); //static complex list
}
if(!hiddenYangKeywords.contains(mappingList.get(i).getKeyword())) {
result.append("builder.startElementWithAttributes(\"").append(tag).append("\");\n");
result.append("builder.addAttribute(\"xmlns\", \"").append(mappingList.get(i).getNamespace()).append("\");\n");
result.append("builder.startElementWithAttributes(\"").append(tag).append("\");\n")
.append("builder.addAttribute(\"xmlns\", \"").append(mappingList.get(i).getNamespace()).append("\");\n");
if (i != mappingList.size() - 1) { //do not close the final tag, because we want to set the value
result.append("builder.endAttributes();\n");
position.add(mappingList.get(i)); //we close the final tag. As a result, we do not need to add that position
Expand Down

0 comments on commit 3f05c63

Please sign in to comment.