Search in sources :

Example 1 with XmlObject

use of org.glassfish.admin.rest.utils.xml.XmlObject 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;
}
Also used : XmlArray(org.glassfish.admin.rest.utils.xml.XmlArray) XmlObject(org.glassfish.admin.rest.utils.xml.XmlObject) XmlObject(org.glassfish.admin.rest.utils.xml.XmlObject)

Example 2 with XmlObject

use of org.glassfish.admin.rest.utils.xml.XmlObject in project Payara by payara.

the class ActionReportXmlProvider method getExtraProperties.

protected XmlMap getExtraProperties(XmlObject object, Properties props) {
    XmlMap extraProperties = new XmlMap("extraProperties");
    for (Map.Entry<Object, Object> entry : props.entrySet()) {
        String key = entry.getKey().toString();
        Object value = getXmlObject(entry.getValue());
        if (value != null) {
            extraProperties.put(key, value);
        }
    }
    return extraProperties;
}
Also used : XmlMap(org.glassfish.admin.rest.utils.xml.XmlMap) XmlObject(org.glassfish.admin.rest.utils.xml.XmlObject) XmlMap(org.glassfish.admin.rest.utils.xml.XmlMap)

Aggregations

XmlObject (org.glassfish.admin.rest.utils.xml.XmlObject)2 XmlArray (org.glassfish.admin.rest.utils.xml.XmlArray)1 XmlMap (org.glassfish.admin.rest.utils.xml.XmlMap)1