Examples of XmlSchemaObjectCollection


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

    private static boolean isWrappableSequence(XmlSchemaComplexType type, String namespaceURI,
                                               MessageInfo wrapper, boolean allowRefs) {
        if (type.getParticle() instanceof XmlSchemaSequence) {
            XmlSchemaSequence seq = (XmlSchemaSequence)type.getParticle();
            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

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

        XSDefinition definition1 = (XSDefinition)documentProcessor.read(null, URI.create("xsd/name.xsd"), url1);
        Assert.assertNull(definition1.getSchema());
        Assert.assertEquals("http://greeting", definition1.getNamespace());
        resolver.addModel(definition);
        XSDefinition resolved = resolver.resolveModel(XSDefinition.class, definition);
        XmlSchemaObjectCollection collection = resolved.getSchema().getIncludes();
        Assert.assertTrue(collection.getCount() == 1);
        XmlSchemaType type =
            ((XmlSchemaInclude)collection.getItem(0)).getSchema().getTypeByName(new QName("http://greeting", "Name"));
        Assert.assertNotNull(type);
        resolver.addModel(definition1);
        resolved = resolver.resolveModel(XSDefinition.class, definition);
        collection = resolved.getSchema().getIncludes();
        Assert.assertTrue(collection.getCount() == 2);
        XmlSchemaType type1 =
            ((XmlSchemaInclude)collection.getItem(0)).getSchema().getTypeByName(new QName("http://greeting", "Name"));
        XmlSchemaType type2 =
            ((XmlSchemaInclude)collection.getItem(1)).getSchema().getTypeByName(new QName("http://greeting", "Name"));
        Assert.assertTrue(type1 != null || type2 != null);
    }
View Full Code Here

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

            }
            if (!(particle instanceof XmlSchemaSequence)) {
                return null;
            }
            XmlSchemaSequence sequence = (XmlSchemaSequence)complexType.getParticle();
            XmlSchemaObjectCollection items = sequence.getItems();
            List<XmlSchemaElement> childElements = new ArrayList<XmlSchemaElement>();
            for (int i = 0; i < items.getCount(); i++) {
                XmlSchemaObject schemaObject = items.getItem(i);
                if (!(schemaObject instanceof XmlSchemaElement)) {
                    // Should contain elements only
                    return null;
                }
                XmlSchemaElement childElement = (XmlSchemaElement)schemaObject;
View Full Code Here

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

    XmlSchemaParticle particle = complexType.getParticle();
    if(particle!=null)
      processParticle(particle);
   
    // attributes
    XmlSchemaObjectCollection attributes = complexType.getAttributes();
    if(attributes!=null)
      processAttributes(attributes);
   
    // contentModel
    XmlSchemaContentModel contentModel = complexType.getContentModel();
View Full Code Here

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

    XmlSchemaParticle particle = complexContentExtension.getParticle();
    if(particle!=null)
      processParticle(particle);
   
    // attributes
    XmlSchemaObjectCollection attributes = complexContentExtension.getAttributes();
    if(attributes!=null)
      processAttributes(attributes);
  }
View Full Code Here

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

    event.setJavaQName(JavaSourceUtils.toJavaQName(event.getSchemaType()));
   
    handler.foundSimpleContent(event);
   
    // attributes
    XmlSchemaObjectCollection attributes = simpleContentExtension.getAttributes();
    if(attributes!=null)
      processAttributes(attributes);
  }
View Full Code Here

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

    event.setJavaQName(JavaSourceUtils.toJavaQName(event.getSchemaType()));
   
    handler.foundSimpleContent(event);
   
    // attributes
    XmlSchemaObjectCollection attributes = simpleContentRestriction.getAttributes();
    if(attributes!=null)
      processAttributes(attributes);
  }
View Full Code Here

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

        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

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

            }
        }
    }

    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

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

        XmlSchemaSimpleTypeContent content = type.getContent();
        if (!(content instanceof XmlSchemaSimpleTypeRestriction)) {
            return false;
        }
        XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content;
        XmlSchemaObjectCollection facets = restriction.getFacets();
        for (int x = 0; x < facets.getCount(); x++) {
            XmlSchemaFacet facet = (XmlSchemaFacet) facets.getItem(x);
            if (!(facet instanceof XmlSchemaEnumerationFacet)) {
                return false;
            }
        }
        return true;
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.