Examples of XmlSchemaElement


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

        QName elementQName = new QName("http://soapinterop.org/types", "constraintTest");
        InputStream is = new FileInputStream(Resources.asURI("constraints.xsd"));
        XmlSchemaCollection schemaCol = new XmlSchemaCollection();
        schemaCol.read(new StreamSource(is));

        XmlSchemaElement elem = schemaCol.getElementByQName(elementQName);
        assertNotNull(elem);
        assertEquals("constraintTest", elem.getName());
        assertEquals(new QName("http://soapinterop.org/types", "constraintTest"), elem.getQName());

        List<XmlSchemaIdentityConstraint> c = elem.getConstraints();
        assertEquals(3, c.size());

        Set<String> s = new HashSet<String>();
        s.add(XmlSchemaKey.class.getName());
        s.add(XmlSchemaKeyref.class.getName());
View Full Code Here

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

            if (stype.getItems().getCount() == 2) {
                Iterator it = stype.getItems().getIterator();
                XmlSchemaParticle st1 = (XmlSchemaParticle)it.next();
                XmlSchemaParticle st2 = (XmlSchemaParticle)it.next();
                XmlSchemaElement discEl = null;

                if (st1 instanceof XmlSchemaChoice && st2 instanceof XmlSchemaElement) {
                    isUnion = true;
                    discEl = (XmlSchemaElement)st2;
                } else if (st2 instanceof XmlSchemaChoice && st1 instanceof XmlSchemaElement) {
                    isUnion = true;
                    discEl = (XmlSchemaElement)st1;
                }
                if (isUnion && !"discriminator".equals(discEl.getQName().getLocalPart())) {
                    isUnion = false;
                }               
            }
        }
        return isUnion;
View Full Code Here

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

            List<ParamType> inputs, Iterator it, Iterator iter)
        throws Exception {
        if (it != null) {
            while (it.hasNext()) {
                if (it.next() instanceof XmlSchemaElement) {
                    XmlSchemaElement el = (XmlSchemaElement) iter.next();
                    addParam(wsdlToCorbaBinding, el.getSchemaType(), el
                            .getQName().getLocalPart(), el.getSchemaTypeName(),
                            el.isNillable(), inputs);
                }
            }
        }
    }
View Full Code Here

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

            while (i.hasNext()) {
                Part part = (Part) i.next();
                XmlSchemaType schemaType = null;
                schemaType = lookUpType(part, xmlSchemaList);
                if (part.getElementName() != null) {
                    XmlSchemaElement el = getElement(part, xmlSchemaList);
                    addParam(wsdlToCorbaBinding, schemaType, part.getName(),
                            part.getElementName(), el.isNillable(), inputs);
                } else if (part.getTypeName() != null) {
                    addParam(wsdlToCorbaBinding, schemaType, part.getName(),
                            part.getTypeName(), false, inputs);
                }
            }
