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

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


    }

    private MemberType processAllMember(XmlSchemaAll all, QName defaultName,
        QName schemaTypeName) throws Exception {

        CorbaTypeImpl corbatype = processAllType(all, defaultName, schemaTypeName);
        MemberType member = new MemberType();
        member.setName(corbatype.getQName().getLocalPart());
        member.setIdltype(corbatype.getQName());
        if (corbatype.isSetQualified() && corbatype.isQualified()) {
            member.setQualified(true);
        }
        return member;
    }
View Full Code Here


        } else {
            choicename = createQNameCorbaNamespace(schemaTypeName.getLocalPart());
        }
        choicename = checkPrefix(choicename);

        CorbaTypeImpl corbatype = createUnion(choicename, choice, defaultName, schemaTypeName);
        String repoId = REPO_STRING + corbatype.getQName().getLocalPart().replace('.', '/')
            + IDL_VERSION;
        ((Union)corbatype).setRepositoryID(repoId);

        if (!(choice.getMaxOccurs() == 1) || !(choice.getMinOccurs() == 1)) {
            QName name = createQNameTargetNamespace(corbatype.getQName().getLocalPart() + "Array");
            CorbaTypeImpl arrayType =
                createArray(name, corbatype.getQName(), corbatype.getQName(),
                            choice.getMaxOccurs(), choice.getMinOccurs(), false);

            if (arrayType != null
                && !isDuplicate(arrayType)) {
View Full Code Here

        }
        return corbatype;
    }

    private CorbaTypeImpl processLocalElement(XmlSchemaElement element, String uri) throws Exception {
        CorbaTypeImpl membertype = new CorbaTypeImpl();
        CorbaTypeImpl memtype = new CorbaTypeImpl();

        XmlSchemaType schemaType = element.getSchemaType();
        QName schemaName = element.getQName();
        if (schemaType == null) {
            if (element.getRef().getTarget() != null) {
                schemaType = findSchemaType(element.getRef().getTarget().getSchemaTypeName());
                schemaName = element.getRef().getTargetQName();
            } else {
                schemaType = findSchemaType(element.getSchemaTypeName());
            }
        }
        if (schemaName.getNamespaceURI().equals("")) {
            schemaName = new QName(uri, schemaName.getLocalPart());
        }
        QName elemName = schemaName;
        boolean elementQualified = getElementQualification(element, uri);
        if (!elementQualified) {
            elemName = new QName("", elemName.getLocalPart());
        }

        QName memName = null;
        if (element.isNillable()) {
            CorbaTypeImpl elemtype = convertSchemaToCorbaType(schemaType, elemName,
                                                              schemaType, null, true);
            QName name = createQNameTargetNamespace(elemtype.getQName().getLocalPart() + "_nil");
            QName elName = checkPrefix(elemName);
            if (elName ==  null) {
                elName = createQNameTargetNamespace(elemName.getLocalPart());
            }
            memtype = createNillableUnion(elName,
                                          name,
                                          elemtype.getQName(),
                                          elementQualified);
            memName = createQNameCorbaNamespace(memtype.getQName().getLocalPart());

            if (memtype != null
                && !isDuplicate(memtype)) {
                typeMappingType.getStructOrExceptionOrUnion().add(memtype);
            }
            membertype.setQName(memName);
            membertype.setName(memtype.getName());
            membertype.setType(memtype.getType());
        } else if (schemaType != null) {
            XmlSchemaType st = schemaType;
            boolean anonymous = WSDLTypes.isAnonymous(st.getName());
            membertype = convertSchemaToCorbaType(st, elemName, st, null, anonymous);
        } else if (element.getSchemaTypeName() != null) {
            QName name = checkPrefix(element.getSchemaTypeName());
            membertype = getLocalType(name);
        }
        if (membertype == null) {
            return null;
        }

        if (!(element.getMaxOccurs() == 1) || !(element.getMinOccurs() == 1)) {
            QName name = createQNameCorbaNamespace(getModulePrefix(membertype)
                                                    + elemName.getLocalPart() + "Array");
            CorbaTypeImpl arraytype = null;
            if (memName != null) {
                arraytype = createArray(name, schemaName, memName, elemName,
                                        element.getMaxOccurs(), element.getMinOccurs(), false);
            } else {
                arraytype = createArray(name, schemaName, membertype.getQName(), elemName,
                                        element.getMaxOccurs(), element.getMinOccurs(), false);
            }

            membertype.setName(arraytype.getName());
            membertype.setQName(arraytype.getQName());
            membertype.setType(arraytype.getType());

            if (arraytype != null
                && !isDuplicate(arraytype)) {
                typeMappingType.getStructOrExceptionOrUnion().add(arraytype);
            }
View Full Code Here


    protected CorbaTypeImpl processSequenceType(XmlSchemaSequence seq,
                                                QName defaultName, QName schemaTypeName)
        throws Exception {
        CorbaTypeImpl type = null;
        QName seqName = null;
        if (schemaTypeName == null) {
            seqName = createQNameCorbaNamespace(defaultName.getLocalPart() + "SequenceStruct");
        } else {
            seqName = createQNameCorbaNamespace(schemaTypeName.getLocalPart() + "SequenceStruct");
        }

        schemaTypeName = checkPrefix(schemaTypeName);
        Struct struct = new Struct();
        struct.setName(seqName.getLocalPart());
        struct.setQName(seqName);
        struct.setRepositoryID(REPO_STRING + seqName.getLocalPart().replace('.', '/') + IDL_VERSION);
        struct.setType(schemaTypeName);

        List members = processContainerAsMembers(seq, defaultName, schemaTypeName);
        for (Iterator iterator = members.iterator(); iterator.hasNext();) {
            MemberType memberType = (MemberType)iterator.next();
            struct.getMember().add(memberType);
        }

        type = struct;

        if (seq.getMaxOccurs() != 1 || seq.getMinOccurs() != 1) {
            QName name = createQNameTargetNamespace(type.getQName().getLocalPart() + "Array");
            CorbaTypeImpl atype = createArray(name, type.getQName(), type.getQName(),
                                              seq.getMaxOccurs(), seq.getMinOccurs(), false);

            if (atype != null
                && !isDuplicate(atype)) {
                typeMappingType.getStructOrExceptionOrUnion().add(atype);
View Full Code Here

        return type;
    }

    private CorbaTypeImpl processPrimitiveType(QName typeName) {
        QName qName = createQNameXmlSchemaNamespace(typeName.getLocalPart());
        CorbaTypeImpl corbatype = (CorbaTypeImpl)CORBAPRIMITIVEMAP.get(qName);
        if (corbatype == null) {
            //REVISIT, bravi, not an ideal way to add the fixed & octet type to the typemap.
            CorbaTypeImpl type = null;
            if (typeName.equals(W3CConstants.NT_SCHEMA_DECIMAL)) {
                QName name = new QName(idlNamespace, "fixed_1");
                type = WSDLTypes.getFixedCorbaType(name, typeName, 31, 6);
                corbatype = WSDLTypes.getFixedCorbaType(name, typeName, 31, 6);
            } else if (typeName.equals(W3CConstants.NT_SCHEMA_BASE64)
View Full Code Here

            XmlSchemaAttribute attribute = (XmlSchemaAttribute) aog;
            QName attrName = attribute.getQName();
            if (attrName.getNamespaceURI().equals("")) {
                attrName = new QName(uri, attrName.getLocalPart());
            }
            CorbaTypeImpl membertype = null;
            boolean attrQualified = getAttributeQualification(attribute, uri);
            if (attribute.getUse() == XmlSchemaUse.NONE
                || attribute.getUse() == XmlSchemaUse.OPTIONAL) {
                CorbaTypeImpl attType = null;
                if (attribute.getSchemaType() != null) {
                    // REVISIT, edell bug in XmlSchema 1.2.
                    // https://issues.apache.org/jira/browse/WSCOMMONS-208
                    attType = convertSchemaToCorbaType(attribute.getSchemaType(),
                                                       checkPrefix(attrName),
                                                       attribute.getSchemaType(),
                                                       null, true);
                    if (attType != null) {
                        QName typeName = attType.getQName();
                        if (!isDuplicate(attType)) {
                            typeMappingType.getStructOrExceptionOrUnion().add(attType);
                        }
                        QName name =  createQNameTargetNamespace(typeName.getLocalPart() + "_nil");
                        membertype = createNillableUnion(name,
                                                         checkPrefix(attrName),
                                                         createQNameCorbaNamespace(typeName.getLocalPart()),
                                                         attrQualified);
                    }
                } else {
                    attType = processPrimitiveType(attribute.getSchemaTypeName());
                    //REVISIT, bravi, attType is null for the wsaddr type
                    //{http://www.w3.org/2005/08/addressing}RelationshipTypeOpenEnum
                    if (attType != null) {
                        QName name =  createQNameTargetNamespace(attType.getQName().getLocalPart() + "_nil");
                        //REVISIT, Edell - bug in Xmlschema 1.2
                        // https://issues.apache.org/jira/browse/WSCOMMONS-208
                        membertype = createNillableUnion(name,
                                                         checkPrefix(attrName),
                                                         attType.getQName(),
                                                         attrQualified);
                    }

                }
                if (membertype != null) {
View Full Code Here

            name = stype.getQName().getLocalPart();
        }
        if (schemaTypeName == null) {
            schemaTypeName = createQNameTargetNamespace(name);
        }
        CorbaTypeImpl result = convertSchemaToCorbaType(schemaType, schemaTypeName,
                                                        schemaType, null, false);

        result.setQualified(getElementQualification(stype, uri));
        return result;
    }
View Full Code Here

    private CorbaTypeImpl processSimpleType(XmlSchemaSimpleType stype, QName defaultName,
                                            boolean anonymous)
        throws Exception {

        CorbaTypeImpl corbaTypeImpl = null;
        QName name;
        QName schematypeName = null;

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

        if (stype.getParent().getTargetNamespace().equals(W3CConstants.NU_SCHEMA_XSD)) {
            // built in types
            QName stypeName = createQNameXmlSchemaNamespace(stype.getName());
            corbaTypeImpl = getLocalType(stypeName);
        } else if (stype.getContent() instanceof XmlSchemaSimpleTypeRestriction) {
            corbaTypeImpl = processSimpleRestrictionType(stype, name, schematypeName, anonymous);
        } else if (stype.getContent() instanceof XmlSchemaSimpleTypeList) {
            XmlSchemaSimpleTypeList ltype = (XmlSchemaSimpleTypeList)stype.getContent();
            CorbaTypeImpl itemType = null;
            if (ltype.getItemType() != null) {
                itemType = convertSchemaToCorbaType(ltype.getItemType(), name, stype, null, false);
                if (itemType != null) {
                    return WSDLTypes.mapToSequence(name, checkPrefix(schematypeName),
                                                   itemType.getQName(), null, 0, false);
                }
                return itemType;
            }
            QName ltypeName = createQNameXmlSchemaNamespace(ltype.getItemTypeName().getLocalPart());
            itemType = processPrimitiveType(ltypeName);
            if (itemType != null) {
                return WSDLTypes.mapToSequence(name, checkPrefix(schematypeName),
                                           itemType.getQName(), null, 0, false);
            } else {
                // if the type of the simpleContent is a list with another simple type.
                XmlSchemaType base = getSchemaType(ltype.getItemTypeName());
                itemType = convertSchemaToCorbaType(base, base.getQName(), base, null, false);
                if (itemType != null) {
                    return WSDLTypes.mapToSequence(name, checkPrefix(schematypeName),
                                                   itemType.getQName(), null, 0, false);
                }
            }
        } else if (stype.getContent() == null) {
            // elements primitive type
            QName stypeName = createQNameXmlSchemaNamespace(stype.getName());
View Full Code Here

    private CorbaTypeImpl processSimpleRestrictionType(XmlSchemaSimpleType stype,
                                                       QName name, QName schematypeName,
                                                       boolean anonymous)
        throws Exception {
        CorbaTypeImpl corbaTypeImpl = null;

        // checks if enumeration
        XmlSchemaSimpleTypeRestriction restrictionType = (XmlSchemaSimpleTypeRestriction)stype
            .getContent();

        QName baseName = checkPrefix(restrictionType.getBaseTypeName());

        String maxLength = null;
        String length = null;

        for (XmlSchemaFacet val : restrictionType.getFacets()) {
            if (val instanceof XmlSchemaMaxLengthFacet) {
                maxLength = val.getValue().toString();
            }
            if (val instanceof XmlSchemaLengthFacet) {
                length = val.getValue().toString();
            }
        }

        if (isEnumeration(restrictionType)) {
            corbaTypeImpl = createCorbaEnum(restrictionType, name, schematypeName);
        } else {
            if (restrictionType.getBaseType() != null) {
                corbaTypeImpl = convertSchemaToCorbaType(restrictionType.getBaseType(), schematypeName,
                                                         stype, null, false);
            } else {
                corbaTypeImpl = processPrimitiveType(baseName);
                if (corbaTypeImpl == null) {
                    XmlSchemaType schematype = findSchemaType(baseName);
                    corbaTypeImpl = convertSchemaToCorbaType(schematype, schematypeName,
                                                             schematype, null, false);
                }
            }

            if (corbaTypeImpl != null) {
                if (corbaTypeImpl.getType().equals(W3CConstants.NT_SCHEMA_STRING)
                    || (baseName.equals(W3CConstants.NT_SCHEMA_STRING))) {
                    corbaTypeImpl =
                        WSDLTypes.processStringType(corbaTypeImpl, name, maxLength, length);
                } else if (corbaTypeImpl.getType().equals(W3CConstants.NT_SCHEMA_DECIMAL)
                    || (baseName.equals(W3CConstants.NT_SCHEMA_DECIMAL))) {
                    corbaTypeImpl = WSDLTypes.processDecimalType(restrictionType, name,
                                                             corbaTypeImpl, anonymous);
                } else if ((corbaTypeImpl.getType().equals(W3CConstants.NT_SCHEMA_BASE64))
                    || (baseName.equals(W3CConstants.NT_SCHEMA_BASE64))
                    || (corbaTypeImpl.getType().equals(W3CConstants.NT_SCHEMA_HBIN))
                    || (corbaTypeImpl.getType().equals(W3CConstants.NT_SCHEMA_HBIN))) {
                    corbaTypeImpl = WSDLTypes.processBase64Type(corbaTypeImpl,
                                                                name, maxLength, length);
                }
            }
        }
View Full Code Here


    private CorbaTypeImpl processComplexType(XmlSchemaComplexType complex, QName defaultName,
                                             XmlSchemaAnnotation annotation,
                                             boolean anonymous) throws Exception {
        CorbaTypeImpl corbatype = null;
        if (isLiteralArray(complex)) {
            corbatype = processLiteralArray(complex, defaultName, anonymous);
        } else if (WSDLTypes.isOMGUnion(complex)) {
            corbatype = processOMGUnion(complex, defaultName);
        } else if (WSDLTypes.isUnion(complex)) {
View Full Code Here

TOP

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

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.