Package org.apache.ws.commons.schema

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


                                   TypeMapper typeMap) {
        XmlSchemaObjectCollection xmlObjectCollection = complexType.getAttributes();
        XmlSchemaObject item;
        for (Iterator iter = xmlObjectCollection.getIterator(); iter.hasNext();) {
            item = (XmlSchemaObject) iter.next();
            XmlSchemaAttribute xmlSchemaAttribute;
            if (item instanceof XmlSchemaAttribute) {
                xmlSchemaAttribute = (XmlSchemaAttribute) item;
                populateClassName(xmlSchemaAttribute.getMetaInfoMap(),
                        typeMap,
                        opName,
                        false,
                        xmlSchemaAttribute.getName(),
                        qnameSuffix);
            }

        }
View Full Code Here


        boolean howdy = false;
        boolean bleh = false;
        for (int x = 0; x < stype.getAttributes().getCount(); x++) {
            XmlSchemaObject o = stype.getAttributes().getItem(x);
            if (o instanceof XmlSchemaAttribute) {
                XmlSchemaAttribute a = (XmlSchemaAttribute)o;
                if ("howdy".equals(a.getName())) {
                    howdy = true;
                }
                if ("bleh".equals(a.getName())) {
                    bleh = true;
                }
            }
        }
        assertTrue(howdy);
View Full Code Here

        }

        for (int x = 0; x < stype.getAttributes().getCount(); x++) {
            XmlSchemaObject o = stype.getAttributes().getItem(x);
            if (o instanceof XmlSchemaAttribute) {
                XmlSchemaAttribute a = (XmlSchemaAttribute)o;
                if ("howdy".equals(a.getName())) {
                    howdy = true;
                }
            }
        }
View Full Code Here

        boolean howdy = false;
        boolean bleh = false;
        for (int x = 0; x < stype.getAttributes().size(); x++) {
            XmlSchemaObject o = stype.getAttributes().get(x);
            if (o instanceof XmlSchemaAttribute) {
                XmlSchemaAttribute a = (XmlSchemaAttribute)o;
                if ("howdy".equals(a.getName())) {
                    howdy = true;
                }
                if ("bleh".equals(a.getName())) {
                    bleh = true;
                }
            }
        }
        assertTrue(howdy);
View Full Code Here

        }

        for (int x = 0; x < stype.getAttributes().size(); x++) {
            XmlSchemaObject o = stype.getAttributes().get(x);
            if (o instanceof XmlSchemaAttribute) {
                XmlSchemaAttribute a = (XmlSchemaAttribute)o;
                if ("howdy".equals(a.getName())) {
                    howdy = true;
                }
            }
        }
View Full Code Here

        Set<String> s = new HashSet<String>();
        s.add("type");
        s.add("units");
        for (Iterator i = attributes.iterator(); i.hasNext();) {
            XmlSchemaAttribute xsa = (XmlSchemaAttribute)i.next();
            assertTrue(s.remove(xsa.getName()));
        }

        assertTrue("The set should have been empty, but instead contained: " + s + ".", s.isEmpty());

    }
View Full Code Here

            assertEquals("department", group.getName());
            List<XmlSchemaAttributeGroupMember> attributes = group.getAttributes();
            assertNotNull(attributes);
            assertEquals(2, attributes.size());
            for (Iterator j = attributes.iterator(); j.hasNext();) {
                XmlSchemaAttribute obj2 = (XmlSchemaAttribute)j.next();
                String name = obj2.getName();
                if ("id".equals(name)) {
                    assertEquals(new QName("http://soapinterop.org/types", "id"), obj2.getQName());
                    assertEquals(new QName("http://www.w3.org/2001/XMLSchema", "integer"), obj2
                        .getSchemaTypeName());
                } else if ("name".equals(name)) {
                    assertEquals(new QName("http://soapinterop.org/types", "name"), obj2.getQName());
                    assertEquals(new QName("http://www.w3.org/2001/XMLSchema", "string"), obj2
                        .getSchemaTypeName());
                } else {
                    fail("The name \"" + name + "\" should not have been found " + "for an attribute.");

                }
View Full Code Here

        for (XmlSchemaAttributeOrGroupRef aog : list) {
            if (!(aog instanceof XmlSchemaAttribute)) {
                LOG.warning(aog.getClass() + " not supported in CORBA binding.  Skipping.");
                continue;
            }
            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) {
                    memName = createQNameCorbaNamespace(membertype.getQName().getLocalPart());
                    if (!isDuplicate(membertype)) {
                        typeMappingType.getStructOrExceptionOrUnion().add(membertype);
                    }
                }
            } else {
                if (attribute.getSchemaType() != null) {
                    membertype = convertSchemaToCorbaType(attribute.getSchemaType(), attrName,
                                                          attribute.getSchemaType(), null, false);
                } else {
                    membertype = processPrimitiveType(attribute.getSchemaTypeName());
                }
            }

            if (membertype != null) {
                MemberType member;
View Full Code Here

            sequence.getItems().add(any);
        }

        // Write out schema for attributes
        for (QName name : inf.getAttributes()) {
            XmlSchemaAttribute attribute = new XmlSchemaAttribute(root, false);
            complex.getAttributes().add(attribute);
            attribute.setName(name.getLocalPart());
            AegisType type = getType(inf, name);
            attribute.setSchemaTypeName(type.getSchemaType());
            String ns = name.getNamespaceURI();
            if (!ns.equals(root.getTargetNamespace())) {
                XmlSchemaUtils.addImportIfNeeded(root, ns);
            }
        }
View Full Code Here

                XmlSchemaObjectCollection attributes =
                    ((XmlSchemaAttributeGroup)obj1).getAttributes();
                assertNotNull(attributes);
                assertEquals(2, attributes.getCount());
                for (Iterator j = attributes.getIterator(); j.hasNext(); ) {
                    XmlSchemaAttribute obj2 = (XmlSchemaAttribute)j.next();
                    String name = obj2.getName();
                    if (name.equals("id")) {
                        assertEquals(new QName("http://soapinterop.org/types", "id"),
                                     obj2.getQName());
                        assertEquals(new QName("http://www.w3.org/2001/XMLSchema",
                                               "integer"), obj2.getSchemaTypeName());
                    } else if (name.equals("name")) {
                        assertEquals(new QName("http://soapinterop.org/types", "name"),
                                     obj2.getQName());
                        assertEquals(new QName("http://www.w3.org/2001/XMLSchema",
                                               "string"), obj2.getSchemaTypeName());
                    } else {
                        fail("The name \"" + name + "\" should not have been found "
                             + "for an attribute.");

                    }
View Full Code Here

TOP

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

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.