Examples of CorbaUnionHandler


Examples of org.apache.cxf.binding.corba.types.CorbaUnionHandler

        }
        disc.setValue(enumerators.get(enumIndex).getValue());
    }

    public void readUnion(CorbaObjectHandler obj) throws CorbaBindingException {
        CorbaUnionHandler unionHandler = (CorbaUnionHandler)obj;
        Union unionType = (Union)unionHandler.getType();
        List<Unionbranch> branches = unionType.getUnionbranch();
        CorbaObjectHandler discriminator = unionHandler.getDiscriminator();
        if (branches.size() > 0) {
            String discLabel = null;
            if (discriminator.getTypeCodeKind().value() == TCKind._tk_enum) {
                CorbaEnumHandler disc = (CorbaEnumHandler) discriminator;
                readEnumDiscriminator(unionHandler, disc);
                discLabel = disc.getValue();
            } else {
                read(discriminator);
                discLabel = ((CorbaPrimitiveHandler)discriminator).getDataFromValue();
            }
            // Now find the label in the union to get the right case
            Unionbranch defaultBranch = null;
            boolean caseFound = false;
            for (Iterator<Unionbranch> branchIter = branches.iterator(); branchIter.hasNext();) {
                Unionbranch branch = branchIter.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().equalsIgnoreCase(discLabel)) {
                        CorbaObjectHandler branchObj = unionHandler.getBranchByName(branch.getName());
                        this.read(branchObj);
                        unionHandler.setValue(branch.getName(), branchObj);
                        caseFound = true;
                        break;
                    }
                }
                if (caseFound) {
                    break;
                }
            }
           
            // If we never find a case that matches the value of the discriminiator, then we must have
            // found the default case.
            if (!caseFound && defaultBranch != null) {
                CorbaObjectHandler branchObj = unionHandler.getBranchByName(defaultBranch.getName());
                this.read(branchObj);
                unionHandler.setValue(defaultBranch.getName(), branchObj);
            }
        }
    }
View Full Code Here

Examples of org.apache.cxf.binding.corba.types.CorbaUnionHandler

            for (int i = 0; i < elements.size(); i++) {
                CorbaObjectHandler element = initializeCorbaObjectHandler(elements.get(i));
                array.addElement(element);
            }
        } else if (template instanceof CorbaUnionHandler) {
            CorbaUnionHandler templateUnion = (CorbaUnionHandler) template;
            CorbaUnionHandler union = (CorbaUnionHandler) handler;
            union.setRecursive(template.isRecursive());
            union.setDiscriminator(initializeCorbaObjectHandler(templateUnion.getDiscriminator()));
            List<CorbaObjectHandler> cases = templateUnion.getCases();
            for (int i = 0; i < cases.size(); i++) {
                union.addCase(initializeCorbaObjectHandler(cases.get(i)));
            }
        }

        return handler;
View Full Code Here

Examples of org.apache.cxf.binding.corba.types.CorbaUnionHandler

        }
        disc.setValue(enumerators.get(enumIndex).getValue());
    }

    public void readUnion(CorbaObjectHandler obj) throws CorbaBindingException {
        CorbaUnionHandler unionHandler = (CorbaUnionHandler)obj;
        Union unionType = (Union)unionHandler.getType();
        List<Unionbranch> branches = unionType.getUnionbranch();
        CorbaObjectHandler discriminator = unionHandler.getDiscriminator();
        if (branches.size() > 0) {
            String discLabel = null;
            if (discriminator.getTypeCodeKind().value() == TCKind._tk_enum) {
                CorbaEnumHandler disc = (CorbaEnumHandler) discriminator;
                readEnumDiscriminator(unionHandler, disc);
                discLabel = disc.getValue();
            } else {
                read(discriminator);
                discLabel = ((CorbaPrimitiveHandler)discriminator).getDataFromValue();
            }
            // Now find the label in the union to get the right case
            Unionbranch defaultBranch = null;
            boolean caseFound = false;
            for (Iterator<Unionbranch> branchIter = branches.iterator(); branchIter.hasNext();) {
                Unionbranch branch = branchIter.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().equalsIgnoreCase(discLabel)) {
                        CorbaObjectHandler branchObj = unionHandler.getBranchByName(branch.getName());
                        this.read(branchObj);
                        unionHandler.setValue(branch.getName(), branchObj);
                        caseFound = true;
                        break;
                    }
                }
                if (caseFound) {
                    break;
                }
            }
           
            // If we never find a case that matches the value of the discriminiator, then we must have
            // found the default case.
            if (!caseFound && defaultBranch != null) {
                CorbaObjectHandler branchObj = unionHandler.getBranchByName(defaultBranch.getName());
                this.read(branchObj);
                unionHandler.setValue(defaultBranch.getName(), branchObj);
            }
        }
    }
