Search in sources :

Example 1 with IdlUnionBranch

use of org.apache.cxf.tools.corba.common.idltypes.IdlUnionBranch in project cxf by apache.

the class WSDLToIDLAction method createUnion.

private IdlType createUnion(Union u, IdlScopeBase scope, String local) throws Exception {
    boolean undefinedCircular = false;
    IdlType disc = findType(u.getDiscriminator());
    IdlUnion union = IdlUnion.create(scope, local, disc);
    scope.holdForScope(union);
    for (Unionbranch ub : u.getUnionbranch()) {
        QName qname = ub.getIdltype();
        IdlType bt = findType(qname);
        boolean isDefault = false;
        if (ub.isSetDefault()) {
            isDefault = ub.isDefault();
        }
        IdlUnionBranch b = IdlUnionBranch.create(union, ub.getName(), bt, isDefault);
        for (CaseType cs : ub.getCase()) {
            b.addCase(cs.getLabel());
        }
        if (!undefinedCircular && !(bt instanceof IdlSequence)) {
            String mlocal = qname.getLocalPart();
            String[] mname = unscopeName(mlocal);
            undefinedCircular = null != root.lookup(mname, true);
        }
        union.addBranch(b);
    }
    if (undefinedCircular) {
        scope.parkHeld();
    } else {
        scope.promoteHeldToScope();
        if (union.isCircular()) {
            // resolving this union closed a recursion
            scope.flush();
        }
    }
    return union;
}
Also used : IdlUnionBranch(org.apache.cxf.tools.corba.common.idltypes.IdlUnionBranch) IdlSequence(org.apache.cxf.tools.corba.common.idltypes.IdlSequence) CaseType(org.apache.cxf.binding.corba.wsdl.CaseType) QName(javax.xml.namespace.QName) IdlString(org.apache.cxf.tools.corba.common.idltypes.IdlString) IdlType(org.apache.cxf.tools.corba.common.idltypes.IdlType) IdlUnion(org.apache.cxf.tools.corba.common.idltypes.IdlUnion) Unionbranch(org.apache.cxf.binding.corba.wsdl.Unionbranch)

Aggregations

QName (javax.xml.namespace.QName)1 CaseType (org.apache.cxf.binding.corba.wsdl.CaseType)1 Unionbranch (org.apache.cxf.binding.corba.wsdl.Unionbranch)1 IdlSequence (org.apache.cxf.tools.corba.common.idltypes.IdlSequence)1 IdlString (org.apache.cxf.tools.corba.common.idltypes.IdlString)1 IdlType (org.apache.cxf.tools.corba.common.idltypes.IdlType)1 IdlUnion (org.apache.cxf.tools.corba.common.idltypes.IdlUnion)1 IdlUnionBranch (org.apache.cxf.tools.corba.common.idltypes.IdlUnionBranch)1