use of org.glassfish.admin.rest.utils.ConfigModelComparator in project Payara by payara.
the class BaseProvider method getResourceLinks.
protected Map<String, String> getResourceLinks(Dom dom) {
Map<String, String> links = new TreeMap<String, String>();
Set<String> elementNames = dom.model.getElementNames();
for (String elementName : elementNames) {
// for each element
if (elementName.equals("*")) {
ConfigModel.Node node = (ConfigModel.Node) dom.model.getElement(elementName);
ConfigModel childModel = node.getModel();
List<ConfigModel> lcm = ResourceUtil.getRealChildConfigModels(childModel, dom.document);
Collections.sort(lcm, new ConfigModelComparator());
if (lcm != null) {
Collections.sort(lcm, new ConfigModelComparator());
for (ConfigModel cmodel : lcm) {
links.put(cmodel.getTagName(), ProviderUtil.getElementLink(uriInfo.get(), cmodel.getTagName()));
}
}
} else {
links.put(elementName, ProviderUtil.getElementLink(uriInfo.get(), elementName));
}
}
return links;
}
Aggregations