Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSObject


        break;
        case XSConstants.MODEL_GROUP:
            if (IS_SPEC_COMPLIANT == false) {
                XSObjectList particles = ((XSModelGroup) sourceComponent).getParticles();
                for (int i = 0, n = particles.size(); i < n; ++i) {
                    XSObject term = ((XSParticle) particles.item(i)).getTerm();
                    if (NO_FILTER == filter
                            || (term != null && term.getType() == filter)) {
                        addComponent(term, nameTest, outputComponents); // nameTest
                    }
                }

            }
View Full Code Here


            throw new SCDException(
                    "Error in SCD: annotations accessor is not supported for the component type "
                    + sourceComponent.getType());
        }
        if (annotations != null) {
            XSObject annotation;
            for (int i = 0, n = annotations.size(); i < n; ++i) {
                annotation = annotations.item(i);
                if (annotation != null && !targetComponents.contains(annotation)) {
                    targetComponents.add(annotation);
                }
View Full Code Here

    // Described in section 4.5.7; component-scope Accessor
    private void componentScope(XSObject sourceComponent, List targetComponents) {
        switch (sourceComponent.getType()) {
        case XSConstants.ATTRIBUTE_DECLARATION:
            if (((XSAttributeDeclaration)sourceComponent).getScope() != XSConstants.SCOPE_GLOBAL) {
                XSObject type = ((XSAttributeDeclaration)sourceComponent).getEnclosingCTDefinition();
                if (type != null && !targetComponents.contains(type)) {
                    targetComponents.add(type);
                }
            }
            break;
        case XSConstants.ELEMENT_DECLARATION:
            if (((XSElementDeclaration)sourceComponent).getScope() != XSConstants.SCOPE_GLOBAL) {
                XSObject type = ((XSElementDeclaration)sourceComponent).getEnclosingCTDefinition();
                if (type != null && !targetComponents.contains(type)) {
                    targetComponents.add(type);
                }           
            }
            break;
View Full Code Here

                                            maxOccurs);
        }
       
        XSObjectList compositorChildren = modelGroup.getParticles();
        for (int seqIdx = 0; seqIdx < compositorChildren.getLength(); seqIdx++) {
            XSObject seqItem = compositorChildren.item(seqIdx);
            XSParticle compositorParticle = (XSParticle) seqItem;
            String minOccursParticle = getMinOccursVal(compositorParticle);
            String maxOccursParticle = getMaxOccursVal(compositorParticle);
            XSTerm partclTerm = compositorParticle.getTerm();           
            if (partclTerm instanceof XSElementDeclaration) {
View Full Code Here

    private boolean canAddComponents(Vector components) {
        final int size = components.size();
        final XSDDescription desc = new XSDDescription();
        for (int i=0; i<size; i++) {
            XSObject component = (XSObject) components.elementAt(i);
            if (!canAddComponent(component, desc)) {
                return false;
            }
        }
        return true;
View Full Code Here

                newComponents.add(components[i]);
            }
        }
       
        for (int i=0; i<newComponents.size(); i++) {
            final XSObject component = (XSObject) newComponents.elementAt(i);
            expandRelatedComponents(component, newComponents, dependencies);
        }
       
        return newComponents;
    }
View Full Code Here

      assertTrue("Does Schema file exist?", xsdFile.exists());
      XSModel xsmodel = parseSchema(xsdFile.toURL());
      assertNotNull("XSModel is null?", xsmodel);
      XSNamedMap xsmap = xsmodel.getComponentsByNamespace(XSConstants.TYPE_DEFINITION, "http://org.jboss.ws/types");
      assertNotNull("XSNamedMap is null?", xsmap);
      XSObject xsobj = xsmap.itemByName("http://org.jboss.ws/types", "USAddress");
      assertNotNull("Is XSObject null?", xsobj);
   }
View Full Code Here

      schemaMap.put("http://org.jboss.ws/types2", getResourceURL("/tools/xsd/schemaimport/SchemaImport.xsd"));
      XSModel xsmodel = parseSchema(schemaMap);
      assertNotNull("XSModel is null?", xsmodel);
      XSNamedMap xsmap = xsmodel.getComponentsByNamespace(XSConstants.TYPE_DEFINITION, "http://org.jboss.ws/types2");
      assertNotNull("XSNamedMap is null?", xsmap);
      XSObject xsobj = xsmap.itemByName("http://org.jboss.ws/types2", "USAddress");
      assertNotNull("Is XSObject null?", xsobj);
   }
