Package org.apache.ws.commons.schema

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


        } else if (type.getParticle() == null) {
            if (type.getContentModel() == null) {
                return true;
            }
            if (type.getContentModel().getContent() instanceof XmlSchemaComplexContentExtension) {
                XmlSchemaComplexContentExtension extension = (XmlSchemaComplexContentExtension)type
                    .getContentModel().getContent();
                QName baseTypeName = extension.getBaseTypeName();
                ServiceInfo serviceInfo = wrapper.getOperation().getInterface().getService();
                XmlSchemaType schemaType = serviceInfo.getXmlSchemaCollection().getTypeByQName(baseTypeName);
                if (!(schemaType instanceof XmlSchemaComplexType)
                    || !isWrappableSequence((XmlSchemaComplexType)schemaType, namespaceURI, wrapper,
                                            allowRefs)) {
                    return false;
                }
                            
                if (extension.getParticle() instanceof XmlSchemaSequence) {
                    XmlSchemaSequence seq = (XmlSchemaSequence)extension.getParticle();
                    return buildMessageParts(seq, namespaceURI, wrapper, allowRefs);
               
               
            }
            return true;
View Full Code Here


    protected Struct processComplexContentStruct(XmlSchemaComplexContent complex, QName defaultName,
                                                 Struct corbaStruct, QName schematypeName)
        throws Exception {

        if (complex.getContent() instanceof XmlSchemaComplexContentExtension) {
            XmlSchemaComplexContentExtension extype
                = (XmlSchemaComplexContentExtension)complex.getContent();
            QName extName = extype.getBaseTypeName();
            corbaStruct = processComplexContentStructParticle(extype.getParticle(), defaultName, corbaStruct,
                                                         schematypeName, extName, extype.getAttributes());
        } else {
            if (complex.getContent() instanceof XmlSchemaComplexContentRestriction) {
                XmlSchemaComplexContentRestriction extype
                    = (XmlSchemaComplexContentRestriction)complex.getContent();
                QName extName = extype.getBaseTypeName();
                corbaStruct =
                    processComplexContentStructParticle(extype.getParticle(), defaultName,
                                                   corbaStruct, schematypeName,
                                                   extName, extype.getAttributes());
            }
        }
        return corbaStruct;
    }
View Full Code Here

        } else if (type.getParticle() == null) {
            if (type.getContentModel() == null) {
                return true;
            }
            if (type.getContentModel().getContent() instanceof XmlSchemaComplexContentExtension) {
                XmlSchemaComplexContentExtension extension = (XmlSchemaComplexContentExtension)type
                    .getContentModel().getContent();
                QName baseTypeName = extension.getBaseTypeName();
                ServiceInfo serviceInfo = wrapper.getOperation().getInterface().getService();
                XmlSchemaType schemaType = serviceInfo.getXmlSchemaCollection().getTypeByQName(baseTypeName);
                if (!(schemaType instanceof XmlSchemaComplexType)
                    || !isWrappableSequence((XmlSchemaComplexType)schemaType, namespaceURI, wrapper,
                                            allowRefs)) {
                    return false;
                }
                            
                if (extension.getParticle() instanceof XmlSchemaSequence) {
                    XmlSchemaSequence seq = (XmlSchemaSequence)extension.getParticle();
                    return buildMessageParts(seq, namespaceURI, wrapper, allowRefs);
               
               
            }
            return true;
View Full Code Here

        XmlSchemaContentModel contentModel = cmplxType.getContentModel();
        if (contentModel instanceof XmlSchemaComplexContent) {
            XmlSchemaComplexContent xmlSchemaComplexContent = (XmlSchemaComplexContent) contentModel;
            XmlSchemaContent content = xmlSchemaComplexContent.getContent();
            if (content instanceof XmlSchemaComplexContentExtension) {
                XmlSchemaComplexContentExtension schemaExtension = (XmlSchemaComplexContentExtension) content;

                // process particles inside this extension, if any
                if (schemaExtension.getParticle() != null) {
                    processXMLSchemaSequence(schemaExtension.getParticle(), message, partNameList,
                            qnameSuffix);
                }

                // now we need to get the schema of the extension type from the parent schema. For that let's first retrieve
                // the parent schema
                AxisService axisService = message.getAxisOperation().getAxisService();
                ArrayList schemasList = axisService.getSchema();

                XmlSchema parentSchema = null;

                XmlSchema schema = null;
                XmlSchemaType extensionSchemaType = null;
                for (Iterator iter = schemasList.iterator(); iter.hasNext();) {
                    schema = (XmlSchema) iter.next();
                    extensionSchemaType = getSchemaType(schema, schemaExtension.getBaseTypeName());
                    if (extensionSchemaType != null) {
                        break;
                    }
                }
View Full Code Here

        XmlSchema attributeTypeSchema = newSchema(ATTRIBUTE_TYPE_SCHEMA);

        createBaseType1(baseTypeSchema1);

        createBaseType2(baseTypeSchema2);
        XmlSchemaComplexContentExtension derivedType1Extension = createDerivedType1(importingSchema);
        createDerivedType2(importingSchema);

        createImportedElement(elementSchema);

        createTypeImportingElement(importingSchema);

        createTypeImportedByElement(elementTypeSchema);

        createElementWithImportedType(importingSchema);

        createImportedAttribute(attributeSchema);

        XmlSchemaAttribute importingAttribute = new XmlSchemaAttribute(importingSchema, false);
        importingAttribute.getRef().setTargetQName(new QName(ATTRIBUTE_SCHEMA, "imported"));
        // borrow derivedType1 to make the reference.
        derivedType1Extension.getAttributes().add(importingAttribute);

        createImportedAttributeType(attributeTypeSchema);

        createAttributeImportingType(importingSchema);
View Full Code Here

    }

    private XmlSchemaComplexContentExtension createDerivedType1(XmlSchema importingSchema) {
        XmlSchemaComplexType derivedType1 = new XmlSchemaComplexType(importingSchema, true);
        derivedType1.setName("derivedExtension");
        XmlSchemaComplexContentExtension extension = new XmlSchemaComplexContentExtension();
        extension.setBaseTypeName(new QName(BASE_TYPE_SCHEMA1, "baseType1"));
        XmlSchemaComplexContent complexContent = new XmlSchemaComplexContent();
        complexContent.setContent(extension);
        derivedType1.setContentModel(complexContent);
        return extension;
    }
View Full Code Here

        if (!(content instanceof XmlSchemaComplexContentExtension)) {
            return null;
        }

        XmlSchemaComplexContentExtension ext = (XmlSchemaComplexContentExtension)content;
        return ext.getBaseTypeName();
    }
View Full Code Here

        if (!(content instanceof XmlSchemaComplexContentExtension)) {
            return null;
        }

        //TODO: the anyAttribute case.
        XmlSchemaComplexContentExtension ext = (XmlSchemaComplexContentExtension)content;
        return ext.getAttributes();
    }
View Full Code Here

        XmlSchemaContent content = contentModel.getContent();
        if (content == null) {
            return;
        }
        if (content instanceof XmlSchemaComplexContentExtension) {
            XmlSchemaComplexContentExtension extension = (XmlSchemaComplexContentExtension)content;
            XmlSchemaUtils.addImportIfNeeded(schema, extension.getBaseTypeName());
            addCrossImportsAttributeList(schema, extension.getAttributes());
            XmlSchemaParticle particle = extension.getParticle();
            if (particle instanceof XmlSchemaSequence) {
                addCrossImports(schema, (XmlSchemaSequence)particle);
            } else if (particle instanceof XmlSchemaChoice) {
                addCrossImports(schema, (XmlSchemaChoice)particle);
            } else if (particle instanceof XmlSchemaAll) {
                addCrossImports(schema, (XmlSchemaAll)particle);
            }
        } else if (content instanceof XmlSchemaComplexContentRestriction) {
            XmlSchemaComplexContentRestriction restriction = (XmlSchemaComplexContentRestriction)content;
            XmlSchemaUtils.addImportIfNeeded(schema, restriction.getBaseTypeName());
            addCrossImportsAttributeList(schema, restriction.getAttributes());
        } else if (content instanceof XmlSchemaSimpleContentExtension) {
            XmlSchemaSimpleContentExtension extension = (XmlSchemaSimpleContentExtension)content;
            XmlSchemaUtils.addImportIfNeeded(schema, extension.getBaseTypeName());
            addCrossImportsAttributeList(schema, extension.getAttributes());
        } else if (content instanceof XmlSchemaSimpleContentRestriction) {
            XmlSchemaSimpleContentRestriction restriction = (XmlSchemaSimpleContentRestriction)content;
            XmlSchemaUtils.addImportIfNeeded(schema, restriction.getBaseTypeName());
            addCrossImportsAttributeList(schema, restriction.getAttributes());
        }
View Full Code Here

        }
        if (!(content instanceof XmlSchemaComplexContentExtension)) {
            return null;
        }

        XmlSchemaComplexContentExtension ext = (XmlSchemaComplexContentExtension)content;
        XmlSchemaParticle particle = ext.getParticle();
        if (particle == null) {
            return null;
        }
        XmlSchemaSequence sequence = null;
        try {
View Full Code Here

TOP

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

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.