View Full Code Here

Examples of org.apache.cxf.binding.corba.types.CorbaUnionHandler

            for (int i = 0; i < elements.size(); i++) {
                CorbaObjectHandler element = initializeCorbaObjectHandler(elements.get(i));
                array.addElement(element);
            }
        } else if (template instanceof CorbaUnionHandler) {
            CorbaUnionHandler templateUnion = (CorbaUnionHandler) template;
            CorbaUnionHandler union = (CorbaUnionHandler) handler;
            union.setRecursive(template.isRecursive());
            union.setDiscriminator(initializeCorbaObjectHandler(templateUnion.getDiscriminator()));
            List<CorbaObjectHandler> cases = templateUnion.getCases();
            for (int i = 0; i < cases.size(); i++) {
                union.addCase(initializeCorbaObjectHandler(cases.get(i)));
            }
        }

        return handler;
View Full Code Here

Examples of org.apache.cxf.binding.corba.types.CorbaUnionHandler

            for (int i = 0; i < elements.size(); i++) {
                CorbaObjectHandler element = initializeCorbaObjectHandler(elements.get(i));
                array.addElement(element);
            }
        } else if (template instanceof CorbaUnionHandler) {
            CorbaUnionHandler templateUnion = (CorbaUnionHandler) template;
            CorbaUnionHandler union = (CorbaUnionHandler) handler;
            union.setRecursive(template.isRecursive());
            union.setDiscriminator(initializeCorbaObjectHandler(templateUnion.getDiscriminator()));
            List<CorbaObjectHandler> cases = templateUnion.getCases();
            for (int i = 0; i < cases.size(); i++) {
                union.addCase(initializeCorbaObjectHandler(cases.get(i)));
            }
        }

        return handler;
View Full Code Here

Examples of org.apache.cxf.binding.corba.types.CorbaUnionHandler

        }
        disc.setValue(enumerators.get(enumIndex).getValue());
    }

    public void readUnion(CorbaObjectHandler obj) throws CorbaBindingException {
        CorbaUnionHandler unionHandler = (CorbaUnionHandler)obj;
        Union unionType = (Union)unionHandler.getType();
        List<Unionbranch> branches = unionType.getUnionbranch();
        CorbaObjectHandler discriminator = unionHandler.getDiscriminator();
        if (branches.size() > 0) {
            String discLabel = null;
            if (discriminator.getTypeCodeKind().value() == TCKind._tk_enum) {
                CorbaEnumHandler disc = (CorbaEnumHandler) discriminator;
                readEnumDiscriminator(unionHandler, disc);
                discLabel = disc.getValue();
            } else {
                read(discriminator);
                discLabel = ((CorbaPrimitiveHandler)discriminator).getDataFromValue();
            }
            // Now find the label in the union to get the right case
            Unionbranch defaultBranch = null;
            boolean caseFound = false;
            for (Iterator<Unionbranch> branchIter = branches.iterator(); branchIter.hasNext();) {
                Unionbranch branch = branchIter.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().equalsIgnoreCase(discLabel)) {
                        CorbaObjectHandler branchObj = unionHandler.getBranchByName(branch.getName());
                        this.read(branchObj);
                        unionHandler.setValue(branch.getName(), branchObj);
                        caseFound = true;
                        break;
                    }
                }
                if (caseFound) {
                    break;
                }
            }
           
            // If we never find a case that matches the value of the discriminiator, then we must have
            // found the default case.
            if (!caseFound && defaultBranch != null) {
                CorbaObjectHandler branchObj = unionHandler.getBranchByName(defaultBranch.getName());
                this.read(branchObj);
                unionHandler.setValue(defaultBranch.getName(), branchObj);
            }
        }
    }
View Full Code Here

Examples of org.apache.cxf.binding.corba.types.CorbaUnionHandler

            for (int i = 0; i < elements.size(); i++) {
                CorbaObjectHandler element = initializeCorbaObjectHandler(elements.get(i));
                array.addElement(element);
            }
        } else if (template instanceof CorbaUnionHandler) {
            CorbaUnionHandler templateUnion = (CorbaUnionHandler) template;
            CorbaUnionHandler union = (CorbaUnionHandler) handler;
            union.setRecursive(template.isRecursive());
            union.setDiscriminator(initializeCorbaObjectHandler(templateUnion.getDiscriminator()));
            List<CorbaObjectHandler> cases = templateUnion.getCases();
            for (int i = 0; i < cases.size(); i++) {
                union.addCase(initializeCorbaObjectHandler(cases.get(i)));
            }
        }

        return handler;
View Full Code Here

