Package javax.wsdl.extensions.schema

Examples of javax.wsdl.extensions.schema.Schema


        if (typesElement != null) {
            Iterator ite = typesElement.getExtensibilityElements().iterator();
            while (ite.hasNext()) {
                Object obj = ite.next();
                if (obj instanceof Schema) {
                    Schema schema = (Schema)obj;
                    addSchema(schema.getDocumentBaseURI(), schema);
                }
            }
        }
    }
View Full Code Here


            for (String importNamespace : importKeys) {

                List<SchemaImport> schemaImports = CastUtils.cast(imports.get(importNamespace));
               
                for (SchemaImport schemaImport : schemaImports) {
                    Schema tempImport = schemaImport.getReferencedSchema();                  
                    String key = schemaImport.getSchemaLocationURI();
                    if (importNamespace == null && tempImport != null) {
                        importNamespace = tempImport.getDocumentBaseURI();
                    }
                   
                    if (tempImport != null && !catalogResolved.containsKey(key)) {                
                        key = tempImport.getDocumentBaseURI();
                    }
                   
                    if (tempImport != null
                        && !isSchemaParsed(key, importNamespace)
                        && !schemaList.containsValue(tempImport.getElement())) {
                        addSchema(key, tempImport);
                    }
                }

            }
View Full Code Here

        Types types = def.getTypes();
        if (types != null) {
            for (ExtensibilityElement el
                : CastUtils.cast(types.getExtensibilityElements(), ExtensibilityElement.class)) {
                if (el instanceof Schema) {
                    Schema see = (Schema)el;
                    updateSchemaImports(bus, see, see.getDocumentBaseURI(), doneSchemas, base);
                }
            }
        }
    }   
View Full Code Here

        Types types = def.getTypes();
        if (types != null) {
            for (ExtensibilityElement el
                : CastUtils.cast((List)types.getExtensibilityElements(), ExtensibilityElement.class)) {
                if (el instanceof Schema) {
                    Schema see = (Schema)el;
                    updateSchemaImports(bus, see, doneSchemas, base);
                }
            }
        }
    }   
View Full Code Here

        * */
        Types types = def.getTypes();
        if (types != null) {
            for (ExtensibilityElement el : (List<ExtensibilityElement>)types.getExtensibilityElements()) {
                if (el instanceof Schema) {
                    Schema see = (Schema)el;
                    updateSchemaImports(see, doneSchemas, base);
                }
            }
        }
    }
View Full Code Here

        Types types = def.getTypes();
        if (types != null) {
            for (ExtensibilityElement el
                : CastUtils.cast((List)types.getExtensibilityElements(), ExtensibilityElement.class)) {
                if (el instanceof Schema) {
                    Schema see = (Schema)el;
                    updateSchemaImports(see, doneSchemas, base);
                }
            }
        }
    }   
View Full Code Here

        // adjust the schema locations in types section
        Types types = definition.getTypes();
        if (types != null) {
            List extensibilityElements = types.getExtensibilityElements();
            Object extensibilityElement = null;
            Schema schema = null;
            for (Iterator iter = extensibilityElements.iterator(); iter.hasNext();) {
                extensibilityElement = iter.next();
                if (extensibilityElement instanceof Schema) {
                    schema = (Schema) extensibilityElement;
                    changeLocations(schema.getElement());
                }
            }
        }

        Iterator iter = definition.getImports().values().iterator();
View Full Code Here

        * PopulatedExtensionRegistry registers SchemaDeserializer by default, but
        * if the user chooses not to register a suitable deserializer then the
        * UnknownDeserializer will be used, returning an UnknownExtensibilityElement.
        */

    Schema schema = null;
    SchemaReference schemaRef = null;
    try
    {

      QName elementType = QNameUtils.newQName(el);

      ExtensionDeserializer exDS =
          extReg.queryDeserializer(parentType, elementType);

      //Now unmarshall the DOM element.
      ExtensibilityElement ee =
          exDS.unmarshall(parentType, elementType, el, def, extReg);

      if (ee instanceof Schema)
      {
        schema = (Schema) ee;
      }
      else
      {
        //Unknown extensibility element, so don't do any more schema parsing on it.
        return ee;
      }


      //Keep track of parsed schemas to avoid duplicating Schema objects
      //through duplicate or circular references (eg: A imports B imports A).
      if (schema.getDocumentBaseURI() != null)
      {
        this.allSchemas.put(schema.getDocumentBaseURI(), schema);
      }

      //At this point, any SchemaReference objects held by the schema will not
      //yet point to their referenced schemas, so we must now retrieve these
      //schemas and set the schema references.

      //First, combine the schema references for imports, includes and redefines
      //into a single list

      ArrayList allSchemaRefs = new ArrayList();

      Collection ic = schema.getImports().values();
      Iterator importsIterator = ic.iterator();
      while(importsIterator.hasNext())
      {
        allSchemaRefs.addAll( (Collection) importsIterator.next() );
      }

      allSchemaRefs.addAll(schema.getIncludes());
      allSchemaRefs.addAll(schema.getRedefines());

      //Then, retrieve the schema referred to by each schema reference. If the
      //schema has been read in previously, use the existing schema object.
      //Otherwise unmarshall the DOM element into a new schema object.

      ListIterator schemaRefIterator = allSchemaRefs.listIterator();

      while(schemaRefIterator.hasNext())
      {
        try
        {
          schemaRef = (SchemaReference) schemaRefIterator.next();

          if (schemaRef.getSchemaLocationURI() == null)
          {
            //cannot get the referenced schema, so ignore this schema reference
            continue;
          }

          log.trace("Retrieving schema at '" +
              schemaRef.getSchemaLocationURI() +
              (schema.getDocumentBaseURI() == null
                  ? "'."
                  : "', relative to '" +
                  schema.getDocumentBaseURI() + "'."));


          InputStream inputStream = null;
          InputSource inputSource = null;

          //This is the child schema referred to by the schemaReference
          Schema referencedSchema = null;

          //This is the child schema's location obtained from the WSDLLocator or the URL
          String location = null;

          if (loc != null)
View Full Code Here

        Types types = def.getTypes();
        if (types != null) {
            for (ExtensibilityElement el
                : CastUtils.cast((List)types.getExtensibilityElements(), ExtensibilityElement.class)) {
                if (el instanceof Schema) {
                    Schema see = (Schema)el;
                    updateSchemaImports(see, doneSchemas, base);
                }
            }
        }
    }   
View Full Code Here

   * @param xmlSchemaCollection
   */
  protected void processWsdlTypes(Types wsdlTypes, XmlSchemaCollection xmlSchemaCollection) {
    List extensibilityElements = wsdlTypes.getExtensibilityElements();
    for(Iterator it=extensibilityElements.iterator();it.hasNext();) {
      Schema ext = (Schema)it.next();
      XmlSchema schema = xmlSchemaCollection.read(ext.getElement());
      processSchema(schema);
    }
  }
View Full Code Here

TOP

Related Classes of javax.wsdl.extensions.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.