Package org.apache.woden.schema

Examples of org.apache.woden.schema.Schema


/**
  * Test that the imported schema document matches the expected value parsed from the WSDL.
  */
public void testCheckSchemaImport()
{
   Schema schema1 = fSchemas[0];
     XmlSchema xmlSchema = schema1.getSchemaDefinition();
     assertEquals("Unexpected targetNamespace.", "http://example.org/getAccountDetails/", schema1.getNamespace().toString());
    
     XmlSchemaObjectCollection schemaIncludes = xmlSchema.getIncludes(); // returns both includes and imports
   Iterator schemaIterator = schemaIncludes.getIterator();
   while (schemaIterator.hasNext())
   {
View Full Code Here


        Iterator i = fSchemas.iterator();
       
        if(namespace != null)
        {
            while(i.hasNext()) {
                Schema s = (Schema)i.next();
                if(namespace.equals(s.getNamespace())) {
                    schemas.add(s);
                }
            }
        }
        else
        {
            //get schemas whose namespace is missing
            while(i.hasNext()) {
                Schema s = (Schema)i.next();
                if(s.getNamespace() == null) {
                    schemas.add(s);
                }
            }
        }
       
View Full Code Here

    public InlinedSchema[] getInlinedSchemas()
    {
        List schemas = new Vector();
        Iterator i = fSchemas.iterator();
        while(i.hasNext()) {
            Schema s = (Schema)i.next();
            if(s instanceof InlinedSchema) {
                schemas.add(s);
            }
        }
       
View Full Code Here

    public ImportedSchema[] getImportedSchemas()
    {
        List schemas = new Vector();
        Iterator i = fSchemas.iterator();
        while(i.hasNext()) {
            Schema s = (Schema)i.next();
            if(s instanceof ImportedSchema) {
                schemas.add(s);
            }
        }
       
View Full Code Here

                if(nestedDesc != null) {
                    TypesElement typesElem = nestedDesc.getTypesElement();
                    if(typesElem != null) {
                        Schema[] schemas = typesElem.getSchemas(schema.getNamespace());
                        for(int j=0; j<schemas.length; j++) {
                            Schema s = (Schema)schemas[i];
                            XmlSchema x = s.getSchemaDefinition();
                            if(x != null) {
                                schemaDef = x;
                                break;
                            }
                        }
                    }
                }
            }
        }
       
        if(schemaDef == null) {
            //Check if any WSDL includes contain a schema with this namespace.
            //TODO there may be multiple schemas that this namespace import could resolve to. This is a temporary solution pending WODEN- post M7.
            IncludeElement[] includes = desc.getIncludeElements();
            for(int i=0; i<includes.length; i++) {
                IncludeElement includeElem = (IncludeElement) includes[i];
                DescriptionElement nestedDesc = includeElem.getDescriptionElement();
                if(nestedDesc != null) {
                    TypesElement typesElem = nestedDesc.getTypesElement();
                    if(typesElem != null) {
                        Schema[] schemas = typesElem.getSchemas(schema.getNamespace());
                        for(int j=0; j<schemas.length; j++) {
                            Schema s = (Schema)schemas[i];
                            XmlSchema x = s.getSchemaDefinition();
                            if(x != null) {
                                schemaDef = x;
                                break;
                            }
                        }
View Full Code Here

/**
  * Test that the imported schema document matches the expected value parsed from the WSDL.
  */
public void testCheckSchemaImport()
{
   Schema schema1 = fSchemas[0];
     XmlSchema xmlSchema = schema1.getSchemaDefinition();
     assertEquals("Unexpected targetNamespace.", "http://example.org/getAccountDetails/", schema1.getNamespace().toString());
    
     XmlSchemaObjectCollection schemaIncludes = xmlSchema.getIncludes(); // returns both includes and imports
   Iterator schemaIterator = schemaIncludes.getIterator();
   while (schemaIterator.hasNext())
   {
View Full Code Here

  }

  public void testRemoveSchema()
  {
    Schema[] schemas = null;
    Schema randomSchema = new ImportedSchemaImpl();
   
    // remove from empty list
    fTypesElement.removeSchema(randomSchema);
      schemas = fTypesElement.getSchemas();
    assertEquals(0, schemas.length);
View Full Code Here

                if(nestedDesc != null) {
                    TypesElement typesElem = nestedDesc.getTypesElement();
                    if(typesElem != null) {
                        Schema[] schemas = typesElem.getSchemas(schema.getNamespace());
                        for(int j=0; j<schemas.length; j++) {
                            Schema s = (Schema)schemas[i];
                            XmlSchema x = s.getSchemaDefinition();
                            if(x != null) {
                                schemaDef = x;
                                break;
                            }
                        }
                    }
                }
            }
        }
       
        if(schemaDef == null) {
            //Check if any WSDL includes contain a schema with this namespace.
            //TODO there may be multiple schemas that this namespace import could resolve to. This is a temporary solution pending WODEN- post M7.
            IncludeElement[] includes = desc.getIncludeElements();
            for(int i=0; i<includes.length; i++) {
                IncludeElement includeElem = (IncludeElement) includes[i];
                DescriptionElement nestedDesc = includeElem.getDescriptionElement();
                if(nestedDesc != null) {
                    TypesElement typesElem = nestedDesc.getTypesElement();
                    if(typesElem != null) {
                        Schema[] schemas = typesElem.getSchemas(schema.getNamespace());
                        for(int j=0; j<schemas.length; j++) {
                            Schema s = (Schema)schemas[i];
                            XmlSchema x = s.getSchemaDefinition();
                            if(x != null) {
                                schemaDef = x;
                                break;
                            }
                        }
View Full Code Here

TOP

Related Classes of org.apache.woden.schema.Schema

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.