Examples of org.apache.cxf.binding.corba.types.CorbaUnionHandler

        }
        disc.setValue(enumerators.get(enumIndex).getValue());
    }

    public void readUnion(CorbaObjectHandler obj) throws CorbaBindingException {
        CorbaUnionHandler unionHandler = (CorbaUnionHandler)obj;
        Union unionType = (Union)unionHandler.getType();
        List<Unionbranch> branches = unionType.getUnionbranch();
        CorbaObjectHandler discriminator = unionHandler.getDiscriminator();
        if (branches.size() > 0) {
            String discLabel = null;
            if (discriminator.getTypeCodeKind().value() == TCKind._tk_enum) {
                CorbaEnumHandler disc = (CorbaEnumHandler) discriminator;
                readEnumDiscriminator(unionHandler, disc);
                discLabel = disc.getValue();
            } else {
                read(discriminator);
                discLabel = ((CorbaPrimitiveHandler)discriminator).getDataFromValue();
            }
            // Now find the label in the union to get the right case
            Unionbranch defaultBranch = null;
            boolean caseFound = false;
            for (Iterator<Unionbranch> branchIter = branches.iterator(); branchIter.hasNext();) {
                Unionbranch branch = branchIter.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().equalsIgnoreCase(discLabel)) {
                        CorbaObjectHandler branchObj = unionHandler.getBranchByName(branch.getName());
                        this.read(branchObj);
                        unionHandler.setValue(branch.getName(), branchObj);
                        caseFound = true;
                        break;
                    }
                }
                if (caseFound) {
                    break;
                }
            }
           
            // If we never find a case that matches the value of the discriminiator, then we must have
            // found the default case.
            if (!caseFound && defaultBranch != null) {
                CorbaObjectHandler branchObj = unionHandler.getBranchByName(defaultBranch.getName());
                this.read(branchObj);
                unionHandler.setValue(defaultBranch.getName(), branchObj);
            }
        }
    }
View Full Code Here

Examples of org.apache.cxf.binding.corba.types.CorbaUnionHandler

            for (int i = 0; i < elements.size(); i++) {
                CorbaObjectHandler element = initializeCorbaObjectHandler(elements.get(i));
                array.addElement(element);
            }
        } else if (template instanceof CorbaUnionHandler) {
            CorbaUnionHandler templateUnion = (CorbaUnionHandler) template;
            CorbaUnionHandler union = (CorbaUnionHandler) handler;
            union.setRecursive(template.isRecursive());
            union.setDiscriminator(initializeCorbaObjectHandler(templateUnion.getDiscriminator()));
            List<CorbaObjectHandler> cases = templateUnion.getCases();
            for (int i = 0; i < cases.size(); i++) {
                union.addCase(initializeCorbaObjectHandler(cases.get(i)));
            }
        }

        return handler;
View Full Code Here

Examples of org.apache.cxf.binding.corba.types.CorbaUnionHandler

        }
        disc.setValue(enumerators.get(enumIndex).getValue());
    }

    public void readUnion(CorbaObjectHandler obj) throws CorbaBindingException {
        CorbaUnionHandler unionHandler = (CorbaUnionHandler)obj;
        Union unionType = (Union)unionHandler.getType();
        List<Unionbranch> branches = unionType.getUnionbranch();
        CorbaObjectHandler discriminator = unionHandler.getDiscriminator();
        if (branches.size() > 0) {
            String discLabel = null;
            if (discriminator.getTypeCodeKind().value() == TCKind._tk_enum) {
                CorbaEnumHandler disc = (CorbaEnumHandler) discriminator;
                readEnumDiscriminator(unionHandler, disc);
                discLabel = disc.getValue();
            } else {
                read(discriminator);
                discLabel = ((CorbaPrimitiveHandler)discriminator).getDataFromValue();
            }
            // Now find the label in the union to get the right case
            Unionbranch defaultBranch = null;
            boolean caseFound = false;
            for (Iterator<Unionbranch> branchIter = branches.iterator(); branchIter.hasNext();) {
                Unionbranch branch = branchIter.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().equalsIgnoreCase(discLabel)) {
                        CorbaObjectHandler branchObj = unionHandler.getBranchByName(branch.getName());
                        this.read(branchObj);
                        unionHandler.setValue(branch.getName(), branchObj);
                        caseFound = true;
                        break;
                    }
                }
                if (caseFound) {
                    break;
                }
            }
           
            // If we never find a case that matches the value of the discriminiator, then we must have
            // found the default case.
            if (!caseFound && defaultBranch != null) {
                CorbaObjectHandler branchObj = unionHandler.getBranchByName(defaultBranch.getName());
                this.read(branchObj);
                unionHandler.setValue(defaultBranch.getName(), branchObj);
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.