View Full Code Here

      assertNotNull("XSModel is null?", xsmodel);

      XSNamedMap xsnamedmap = getXSNamedMap(xsmodel, typeNS);
      assertNotNull("XSNamedMap is null?", xsnamedmap);
      assertEquals(1, xsnamedmap.getLength());
      XSObject xobj = xsnamedmap.item(0);
      assertEquals("HelloObj", xobj.getName());
      assertTrue("HelloObj is a complex type?",xobj instanceof XSComplexTypeDefinition);

      xsnamedmap = getXSNamedMap(xsmodel, arrTypeNS);
      assertEquals(1, xsnamedmap.getLength());
      xobj = xsnamedmap.item(0);
      assertEquals("HelloObjArray", xobj.getName());
      assertTrue("HelloObjArray is a complex type?",xobj instanceof XSComplexTypeDefinition);
      XSComplexTypeDefinition complexType = (XSComplexTypeDefinition) xobj;
      XSModelGroupImpl sequence = (XSModelGroupImpl) complexType.getParticle().getTerm();
      XSElementDecl valueElement = (XSElementDecl) ((XSParticleDecl) sequence.getParticles().item(0)).getTerm();
      String name = valueElement.getTypeDefinition().getName();

      assertEquals("HelloObj", name);

      //Test the case when the schema files are parsed one by one
      XSModel newxsmodel = utils.parseSchema(getResourceFile("tools/wsdlfixture/customtype/CustomTypeObj.xsd").getAbsolutePath());
      assertNotNull("XSModel is null?", newxsmodel);
      xsnamedmap = getXSNamedMap(newxsmodel, typeNS);
      assertNotNull("XSNamedMap is null?", xsnamedmap);
      assertEquals(1, xsnamedmap.getLength());
      xobj = xsnamedmap.item(0);
      assertEquals("HelloObj", xobj.getName());
      assertTrue("HelloObj is a complex type?",xobj instanceof XSComplexTypeDefinition);

      newxsmodel = utils.parseSchema(getResourceFile("tools/wsdlfixture/customtype/CustomTypeArrays.xsd").getAbsolutePath());
      assertNotNull("XSModel is null?", newxsmodel);
      xsnamedmap = getXSNamedMap(newxsmodel, arrTypeNS);
      assertNotNull("XSNamedMap is null?", xsnamedmap);
      assertEquals(1, xsnamedmap.getLength());
      xobj = xsnamedmap.item(0);
      assertEquals("HelloObjArray", xobj.getName());
      assertTrue("HelloObjArray is a complex type?",xobj instanceof XSComplexTypeDefinition);
      assertTrue("HelloObjArray is not a Wild Card?",!(xobj instanceof XSWildcard));
      XSComplexTypeDefinition xc = (XSComplexTypeDefinition)xobj;
      XSParticle xspart =  xc.getParticle();
      assertNotNull("Particle is null?",xspart);
View Full Code Here

      assertNotNull("XSModel is null?", xsmodel);

      XSNamedMap xsnamedmap = getXSNamedMap(xsmodel, typeNS);
      assertNotNull("XSNamedMap is null?", xsnamedmap);
      assertEquals(1, xsnamedmap.getLength());
      XSObject xobj = xsnamedmap.item(0);
      assertEquals("HelloObj", xobj.getName());
      assertTrue("HelloObj is a complex type?",xobj instanceof XSComplexTypeDefinition);

      xsnamedmap = getXSNamedMap(xsmodel, arrTypeNS);
      assertEquals(1, xsnamedmap.getLength());
      xobj = xsnamedmap.item(0);
      assertEquals("HelloObjArray", xobj.getName());
      assertTrue("HelloObjArray is a complex type?",xobj instanceof XSComplexTypeDefinition);
      XSComplexTypeDefinition complexType = (XSComplexTypeDefinition) xobj;
      XSModelGroupImpl sequence = (XSModelGroupImpl) complexType.getParticle().getTerm();
      XSElementDecl valueElement = (XSElementDecl) ((XSParticleDecl) sequence.getParticles().item(0)).getTerm();
      String name = valueElement.getTypeDefinition().getName();
View Full Code Here

TOP

Related Classes of org.apache.xerces.xs.XSObject

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.