Package org.apache.ws.commons.schema

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


    }
   
    private XmlSchemaParticle getBuriedElement(XmlSchemaComplexType type,
                                              QName parentName) {
        XmlSchemaSequence sequence = getTypeSequence(type, parentName);
        XmlSchemaObjectCollection insides = sequence.getItems();
        if (insides.getCount() == 1) {
            XmlSchemaObject item = insides.getItem(0);
            if (item instanceof XmlSchemaElement || item instanceof XmlSchemaAny) {
                return (XmlSchemaParticle) item;
            }
        }
        return null;
View Full Code Here


        code.append("}\n\n");
        code.append(nameManager.getJavascriptName(name) + ".prototype.serialize = " + functionName + ";\n\n");
    }

    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

            }
        }
    }

    private void addCrossImportsSequence(XmlSchema schema, XmlSchemaSequence sequence) {
        XmlSchemaObjectCollection items = sequence.getItems();
        for (int x = 0; x < items.getCount(); x++) {
            XmlSchemaObject seqItem = items.getItem(x);
            if (seqItem instanceof XmlSchemaElement) {
                addElementCrossImportsElement(schema, seqItem);
            }
        }
    }
View Full Code Here

        XmlSchemaSequence seq = (XmlSchemaSequence)type.getParticle();
      
        if (seq != null) {

            XmlSchemaObjectCollection items = seq.getItems();

            Iterator ite = items.getIterator();

            while (ite.hasNext()) {
                XmlSchemaElement subElement = (XmlSchemaElement)ite.next();

                if (subElement.getQName() != null) {
View Full Code Here

        XmlSchemaSimpleContentRestriction xsscr
            = (XmlSchemaSimpleContentRestriction)xssc.getContent();
        assertNotNull(xsscr);
        assertEquals(new QName("http://soapinterop.org/types", "drinksize"),
                     xsscr.getBaseTypeName());
        XmlSchemaObjectCollection xsoc = xsscr.getAttributes();
        assertNotNull(xsoc);
        assertEquals(2, xsoc.getCount());

        Set s = new HashSet();
        s.add("units");
        s.add("id");
        for (int i = 0; i < xsoc.getCount(); i++) {
            XmlSchemaAttribute xsa = (XmlSchemaAttribute)xsoc.getItem(i);
            String name = xsa.getName();
            if (name.equals("units")) {
                assertEquals(new QName("http://soapinterop.org/types", "units"),
                             xsa.getQName());
                assertEquals(new QName("http://www.w3.org/2001/XMLSchema", "string"),
                             xsa.getSchemaTypeName());
                assertNull(xsa.getDefaultValue());
                assertEquals("required", xsa.getUse().getValue());
                assertNull(xsa.getFixedValue());
            } else if (name.equals("id")) {
                assertEquals(new QName("http://soapinterop.org/types", "id"),
                             xsa.getQName());
                assertEquals(new QName("http://www.w3.org/2001/XMLSchema", "integer"),
                             xsa.getSchemaTypeName());
                assertEquals("001", xsa.getDefaultValue());
                assertEquals("required", xsa.getUse().getValue());
                assertNull(xsa.getFixedValue());
            } else {
                fail("The name \"" + name + "\" was not expected.");
            }
            assertTrue(s.remove(name));
        }
        assertTrue("The set should have been empty, but instead contained: "
                   + s + ".",
                   s.isEmpty());
       
        XmlSchemaObjectCollection xsoc2 = xsscr.getFacets();
        assertNotNull(xsoc2);
        assertEquals(2, xsoc2.getCount());

        s.clear();
        s.add("small");
        s.add("medium");
        for (int i = 0; i < xsoc2.getCount(); i++) {
            XmlSchemaEnumerationFacet xsef =
                (XmlSchemaEnumerationFacet)xsoc2.getItem(i);
            String value = (String)xsef.getValue();
            if (!(value.equals("small") || value.equals("medium"))) {
                fail("Unexpected enumeration value of \"" + value
                     + "\" found.");
            }
View Full Code Here

            = (XmlSchemaSimpleContentExtension)xssc.getContent();
        assertNotNull(xssce);
        assertEquals(new QName("http://www.w3.org/2001/XMLSchema", "integer"),
                     xssce.getBaseTypeName());

        XmlSchemaObjectCollection xsoc = xssce.getAttributes();
        assertEquals(3, xsoc.getCount());

        Set s = new HashSet();
        s.add("units");
        s.add("id");
        s.add("desc");
        for (int i = 0; i < xsoc.getCount(); i++) {
            XmlSchemaAttribute xsa = (XmlSchemaAttribute)xsoc.getItem(i);
            String name = xsa.getName();
            if (name.equals("units")) {
                assertEquals(new QName("http://soapinterop.org/types", "units"),
                             xsa.getQName());
                assertEquals(new QName("http://www.w3.org/2001/XMLSchema", "string"),
View Full Code Here

    }

       
    private static boolean buildMessageParts(XmlSchemaSequence seq, String namespaceURI, MessageInfo wrapper,
                                             boolean allowRefs) {    
        XmlSchemaObjectCollection items = seq.getItems();
        boolean ret = true;
        for (int x = 0; x < items.getCount(); x++) {
            XmlSchemaObject o = items.getItem(x);
            if (!(o instanceof XmlSchemaElement)) {
                return false;
            }
            XmlSchemaElement el = (XmlSchemaElement)o;
View Full Code Here

    private void evaluateSchemasRecursively(
            XmlSchema xmlSchema,
            ArrayList<String> dependencies,
            boolean isWSDLInlineSchema, boolean isMasterSchema) throws RegistryException {
        // first process the imports and includes
        XmlSchemaObjectCollection includes = xmlSchema.getIncludes();
        SchemaInfo schemaInfo = new SchemaInfo();
        schemaInfo.setMasterSchema(isMasterSchema);
        // set this as an visited schema to stop infinite traversal
        visitedSchemas.add(xmlSchema.getSourceURI());
        if (includes != null) {
            Object externalComponent;
            XmlSchemaExternal xmlSchemaExternal;
            XmlSchema innerSchema;
            for (Iterator iter = includes.getIterator(); iter.hasNext();) {
                externalComponent = iter.next();
                if (externalComponent instanceof XmlSchemaExternal) {
                    xmlSchemaExternal = (XmlSchemaExternal)externalComponent;
                    innerSchema = xmlSchemaExternal.getSchema();
                    if (innerSchema != null) {
View Full Code Here

     * Furthermore, fill the associations arraylist according to the detectored associations.
     */
    private void updateSchemaInternalsAndAssociations() throws RegistryException {
        for (SchemaInfo schemaInfo: schemas.values()) {
            XmlSchema schema = schemaInfo.getSchema();
            XmlSchemaObjectCollection includes = schema.getIncludes();
            if (includes != null) {
                for (Iterator iter = includes.getIterator(); iter.hasNext();) {
                    Object externalComponent = iter.next();
                    if (externalComponent instanceof XmlSchemaExternal) {
                        XmlSchemaExternal xmlSchemaExternal = (XmlSchemaExternal)externalComponent;
                        XmlSchema schema1 = xmlSchemaExternal.getSchema();
                        if (schema1 != null) {
View Full Code Here

                                        boolean isWSDLInlineSchema,
                                        boolean processIncludes) {

        if (processIncludes) {
            // first process the imports and includes
            XmlSchemaObjectCollection includes = xmlSchema.getIncludes();
            // set this as an visited schema to stop recursion
            visitedSchemas.add(xmlSchema.getSourceURI());
            if (includes != null) {
                Object externalComponent;
                XmlSchemaExternal xmlSchemaExternal;
                XmlSchema innerSchema;
                for (Iterator iter = includes.getIterator(); iter.hasNext();) {
                    externalComponent = iter.next();
                    if (externalComponent instanceof XmlSchemaExternal) {
                        xmlSchemaExternal = (XmlSchemaExternal)externalComponent;
                        innerSchema = xmlSchemaExternal.getSchema();
                        String sourceURI = innerSchema.getSourceURI();
View Full Code Here

TOP

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

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.