use of org.glassfish.admin.rest.utils.xml.XmlArray in project Payara by payara.
the class ActionReportXmlProvider method getXml.
protected XmlArray getXml(Collection c) {
XmlArray result = new XmlArray("list");
Iterator i = c.iterator();
while (i.hasNext()) {
Object item = i.next();
Object obj = getXmlObject(item);
if (!(obj instanceof XmlObject)) {
obj = new XmlObject(obj.getClass().getSimpleName(), obj);
}
result.put((XmlObject) obj);
}
return result;
}
use of org.glassfish.admin.rest.utils.xml.XmlArray in project Payara by payara.
the class ActionReportXmlProvider method processChildren.
protected XmlArray processChildren(List<MessagePart> parts) {
XmlArray array = new XmlArray("children");
for (MessagePart part : parts) {
XmlMap object = new XmlMap("part");
object.put("message", part.getMessage());
object.put("properties", new XmlMap("properties", part.getProps()));
List<MessagePart> children = part.getChildren();
if (children.size() > 0) {
object.put("children", processChildren(part.getChildren()));
}
array.put(object);
}
return array;
}
Aggregations