Search in sources :

Example 1 with SoapApiElementArtifact

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

the class CommandChanges method makeSubElemMap.

/**
 * Convenience method.  Creating the map is slightly complicated by SoapApiElementChoiceInfo pseudo nodes
 * which we can ignore for the purposes of the changelog, but we need to promote their children
 */
private Map<String, SoapApiNamedElement> makeSubElemMap(Collection<SoapApiElementArtifact> subElems) {
    Map<String, SoapApiNamedElement> elems = Maps.newTreeMap();
    if (subElems != null) {
        for (SoapApiElementArtifact elemArtifact : subElems) {
            if (elemArtifact instanceof SoapApiElementChoiceInfo) {
                SoapApiElementChoiceInfo choiceNode = (SoapApiElementChoiceInfo) elemArtifact;
                for (SoapApiElementArtifact subE : choiceNode.getSubElements()) {
                    if (subE instanceof SoapApiNamedElement) {
                        SoapApiNamedElement namedE = (SoapApiNamedElement) subE;
                        elems.put(namedE.getName(), namedE);
                    }
                }
            } else if (elemArtifact instanceof SoapApiNamedElement) {
                SoapApiNamedElement namedE = (SoapApiNamedElement) elemArtifact;
                elems.put(namedE.getName(), namedE);
            }
        }
    }
    return elems;
}
Also used : SoapApiElementArtifact(com.zimbra.doc.soap.apidesc.SoapApiElementArtifact) SoapApiNamedElement(com.zimbra.doc.soap.apidesc.SoapApiNamedElement) SoapApiElementChoiceInfo(com.zimbra.doc.soap.apidesc.SoapApiElementChoiceInfo)

Aggregations

SoapApiElementArtifact (com.zimbra.doc.soap.apidesc.SoapApiElementArtifact)1 SoapApiElementChoiceInfo (com.zimbra.doc.soap.apidesc.SoapApiElementChoiceInfo)1 SoapApiNamedElement (com.zimbra.doc.soap.apidesc.SoapApiNamedElement)1