Package org.apache.cxf.binding.corba.wsdl

Examples of org.apache.cxf.binding.corba.wsdl.Union


        return result;       
    }
   
    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);

        for (Unionbranch ub : u .getUnionbranch()) {
            QName qname = ub.getIdltype();
            IdlType bt = findType(qname);
            boolean isDefault = false;
            if (ub.isSetDefault()) {
                isDefault = ub.isDefault();
View Full Code Here


            WSDLToIDLAction idlgen = new WSDLToIDLAction();
            idlgen.setBindingName("NillableCORBABinding");
            idlgen.setOutputFile("nillable.idl");
            idlgen.generateIDL(model);
           
            Union un = (Union)mapType.getStructOrExceptionOrUnion().get(2);
            assertEquals("Name is incorrect for Union Type", "long_nil",
                         un.getName());
            assertEquals("Type is incorrect for Union Type", "PEl",
                         un.getType().getLocalPart());
            Unionbranch unbranch = un.getUnionbranch().get(0);
            assertEquals("Name is incorrect for UnionBranch Type", "value",
                         unbranch.getName());
            assertEquals("Type is incorrect for UnionBranch Type", "long",
                         unbranch.getIdltype().getLocalPart());
View Full Code Here

    protected MemberType processComplexContentStructChoice(XmlSchemaChoice choice,
                                                     QName schematypeName, QName defaultName)
        throws Exception {
        QName choicename = createQNameTargetNamespace(schematypeName.getLocalPart() + "ChoiceType");
        Union choiceunion = createUnion(choicename, choice,
                                        defaultName, schematypeName);

        MemberType choicemem = new MemberType();
        if (choiceunion != null) {
            String repoId = REPO_STRING + choiceunion.getQName().getLocalPart().replace('.', '/')
                + IDL_VERSION;
            choiceunion.setRepositoryID(repoId);

            choicemem.setName(choiceunion.getQName().getLocalPart() + "_f");
            choicemem.setIdltype(createQNameCorbaNamespace(choiceunion.getQName().getLocalPart()));

            if (!isDuplicate(choiceunion)) {
                typeMappingType.getStructOrExceptionOrUnion().add(choiceunion);
            }
        }
View Full Code Here

    protected CorbaTypeImpl createNillableUnion(QName name,
                                                QName schemaType,
                                                QName membertype,
                                                boolean isQualified) {

        Union nilUnion = new Union();
        nilUnion.setName(name.getLocalPart());
        nilUnion.setType(schemaType);
        nilUnion.setQName(name);
        nilUnion.setDiscriminator(CorbaConstants.NT_CORBA_BOOLEAN);
        String id = REPO_STRING + nilUnion.getQName().getLocalPart().replace('.', '/') + IDL_VERSION;
        nilUnion.setRepositoryID(id);

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

                           maxOccurs, minOccurs, anonymous);
    }

    private CorbaTypeImpl processOMGUnion(XmlSchemaComplexType complex, QName defaultName) throws Exception {
        QName name;
        Union corbaUnion = null;
        QName schematypeName = checkPrefix(complex.getQName());

        if (schematypeName == null) {
            schematypeName = defaultName;
            name = createQNameCorbaNamespace(defaultName.getLocalPart() + "Type");
        } else {
            name = createQNameCorbaNamespace(schematypeName.getLocalPart());
        }

        corbaUnion = new Union();
        corbaUnion.setName(name.getLocalPart());
        corbaUnion.setQName(name);
        String id = REPO_STRING + name.getLocalPart().replace('.', '/') + IDL_VERSION;
        corbaUnion.setRepositoryID(id);
        corbaUnion.setType(schematypeName);

        XmlSchemaSequence stype = (XmlSchemaSequence)complex.getParticle();
        Iterator<XmlSchemaSequenceMember> it = stype.getItems().iterator();
        XmlSchemaParticle st1 = (XmlSchemaParticle)it.next();
        XmlSchemaParticle st2 = (XmlSchemaParticle)it.next();
        XmlSchemaElement discEl = null;
        XmlSchemaChoice choice = null;

        if (st1 instanceof XmlSchemaElement) {
            discEl = (XmlSchemaElement)st1;
            choice = (XmlSchemaChoice)st2;
        } else {
            discEl = (XmlSchemaElement)st2;
            choice = (XmlSchemaChoice)st1;
        }

        CorbaTypeImpl disctype = convertSchemaToCorbaType(discEl.getSchemaType(), discEl.getQName(), discEl
            .getSchemaType(), null, false);
        corbaUnion.setDiscriminator(disctype.getQName());

        List<MemberType> fields = processContainerAsMembers(choice, defaultName, schematypeName);

        List<String> caselist = new ArrayList<String>();
View Full Code Here

    protected Union createUnion(QName name, XmlSchemaChoice choice, QName defaultName,
                                QName schematypeName)
        throws Exception {

        Union corbaUnion = null;
        if (recursionMap.get(name) instanceof Union) {
            corbaUnion = (Union)recursionMap.get(name);
            if (corbaUnion != null) {
                return corbaUnion;
            }
        }

        corbaUnion = new Union();
        corbaUnion.setName(name.getLocalPart());
        corbaUnion.setQName(name);
        corbaUnion.setType(schematypeName);
        String id = REPO_STRING + name.getLocalPart().replace('.', '/') + IDL_VERSION;
        corbaUnion.setRepositoryID(id);

        //Set Integer as Discriminator
        corbaUnion.setDiscriminator(CorbaConstants.NT_CORBA_LONG);

        // add to the list of possible recursive types
        recursionMap.put(name, corbaUnion);

        List<MemberType> fields = processContainerAsMembers(choice, defaultName, schematypeName);
View Full Code Here

    protected MemberType processComplexContentStructChoice(XmlSchemaChoice choice,
                                                     QName schematypeName, QName defaultName)
        throws Exception {
        QName choicename = createQNameTargetNamespace(schematypeName.getLocalPart() + "ChoiceType");
        Union choiceunion = createUnion(choicename, choice,
                                        defaultName, schematypeName);

        MemberType choicemem = new MemberType();
        if (choiceunion != null) {
            String repoId = REPO_STRING + choiceunion.getQName().getLocalPart().replace('.', '/')
                + IDL_VERSION;
            choiceunion.setRepositoryID(repoId);

            choicemem.setName(choiceunion.getQName().getLocalPart() + "_f");
            choicemem.setIdltype(createQNameCorbaNamespace(choiceunion.getQName().getLocalPart()));

            if (!isDuplicate(choiceunion)) {
                typeMappingType.getStructOrExceptionOrUnion().add(choiceunion);
            }
        }
View Full Code Here

    protected CorbaType createNillableUnion(QName name,
                                                QName schemaType,
                                                QName membertype,
                                                boolean isQualified) {

        Union nilUnion = new Union();
        nilUnion.setName(name.getLocalPart());
        nilUnion.setType(schemaType);
        nilUnion.setQName(name);
        nilUnion.setDiscriminator(CorbaConstants.NT_CORBA_BOOLEAN);
        String id = REPO_STRING + nilUnion.getQName().getLocalPart().replace('.', '/') + IDL_VERSION;
        nilUnion.setRepositoryID(id);

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

            WSDLToIDLAction idlgen = new WSDLToIDLAction();
            idlgen.setBindingName("NillableCORBABinding");
            idlgen.setOutputFile("nillable.idl");
            idlgen.generateIDL(model);
           
            Union un = (Union)mapType.getStructOrExceptionOrUnion().get(2);
            assertEquals("Name is incorrect for Union Type", "long_nil",
                         un.getName());
            assertEquals("Type is incorrect for Union Type", "PEl",
                         un.getType().getLocalPart());
            Unionbranch unbranch = un.getUnionbranch().get(0);
            assertEquals("Name is incorrect for UnionBranch Type", "value",
                         unbranch.getName());
            assertEquals("Type is incorrect for UnionBranch Type", "long",
                         unbranch.getIdltype().getLocalPart());
View Full Code Here

                           maxOccurs, minOccurs, anonymous);
    }

    private CorbaType processOMGUnion(XmlSchemaComplexType complex, QName defaultName) throws Exception {
        QName name;
        Union corbaUnion = null;
        QName schematypeName = checkPrefix(complex.getQName());

        if (schematypeName == null) {
            schematypeName = defaultName;
            name = createQNameCorbaNamespace(defaultName.getLocalPart() + "Type");
        } else {
            name = createQNameCorbaNamespace(schematypeName.getLocalPart());
        }

        corbaUnion = new Union();
        corbaUnion.setName(name.getLocalPart());
        corbaUnion.setQName(name);
        String id = REPO_STRING + name.getLocalPart().replace('.', '/') + IDL_VERSION;
        corbaUnion.setRepositoryID(id);
        corbaUnion.setType(schematypeName);

        XmlSchemaSequence stype = (XmlSchemaSequence)complex.getParticle();
        Iterator<XmlSchemaSequenceMember> it = stype.getItems().iterator();
        XmlSchemaParticle st1 = (XmlSchemaParticle)it.next();
        XmlSchemaParticle st2 = (XmlSchemaParticle)it.next();
        XmlSchemaElement discEl = null;
        XmlSchemaChoice choice = null;

        if (st1 instanceof XmlSchemaElement) {
            discEl = (XmlSchemaElement)st1;
            choice = (XmlSchemaChoice)st2;
        } else {
            discEl = (XmlSchemaElement)st2;
            choice = (XmlSchemaChoice)st1;
        }

        CorbaType disctype = convertSchemaToCorbaType(discEl.getSchemaType(), discEl.getQName(), discEl
            .getSchemaType(), null, false);
        corbaUnion.setDiscriminator(disctype.getQName());

        List<MemberType> fields = processContainerAsMembers(choice, defaultName, schematypeName);

        List<String> caselist = new ArrayList<String>();
View Full Code Here

TOP

Related Classes of org.apache.cxf.binding.corba.wsdl.Union

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.