Package org.apache.schemas.yoko.bindings.corba

Examples of org.apache.schemas.yoko.bindings.corba.Unionbranch


        nilUnion.setQName(name);
        nilUnion.setDiscriminator(CorbaConstants.NT_CORBA_BOOLEAN);
        String id = repoString + nilUnion.getQName().getLocalPart().replace('.', '/') + idlversion;
        nilUnion.setRepositoryID(id);

        Unionbranch branch = new Unionbranch();
        branch.setName("value");
        branch.setIdltype(membertype);
        branch.setDefault(false);
        CaseType caseType = new CaseType();
        caseType.setLabel("TRUE");
        branch.getCase().add(caseType);
        nilUnion.getUnionbranch().add(branch);      
       
        return nilUnion;
    }
View Full Code Here


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

       
        TypeCode discTC = getTypeCode(orb, unionType.getDiscriminator(), typeMaps);
        Map<String, UnionMember> members = new LinkedHashMap<String, UnionMember>();
        List<Unionbranch> branches = unionType.getUnionbranch();
        for (Iterator<Unionbranch> branchIter = branches.iterator(); branchIter.hasNext();) {
            Unionbranch branch = branchIter.next();
            List<CaseType> cases = branch.getCase();
            for (Iterator<CaseType> caseIter = cases.iterator(); caseIter.hasNext();) {
                CaseType cs = caseIter.next();
                UnionMember member = new UnionMember();
                member.name = branch.getName();
                member.type = getTypeCode(orb, branch.getIdltype(), typeMaps);
                member.label = orb.create_any();
               
                // We need to insert the labels in a way that depends on the type of the discriminator. 
                // According to the CORBA specification, the following types are permissable as
                // discriminator types:
View Full Code Here

        }
       
        // Now find the label in the union to get the right case
        Union unionType = (Union)unionHandler.getType();
        List<Unionbranch> branches = unionType.getUnionbranch();
        Unionbranch defaultBranch = null;
        boolean caseFound = false;
        for (Iterator<Unionbranch> iter = branches.iterator(); iter.hasNext();) {
            Unionbranch branch = iter.next();
            if (branch.isSetDefault() && branch.isDefault()) {
                defaultBranch = branch;
            }
            List<CaseType> cases = branch.getCase();
            for (Iterator<CaseType> caseIter = cases.iterator(); caseIter.hasNext();) {
                CaseType c = caseIter.next();
                if (c.getLabel().equals(discLabel)) {
                    CorbaObjectHandler branchObj = unionHandler.getBranchByName(branch.getName());
                    this.read(branchObj);
                    unionHandler.setValue(branch.getName(), branchObj);
                    caseFound = true;
                    break;
                }
            }
            if (caseFound) {
View Full Code Here

TOP

Related Classes of org.apache.schemas.yoko.bindings.corba.Unionbranch

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.