Package org.apache.ws.commons.schema

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


            SchemaCollection schemaCollection = serviceInfo.getXmlSchemaCollection();

            // First pass, fill in any types for which we have a name but no
            // type.
            for (SchemaInfo schemaInfo : serviceInfo.getSchemas()) {
                XmlSchemaObjectTable elementsTable = schemaInfo.getSchema().getElements();
                Iterator elementsIterator = elementsTable.getNames();
                while (elementsIterator.hasNext()) {
                    QName elementName = (QName)elementsIterator.next();
                    XmlSchemaElement element = schemaInfo.getSchema().getElementByName(elementName);
                    if (element.getSchemaType() == null) {
                        QName typeName = element.getSchemaTypeName();
View Full Code Here


        InputStream is = new FileInputStream(Resources.asURI("redefine2.xsd"));
        XmlSchemaCollection schemaCol = new XmlSchemaCollection();
        XmlSchema schema = schemaCol.read(new StreamSource(is), null);

        XmlSchemaObjectTable xsot = schema.getElements();
        assertEquals(1, xsot.getCount());

        XmlSchemaElement xse = null;
        for (Iterator i = xsot.getValues(); i.hasNext(); ) {
            xse = (XmlSchemaElement)i.next();
        }
        assertEquals("vip", xse.getName());
        assertEquals(new QName("http://soapinterop.org/types",
                               "person"),
                     xse.getSchemaTypeName());

        XmlSchemaObjectCollection xsoc = schema.getIncludes();
        assertEquals(1, xsoc.getCount());
       
        XmlSchemaRedefine xsr = (XmlSchemaRedefine)xsoc.getItem(0);
        xsot = xsr.getSchemaTypes();
        assertEquals(1, xsot.getCount());

        for (Iterator i = xsot.getNames(); i.hasNext(); ) {
            QName qname = (QName)i.next();
            assertEquals(new QName("http://soapinterop.org/types",
                                   "person"), qname);
        }

        XmlSchemaComplexType xsct = null;
        for (Iterator i = xsot.getValues(); i.hasNext(); ) {
            xsct = (XmlSchemaComplexType)i.next();
        }
        assertNotNull(xsct);

        XmlSchemaContentModel xscm = xsct.getContentModel();
View Full Code Here

        InputStream is = new FileInputStream(Resources.asURI("redefine4.xsd"));
        XmlSchemaCollection schemaCol = new XmlSchemaCollection();
        XmlSchema schema = schemaCol.read(new StreamSource(is), null);

        XmlSchemaObjectTable xsot = schema.getElements();
        assertEquals(1, xsot.getCount());

        XmlSchemaElement xse = null;
        for (Iterator i = xsot.getValues(); i.hasNext(); ) {
            xse = (XmlSchemaElement)i.next();
        }
        assertEquals("childsizedrink", xse.getName());
        assertEquals(new QName("http://soapinterop.org/types",
                               "drinksize"),
                     xse.getSchemaTypeName());

        XmlSchemaObjectCollection xsoc = schema.getIncludes();
        assertEquals(1, xsoc.getCount());
       
        XmlSchemaRedefine xsr = (XmlSchemaRedefine)xsoc.getItem(0);
        xsot = xsr.getSchemaTypes();
        assertEquals(1, xsot.getCount());

        for (Iterator i = xsot.getNames(); i.hasNext(); ) {
            QName qname = (QName)i.next();
            assertEquals(new QName("http://soapinterop.org/types",
                                   "drinksize"), qname);
        }

        XmlSchemaSimpleType xsst = null;
        for (Iterator i = xsot.getValues(); i.hasNext(); ) {
            xsst = (XmlSchemaSimpleType)i.next();
        }
        assertNotNull(xsst);

        XmlSchemaSimpleTypeRestriction xsstr =
View Full Code Here

        XmlSchemaObjectCollection xsoc = schema.getIncludes();
        assertEquals(1, xsoc.getCount());
       
        XmlSchemaRedefine xsr = (XmlSchemaRedefine)xsoc.getItem(0);
        XmlSchemaObjectTable xsot = xsr.getGroup();
        assertEquals(1, xsot.getCount());

        for (Iterator i = xsot.getNames(); i.hasNext(); ) {
            assertEquals("PrologGroup", (String)i.next());
        }

        XmlSchemaGroup xsg = null;
        for (Iterator i = xsot.getValues(); i.hasNext(); ) {
            xsg = (XmlSchemaGroup)i.next();
        }

        XmlSchemaSequence xss = (XmlSchemaSequence)xsg.getParticle();
View Full Code Here

        XmlSchemaObjectCollection xsoc = schema.getIncludes();
        assertEquals(1, xsoc.getCount());
       
        XmlSchemaRedefine xsr = (XmlSchemaRedefine)xsoc.getItem(0);
        XmlSchemaObjectTable xsot = xsr.getAttributeGroup();
        assertEquals(1, xsot.getCount());

        for (Iterator i = xsot.getNames(); i.hasNext(); ) {
            assertEquals("AttribGroup", (String)i.next());
        }

        XmlSchemaAttributeGroup xsag = null;
        for (Iterator i = xsot.getValues(); i.hasNext(); ) {
            xsag = (XmlSchemaAttributeGroup)i.next();
        }
        assertEquals("AttribGroup", xsag.getName());
        xsoc = xsag.getAttributes();
View Full Code Here

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

        XmlSchemaObjectTable xsot = schema.getNotations();
        assertEquals(2, xsot.getCount());
       
        s.clear();
        s.add("teamMascot");
        s.add("teamLogo");
        for (Iterator i = xsot.getNames(); i.hasNext(); ) {
            String name = (String)i.next();
            if (!(name.equals("teamLogo")
                   || name.equals("teamMascot"))) {
                fail("An unexpected name of \"" + name
                     + "\" was found.");
            }
            assertTrue(s.remove(name));
        }
        assertTrue("The set should have been empty, but instead contained: "
                   + s + ".",
                   s.isEmpty());

        s.clear();
        s.add("teamMascot");
        s.add("teamLogo");
        for (Iterator i = xsot.getValues(); i.hasNext(); ) {
            XmlSchemaNotation xsn = (XmlSchemaNotation)i.next();
            String name = xsn.getName();
            XmlSchemaAnnotation xsa = xsn.getAnnotation();
            XmlSchemaObjectCollection col = xsa.getItems();
            assertEquals(1, col.getCount());
View Full Code Here

            XmlSchemaAttributeGroupRef agrn = (XmlSchemaAttributeGroupRef)i.next();
            assertEquals(new QName("http://soapinterop.org/types",
                                   "department"), agrn.getRefName());
        }

        XmlSchemaObjectTable attG = schema.getAttributeGroups();
        assertNotNull(attG);
        assertEquals(1, attG.getCount());
       
        for (Iterator i = attG.getNames(); i.hasNext(); ) {
            assertEquals("department", (String)i.next());
        }

        for (Iterator i = attG.getValues(); i.hasNext(); ) {
            Object obj1 = i.next();
            if (obj1 instanceof XmlSchemaAttributeGroup) {
                assertEquals("department", ((XmlSchemaAttributeGroup)obj1).getName());
                XmlSchemaObjectCollection attributes =
                    ((XmlSchemaAttributeGroup)obj1).getAttributes();
View Full Code Here

        for (ServiceInfo serviceInfo : service.getServiceInfos()) {
            SchemaCollection schemaCollection = serviceInfo.getXmlSchemaCollection();
           
            // First pass, fill in any types for which we have a name but no type.
            for (SchemaInfo schemaInfo : serviceInfo.getSchemas()) {
                XmlSchemaObjectTable elementsTable = schemaInfo.getSchema().getElements();
                Iterator elementsIterator = elementsTable.getNames();
                while (elementsIterator.hasNext()) {
                    QName elementName = (QName)elementsIterator.next();
                    XmlSchemaElement element = schemaInfo.getSchema().getElementByName(elementName);
                    if (element.getSchemaType() == null) {
                        QName typeName = element.getSchemaTypeName();
View Full Code Here

        XmlSchemaGroupRef ref = (XmlSchemaGroupRef)cType.getParticle();
        assertEquals(new QName("http://soapinterop.org/types", "priceGroup"),
                     ref.getRefName());

        XmlSchemaObjectTable t = schema.getGroups();
        assertEquals(1, t.getCount());

        XmlSchemaObject o = t.getItem(ref.getRefName());

        Set s = new HashSet();
        s.add("priceGroup");
        for (Iterator i = t.getNames(); i.hasNext(); ) {
            String name = (String)i.next();
            assertEquals("priceGroup", name);
            s.remove(name);
        }
        assertTrue("The set should have been empty, but instead contained: "
                   + s + ".",
                   s.isEmpty());

        s.clear();
        s.add("org.apache.ws.commons.schema.XmlSchemaGroup");
        XmlSchemaGroup xsg = null;
        for (Iterator i = t.getValues(); i.hasNext(); ) {
            xsg = (XmlSchemaGroup)i.next();
            s.remove(xsg.getClass().getName());
        }
        assertTrue("The set should have been empty, but instead contained: "
                   + s + ".",
View Full Code Here

        for (ServiceInfo serviceInfo : service.getServiceInfos()) {
            XmlSchemaCollection schemaCollection = serviceInfo.getXmlSchemaCollection();
           
            // First pass, fill in any types for which we have a name but no type.
            for (SchemaInfo schemaInfo : serviceInfo.getSchemas()) {
                XmlSchemaObjectTable elementsTable = schemaInfo.getSchema().getElements();
                Iterator elementsIterator = elementsTable.getNames();
                while (elementsIterator.hasNext()) {
                    QName elementName = (QName)elementsIterator.next();
                    XmlSchemaElement element = schemaInfo.getSchema().getElementByName(elementName);
                    if (element.getSchemaType() == null) {
                        QName typeName = element.getSchemaTypeName();
View Full Code Here

TOP

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

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.