Package org.apache.yoko.tools.common.idltypes

Examples of org.apache.yoko.tools.common.idltypes.IdlUnion


    private IdlType createUnion(CorbaTypeImpl ctype, IdlScopeBase scope,
                                String local) throws Exception {
        Union u = (Union)ctype;
        boolean undefinedCircular = false;
        IdlType disc = findType(u.getDiscriminator());
        IdlUnion union = IdlUnion.create(scope, local, disc);
        scope.holdForScope(union);

        Iterator it = u.getUnionbranch().iterator();
        while (it.hasNext()) {
            Unionbranch ub = (Unionbranch)it.next();
            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);

            Iterator it2 = ub.getCase().iterator();
            while (it2.hasNext()) {               
                b.addCase(((CaseType)it2.next()).getLabel());
            }

            // Ensure that this union will not  be written until all of its circular members are
            // defined, unless the undefined circular members are of sequence type.

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


   
    private IdlType createUnion(CorbaTypeImpl ctype, IdlScopeBase scope, String local) {
        Union u = (Union)ctype;
        boolean undefinedCircular = false;
        IdlType disc = findType(u.getDiscriminator());
        IdlUnion union = IdlUnion.create(scope, local, disc);
        scope.holdForScope(union);

        Iterator it = u.getUnionbranch().iterator();
        while (it.hasNext()) {
            Unionbranch ub = (Unionbranch)it.next();
            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);

            Iterator it2 = ub.getCase().iterator();
            while (it2.hasNext()) {               
                b.addCase(((CaseType)it2.next()).getLabel());
            }

            // Ensure that this union will not  be written until all of its circular members are
            // defined, unless the undefined circular members are of sequence type.

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

TOP

Related Classes of org.apache.yoko.tools.common.idltypes.IdlUnion

Copyright © 2018 www.massapicom. 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.