View Full Code Here

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

                        Iterator it = getSchemaIterator(schemaType);
                        Iterator iter = getSchemaIterator(schemaType);
                        updateLists(wsdlToCorbaBinding, inputs, outputs, it,
                                iter);
                    } else {
                        XmlSchemaElement el = getElement(part, xmlSchemaList);
                        if (schemaType == null) {
                            updateList(wsdlToCorbaBinding, schemaType, part
                                    .getName(), el.getSchemaTypeName(), inputs,
                                    outputs, el.isNillable());
                        } else {
                            updateList(wsdlToCorbaBinding, schemaType, part
                                    .getName(), part.getElementName(), inputs,
                                    outputs, el.isNillable());
                        }
                    }
                } else {
                    if (part.getTypeName() != null) {
                        updateList(wsdlToCorbaBinding, schemaType, part
View Full Code Here

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

            List<ParamType> inputs, List<ParamType> outputs, Iterator it,
            Iterator iter) throws Exception {
        if (it != null) {
            while (it.hasNext()) {
                if (it.next() instanceof XmlSchemaElement) {
                    XmlSchemaElement el = (XmlSchemaElement) iter.next();
                    updateList(wsdlToCorbaBinding, el.getSchemaType(), el
                            .getQName().getLocalPart(), el.getSchemaTypeName(),
                            inputs, outputs, el.isNillable());
                }
            }
        }
    }
View Full Code Here

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

                    if (part.getName() != null
                            && d2.getName().equals(part.getName())) {
                        inputs.remove(x);
                        if (part.getElementName() != null) {
                            XmlSchemaElement el = getElement(part,
                                    xmlSchemaList);
                            paramtype = createParam(wsdlToCorbaBinding,
                                    "inout", schemaType, part.getName(), part
                                            .getElementName(), el.isNillable());
                        } else {
                            paramtype = createParam(wsdlToCorbaBinding,
                                    "inout", schemaType, part.getName(), part
                                            .getTypeName(), false);
                        }
                        inputs.add(paramtype);
                    }
                }
                if (paramtype == null) {
                    if (part.getElementName() != null) {
                        XmlSchemaElement el = getElement(part, xmlSchemaList);
                        paramtype = createParam(wsdlToCorbaBinding, mode,
                                schemaType, part.getName(), part
                                        .getElementName(), el.isNillable());
                    } else {
                        paramtype = createParam(wsdlToCorbaBinding, mode,
                                schemaType, part.getName(), part.getTypeName(),
                                false);
                    }
View Full Code Here

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

        Iterator i = xmlSchemaList.iterator();
        while (i.hasNext()) {
            XmlSchema xmlSchemaType = (XmlSchema) i.next();

            if (part.getElementName() != null) {
                XmlSchemaElement schemaElement = xmlSchemaType
                        .getElementByName(part.getElementName());
                if (schemaElement == null) {
                    QName elName = part.getElementName();
                    String prefix = definition.getPrefix(elName
                            .getNamespaceURI());
                    QName name = new QName(elName.getNamespaceURI(), prefix
                            + ":" + elName.getLocalPart(), prefix);
                    schemaElement = xmlSchemaType.getElementByName(name);
                }
                if (schemaElement != null) {
                    if (schemaElement.getSchemaType() != null) {
                        schemaType = schemaElement.getSchemaType();
                    }
                }
            } else {
                if (part.getTypeName() != null) {
                    schemaType = xmlSchemaType
View Full Code Here

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

        return schemaType;
    }

    private static XmlSchemaElement getElement(Part part,
            List<XmlSchema> xmlSchemaList) throws Exception {
        XmlSchemaElement schemaElement = null;

        Iterator i = xmlSchemaList.iterator();
        while (i.hasNext()) {
            XmlSchema xmlSchemaType = (XmlSchema) i.next();
            if (part.getElementName() != null) {
View Full Code Here

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

    private void addCorbaElements(CorbaTypeImpl corbaTypeImpl,
                                  XmlSchema xmlSchemaTypes) throws Exception {
        XmlSchemaObjectTable elements = xmlSchemaTypes.getElements();                           
        Iterator i2 = elements.getValues();               
        while (i2.hasNext()) {               
            XmlSchemaElement el = (XmlSchemaElement)i2.next();
            boolean anonymous = false;
            if (el.getSchemaType() == null) {
                anonymous = true;
            } else {
                anonymous = WSDLTypes.isAnonymous(el.getSchemaType().getName());
            }
           
            if (el.getSchemaType() != null) {
                XmlSchemaAnnotation annotation = null;
                if (el.getAnnotation() != null) {
                    annotation = el.getAnnotation();
                }
                corbaTypeImpl =
                    helper.convertSchemaToCorbaType(el.getSchemaType(),
                                                    el.getQName(), el.getSchemaType(),
                                                    annotation, anonymous);
                if (el.isNillable()) {                           
                    QName uname = 
                        helper.createQNameCorbaNamespace(corbaTypeImpl.getQName().getLocalPart() + "_nil");
                    corbaTypeImpl = helper.createNillableUnion(uname,
                                                               helper.checkPrefix(el.getQName()),
                                                               helper.checkPrefix(corbaTypeImpl.getQName()));
                }
                if (corbaTypeImpl != null) {
                    if (corbaTypeImpl.getQName() != null) {
                        corbaTypeImpl.setQName(null);       
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.