Examples of XmlMap


Examples of org.glassfish.admin.rest.utils.xml.XmlMap

        XmlObject result = processReport(ar);
        return result.toString(getFormattingIndentLevel());
    }

    protected XmlObject processReport(ActionReporter ar) {
        XmlMap result = new XmlMap("map");
        result.put("message", (ar instanceof RestActionReporter) ? ((RestActionReporter)ar).getCombinedMessage() : ar.getMessage());
        result.put("command", ar.getActionDescription());
        result.put("exit_code", ar.getActionExitCode().toString());

        Properties properties = ar.getTopMessagePart().getProps();
        if ((properties != null) && (!properties.isEmpty())) {
            result.put("properties", new XmlMap("properties", properties));
        }

        Properties extraProperties = ar.getExtraProperties();
        if ((extraProperties != null) && (!extraProperties.isEmpty())) {
            result.put("extraProperties", getExtraProperties(result, extraProperties));
        }

        List<MessagePart> children = ar.getTopMessagePart().getChildren();
        if ((children != null) && (!children.isEmpty())) {
            result.put("children", processChildren(children));
        }

        List<ActionReporter> subReports = ar.getSubActionsReport();
       if ((subReports != null) && (!subReports.isEmpty())) {
            result.put("subReports", processSubReports(subReports));
        }

        return result;
    }
View Full Code Here

Examples of org.glassfish.admin.rest.utils.xml.XmlMap

    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;
View Full Code Here

Examples of org.glassfish.admin.rest.utils.xml.XmlMap

        return array;
    }

    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;
    }
View Full Code Here

Examples of org.glassfish.admin.rest.utils.xml.XmlMap

        return result;
    }

    protected XmlMap processMap(Map map) {
        XmlMap result = new XmlMap("map");

        for (Map.Entry entry : (Set<Map.Entry>)map.entrySet()) {
            result.put(entry.getKey().toString(), getXmlObject(entry.getValue()));
        }

        return result;
    }
View Full Code Here

Examples of org.glassfish.admin.rest.utils.xml.XmlMap

    protected boolean isGivenTypeWritable(Class<?> type, Type genericType) {
        return desiredType.isAssignableFrom(type);
    }

    protected XmlObject processReport(ActionReporter ar) {
        XmlMap result = new XmlMap("map");
        result.put("message", (ar instanceof RestActionReporter) ? ((RestActionReporter)ar).getCombinedMessage() : ar.getMessage());
        result.put("command", ar.getActionDescription());
        result.put("exit_code", ar.getActionExitCode().toString());

        Properties properties = ar.getTopMessagePart().getProps();
        if ((properties != null) && (!properties.isEmpty())) {
            result.put("properties", new XmlMap("properties", properties));
        }

        Properties extraProperties = ar.getExtraProperties();
        if ((extraProperties != null) && (!extraProperties.isEmpty())) {
            result.put("extraProperties", getExtraProperties(result, extraProperties));
        }

        List<MessagePart> children = ar.getTopMessagePart().getChildren();
        if ((children != null) && (!children.isEmpty())) {
            result.put("children", processChildren(children));
        }

        List<ActionReporter> subReports = ar.getSubActionsReport();
       if ((subReports != null) && (!subReports.isEmpty())) {
            result.put("subReports", processSubReports(subReports));
        }

        return result;
    }
View Full Code Here

Examples of org.glassfish.admin.rest.utils.xml.XmlMap

    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;
View Full Code Here

Examples of org.glassfish.admin.rest.utils.xml.XmlMap

        return array;
    }

    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;
    }
View Full Code Here

Examples of org.glassfish.admin.rest.utils.xml.XmlMap

        return result;
    }

    protected XmlMap getXml(Map map) {
        XmlMap result = new XmlMap("map");

        for (Map.Entry entry : (Set<Map.Entry>)map.entrySet()) {
            result.put(entry.getKey().toString(), getXmlObject(entry.getValue()));
        }

        return result;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.