Package org.apache.ws.commons.schema

Examples of org.apache.ws.commons.schema.XmlSchemaComplexType


                                                                                  QName schemaTypeName,
                                                                                  XmlSchemaType stype,
                                                                                  QName elementName)  
        throws Exception {
        org.apache.schemas.yoko.bindings.corba.Exception corbaex = null;
        XmlSchemaComplexType complex = null;

        if (stype instanceof XmlSchemaComplexType) {
            complex = (XmlSchemaComplexType)stype;
            corbaex = new org.apache.schemas.yoko.bindings.corba.Exception();
            corbaex.setName(name.getLocalPart());
            corbaex.setQName(schemaTypeName);
            corbaex.setType(helper.checkPrefix(stype.getQName()));
            corbaex.setRepositoryID(helper.REPO_STRING + "/" + name.getLocalPart() + helper.IDL_VERSION);
           
            List attributeMembers = helper.processAttributesAsMembers(complex.getAttributes().getIterator());
            Iterator iterator = attributeMembers.iterator();
            while (iterator.hasNext()) {
                MemberType memberType = (MemberType)iterator.next();
                corbaex.getMember().add(memberType);
            }           
            List members = helper.processContainerAsMembers(complex.getParticle(),
                                                            stype.getQName(),
                                                            schemaTypeName);
            Iterator it = members.iterator();
            while (it.hasNext()) {
                MemberType memberType = (MemberType)it.next();
View Full Code Here


                                                  XmlSchemaObject schemaType,
                                                  List<CorbaTypeMap> typeMaps,
                                                  ServiceInfo serviceInfo) {
        Exception exceptType = (Exception)obj.getType();
        List<MemberType> exceptMembers = exceptType.getMember();
        XmlSchemaComplexType ctype = (XmlSchemaComplexType) schemaType;
        QName qname = name;
        if (ctype.getQName() != null) {
            qname = ctype.getQName();
        }
        String nsURI = getNamespaceURI(serviceInfo, qname);
        XmlSchemaGroupBase group = (XmlSchemaGroupBase) ctype.getParticle();
        for (int i = 0; i < exceptMembers.size(); ++i) {
            MemberType member = exceptMembers.get(i);
            QName memberName = new QName(nsURI, member.getName());
            QName memberType = member.getIdltype();
            CorbaObjectHandler memberObj = initializeObjectHandler(orb,
View Full Code Here

            if (stype == null) {
                stype = CorbaUtils.getXmlSchemaType(serviceInfo, el.getRefName());
            }
        }
        if (stype instanceof XmlSchemaComplexType) {
            XmlSchemaComplexType ctype = (XmlSchemaComplexType) stype;
            if (ctype.getQName() != null) {
                qname = ctype.getQName();
            }
            attrs = ctype.getAttributes();
            stype = ctype.getParticle();
        }
        if (stype instanceof XmlSchemaGroupRef) {
            members = ((XmlSchemaGroupRef) stype).getParticle().getItems();
        } else if (stype instanceof XmlSchemaGroupBase) {
            members = ((XmlSchemaGroupBase) stype).getItems();
View Full Code Here

            }
        }
       
        if (stype instanceof XmlSchemaComplexType) {
            //only one element inside the XmlSchemaComplexType
            XmlSchemaComplexType ctype = (XmlSchemaComplexType) stype;
            XmlSchemaGroupBase group = (XmlSchemaGroupBase) ctype.getParticle();
            el = (XmlSchemaElement) group.getItems().getItem(0);
        } else {
            el = (XmlSchemaElement) schemaType;
        }
        return el;
View Full Code Here

    }

    private Iterator getSchemaIterator(XmlSchemaType schemaType) {

        if (schemaType instanceof XmlSchemaComplexType) {
            XmlSchemaComplexType cpt = (XmlSchemaComplexType) schemaType;
            XmlSchemaParticle particle = null;
            if (cpt.getParticle() != null) {
                particle = (XmlSchemaParticle) cpt.getParticle();

                if (particle instanceof XmlSchemaSequence) {
                    XmlSchemaSequence seq = (XmlSchemaSequence) particle;
                    return seq.getItems().getIterator();
                } else if (particle instanceof XmlSchemaChoice) {
                    XmlSchemaChoice choice = (XmlSchemaChoice) particle;
                    return choice.getItems().getIterator();
                }
            }
            if (cpt.getContentModel() != null) {
                XmlSchemaContentModel xscm = (XmlSchemaContentModel) cpt
                        .getContentModel();
                if (xscm instanceof XmlSchemaComplexContent) {
                    XmlSchemaComplexContent xscc = (XmlSchemaComplexContent) xscm;

                    XmlSchemaComplexContentExtension ext = null;
View Full Code Here

            if (!(schemaType instanceof XmlSchemaComplexType)) {
                return true;
            }

            XmlSchemaComplexType cpt = (XmlSchemaComplexType) schemaType;
            return checkComplex(cpt);
        }

        return false;
View Full Code Here

            if (!(schemaType instanceof XmlSchemaComplexType)) {
                return true;
            }

            XmlSchemaComplexType cpt = (XmlSchemaComplexType) schemaType;
            return checkComplex(cpt);
        }

        return false;
View Full Code Here

        Scope unionScope = new Scope(getScope(), identifierNode);
        AST discriminatorNode = identifierNode.getNextSibling();
        AST caseNode = discriminatorNode.getNextSibling();

        // xmlschema:union
        XmlSchemaComplexType unionSchemaComplexType = new XmlSchemaComplexType(schema);
        XmlSchemaSequence sequence = new XmlSchemaSequence();
        unionSchemaComplexType.setName(unionScope.toString());
        unionSchemaComplexType.setParticle(sequence);
       
        // REVISIT
        // TEMPORARILY
        // using TypesVisitor to visit <const_type>
        // it should be visited by a SwitchTypeSpecVisitor
        TypesVisitor visitor = new TypesVisitor(getScope(), schemas, schema, typeMap, null);
        visitor.visit(discriminatorNode);
        XmlSchemaType stype = visitor.getSchemaType();
        CorbaTypeImpl ctype = visitor.getCorbaType();
       
        XmlSchemaElement discriminatorElement = new XmlSchemaElement();
        discriminatorElement.setName(discriminator);
        discriminatorElement.setSchemaTypeName(stype.getQName());
        discriminatorElement.setMinOccurs(1);
        discriminatorElement.setMaxOccurs(1);
        sequence.getItems().add(discriminatorElement);
       
        XmlSchemaChoice choice = new XmlSchemaChoice();
        choice.setMinOccurs(1);
        choice.setMaxOccurs(1);
        sequence.getItems().add(choice);
       
       
        // corba:union
        Union corbaUnion = new Union();
        corbaUnion.setQName(new QName(typeMap.getTargetNamespace(), unionScope.toString()));
        corbaUnion.setRepositoryID(unionScope.toIDLRepositoryID());
        corbaUnion.setType(unionSchemaComplexType.getQName());
        corbaUnion.setDiscriminator(ctype.getQName());
       
        processCaseNodes(caseNode, unionScope, choice, corbaUnion);

        // add schemaType
View Full Code Here

        }

    }
   
    private XmlSchemaComplexType duplicateXmlSchemaComplexType(Scope newScope) {
        XmlSchemaComplexType oldSchemaType = (XmlSchemaComplexType) getSchemaType();
        XmlSchemaComplexType newSchemaType = new XmlSchemaComplexType(schema);

        newSchemaType.setName(newScope.toString());
        newSchemaType.setParticle(oldSchemaType.getParticle());

        return newSchemaType;
    }
View Full Code Here

        XmlSchemaSequence sequence = new XmlSchemaSequence();
        if (typeNode != null) {
            sequence.getItems().add(element);
        }
       
        XmlSchemaComplexType complex = new XmlSchemaComplexType(schema);
        complex.setParticle(sequence);
       
        XmlSchemaElement result = new XmlSchemaElement();
        result.setName(name);
        result.setQName(new QName(definition.getTargetNamespace(), name));
        result.setSchemaType(complex);
View Full Code Here

TOP

Related Classes of org.apache.ws.commons.schema.XmlSchemaComplexType

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.