Package org.apache.ws.commons.schema

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


        XmlSchema s = schema.read(new StreamSource(is));

        XmlSchemaComplexType typeByName = (XmlSchemaComplexType)s.getTypeByName(typeQName);
        assertNotNull(typeByName);

        XmlSchemaAttribute item = (XmlSchemaAttribute)typeByName.getAttributes().get(0);
        QName qName = item.getRef().getTargetQName();
        assertNotNull(qName);

        String namspace = qName.getNamespaceURI();
        assertEquals("http://tempuri.org/attribute", namspace);
View Full Code Here


            assertEquals("department", group.getName());
            List<XmlSchemaAttributeGroupMember> attributes = group.getAttributes();
            assertNotNull(attributes);
            assertEquals(2, attributes.size());
            for (Iterator<XmlSchemaAttributeGroupMember> 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

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

        // Write out schema for attributes
        for (QName name : inf.getAttributes()) {
            XmlSchemaAttribute attribute = new XmlSchemaAttribute();
            complex.getAttributes().add(attribute);
            attribute.setName(name.getLocalPart());
            Type 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

    }

    private void complexTypeSerializeAttributes(XmlSchemaComplexType type, String string) {
        XmlSchemaObjectCollection attributes = type.getAttributes();
        for (int ax = 0; ax < attributes.getCount(); ax++) {
            @SuppressWarnings("unused") // work in progress.
            XmlSchemaAttribute attribute = (XmlSchemaAttribute)attributes.getItem(ax);
        }
    }
View Full Code Here

                                   AxisMessage message,
                                   List partNameList,
                                   String qnameSuffix) {
        QName opName = message.getAxisOperation().getName();

        XmlSchemaAttribute xmlSchemaAttribute;
        for (XmlSchemaObject item : complexType.getAttributes()) {
            if (item instanceof XmlSchemaAttribute) {
                xmlSchemaAttribute = (XmlSchemaAttribute) item;
                String partName = xmlSchemaAttribute.getName();
                partNameList.add(
                        WSDLUtil.getPartQName(opName.getLocalPart(),
                                qnameSuffix,
                                partName));
            }
View Full Code Here

           
          while (itemIterator.hasNext()) {
                Object attr = itemIterator.next();
               
                if (attr instanceof XmlSchemaAttribute) {
                  XmlSchemaAttribute attribute  = (XmlSchemaAttribute) attr;
                 
                  if (attribute.getName().equals(att.getRefName().getLocalPart())) {
                    QName attrTypeName = attribute.getSchemaTypeName();
                   
                    Object type = baseSchemaTypeMap.get(attrTypeName);
                    if (type == null) {
                      XmlSchemaSimpleType simpleType = attribute.getSchemaType();
                            if(simpleType != null && simpleType.getContent() instanceof XmlSchemaSimpleTypeRestriction) {
                                XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) simpleType.getContent();
                                QName baseTypeName = restriction.getBaseTypeName();
                                type = baseSchemaTypeMap.get(baseTypeName);
                                attrQname = att.getRefName();
View Full Code Here

            if (!isSoapArray(complexType)) {
                XmlSchemaObjectCollection attributes = complexType.getAttributes();
                for (Iterator iterator = attributes.getIterator(); iterator.hasNext();) {
                    Object item = iterator.next();
                    if (item instanceof XmlSchemaAttribute) {
                        XmlSchemaAttribute attribute = (XmlSchemaAttribute) item;
                        Object old = typeInfo.attributes.put(attribute.getQName().getLocalPart(), attribute.getSchemaTypeName());
                        if (old != null) {
                            throw new IllegalArgumentException("Complain to your expert group member, spec does not support attributes with the same local name and differing namespaces: original: " + old + ", duplicate local name: " + attribute);
                        }
                    }
                }
View Full Code Here

        // </complexType>
        XmlSchemaObjectCollection attributes = restriction.getAttributes();
        for (Iterator iterator = attributes.getIterator(); iterator.hasNext();) {
            Object item = iterator.next();
            if (item instanceof XmlSchemaAttribute) {
                XmlSchemaAttribute attribute = (XmlSchemaAttribute) item;
                if (attribute.getRefName().equals(SOAP_ARRAY_TYPE)) {
                    for (Attr attr : attribute.getUnhandledAttributes()) {
                        QName attQName = new QName(attr.getNamespaceURI(), attr.getLocalName());
                        if (WSDL_ARRAY_TYPE.equals(attQName)) {
                            // value is a namespace prefixed xsd type
                            String value = attr.getValue();
View Full Code Here

            if (!isSoapArray(complexType)) {
                XmlSchemaObjectCollection attributes = complexType.getAttributes();
                for (Iterator iterator = attributes.getIterator(); iterator.hasNext(); ) {
                    Object item = iterator.next();
                    if (item instanceof XmlSchemaAttribute) {
                        XmlSchemaAttribute attribute = (XmlSchemaAttribute) item;
                        Object old = typeInfo.attributes.put(attribute.getQName().getLocalPart(), attribute.getSchemaTypeName());
                        if (old != null) {
                            throw new IllegalArgumentException("Complain to your expert group member, spec does not support attributes with the same local name and differing namespaces: original: " + old + ", duplicate local name: " + attribute);
                        }
                    }
                }
View Full Code Here

        // </complexType>
        XmlSchemaObjectCollection attributes = restriction.getAttributes();
        for (Iterator iterator = attributes.getIterator(); iterator.hasNext(); ) {
            Object item = iterator.next();
            if (item instanceof XmlSchemaAttribute) {
                XmlSchemaAttribute attribute = (XmlSchemaAttribute) item;
                if (attribute.getRefName().equals(SOAP_ARRAY_TYPE)) {
                    for (Attr attr : attribute.getUnhandledAttributes()) {
                        QName attQName = new QName(attr.getNamespaceURI(), attr.getLocalName());
                        if (WSDL_ARRAY_TYPE.equals(attQName)) {
                            // value is a namespace prefixed xsd type
                            String value = attr.getValue();
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.