Search in sources :

Example 1 with SoapApiElement

use of com.zimbra.doc.soap.apidesc.SoapApiElement in project zm-mailbox by Zimbra.

the class CommandChanges method findSubElementChanges.

private void findSubElementChanges(Ancestry ancestry, Map<String, SoapApiNamedElement> baseElems, Map<String, SoapApiNamedElement> currElems) {
    for (Entry<String, SoapApiNamedElement> entry : currElems.entrySet()) {
        SoapApiNamedElement baseElem = baseElems.get(entry.getKey());
        if (baseElem != null) {
            String className = null;
            boolean insideSelf = false;
            if (baseElem instanceof SoapApiElement) {
                SoapApiElement be = (SoapApiElement) baseElem;
                className = be.getJaxb();
                insideSelf = ancestry.hasAncestor(className);
            }
            if (!insideSelf) {
                Ancestry subAncestry = new Ancestry(ancestry, baseElem.getName(), className);
                findElementChanges(subAncestry, baseElem, entry.getValue());
            }
        } else {
            newElems.add(new NamedElem(ancestry.getXpath(), entry.getValue()));
        }
    }
    for (Entry<String, SoapApiNamedElement> entry : baseElems.entrySet()) {
        if (!currElems.containsKey(entry.getKey())) {
            deletedElems.add(new NamedElem(ancestry.getXpath(), entry.getValue()));
        }
    }
}
Also used : SoapApiNamedElement(com.zimbra.doc.soap.apidesc.SoapApiNamedElement) SoapApiElement(com.zimbra.doc.soap.apidesc.SoapApiElement)

Aggregations

SoapApiElement (com.zimbra.doc.soap.apidesc.SoapApiElement)1 SoapApiNamedElement (com.zimbra.doc.soap.apidesc.SoapApiNamedElement)1