Examples of XSModel


Examples of org.apache.xerces.xs.XSModel

      Map schemas = validator.wsdlDocument.getSchemas();
      // Going through the schemas
      Iterator it2 = schemas.values().iterator();
      while (it2.hasNext())
      {
        XSModel xsModel = (XSModel) it2.next();
        XSTypeDefinition partType = null;
        // Getting the corresponding part type
        if (type == XSConstants.ELEMENT_DECLARATION)
        {
          XSElementDeclaration elem = xsModel.getElementDeclaration(
            ref.getLocalPart(), ref.getNamespaceURI());
          if (elem != null)
            partType = elem.getTypeDefinition();
        }
        else
        {
          partType = xsModel.getTypeDefinition(
            ref.getLocalPart(), ref.getNamespaceURI());
        }
        // If the part type is defined using the ref:swaRef schema type
        if (referencesSwaRef(partType, new ArrayList()))
        {
View Full Code Here

Examples of org.apache.xerces.xs.XSModel

      XSModel[] schemas = valInfo.getSchemas();
      int numSchemas = schemas.length;
      //Iterator schemasIter = schemas.iterator();
      for (int i = 0; i < numSchemas; i++)
      {
        XSModel schema = schemas[i];
        if (schema != null)
        {
          if (part == ELEMENT && schema.getElementDeclaration(name, namespace) != null)
          {
            partvalid = true;
            break;
          }
          else if (part == TYPE && schema.getTypeDefinition(name, namespace) != null)
          {
            partvalid = true;
            break;
          }
        }
      }
    }
    // If the SOAP encoding namespace hasn't been explicitly imported do so
  // now.
    // Allow the SOAP encoding namespace to be automatically imported but mark
  // it as a warning.
    if (!partvalid && namespace.equals(SOAP_ENCODING_URI))
    {
      try
      {
        XSDValidator xsdVal = new XSDValidator();
        String soapEnc = valInfo.getURIResolver().resolve("", SOAP_ENCODING_URI, null).getPhysicalLocation();
        if(soapEnc != null)
        {
          xsdVal.validate(soapEnc, null, valInfo.getSchemaCache());
          // sanity check in case something goes wrong
          if (xsdVal.isValid())
          {
            XSModel xsModel = xsdVal.getXSModel();

            if (part == ELEMENT && xsModel.getElementDeclaration(name, namespace) != null)
            {
              partvalid = true;
            }
            else if (part == TYPE && xsModel.getTypeDefinition(name, namespace) != null)
            {
              partvalid = true;
            }
            valInfo.addWarning(messagegenerator.getString(_WARN_SOAPENC_IMPORTED_PART, QUOTE + name + QUOTE), partObject);
          }
View Full Code Here

Examples of org.apache.xerces.xs.XSModel

    XSDValidator xsdvalidator = new XSDValidator();

    xsdvalidator.validate(location, XMLCatalogResolver.getInstance(), valinfo.getSchemaCache());
    if (xsdvalidator.isValid())
    {
      XSModel schema = xsdvalidator.getXSModel();
      if (schema != null)
      {
        schemas.add(schema);
      }
    }
View Full Code Here

Examples of org.apache.xerces.xs.XSModel

    schemaLoader.setEntityResolver(cr);

    LoggingXmlErrorHandler eh = new LoggingXmlErrorHandler(__log);
    schemaLoader.setErrorHandler(eh);

    XSModel model = schemaLoader.load(input);

    // The following mess is due to XMLSchemaLoaders funkyness in error
    // reporting: sometimes it throws an exception, sometime it returns
    // null, sometimes it just prints bs to the screen.
    if (model == null) {
View Full Code Here

Examples of org.apache.xerces.xs.XSModel

    */
   public boolean hasComplexTypeDefinition(QName xmlType, URL xsdLocation)
   {
      if (xsdLocation == null)
         throw new IllegalArgumentException("xsdLocation is null");
      XSModel xsmodel = parseSchema(xsdLocation);
      return this.hasComplexTypeDefinition(xmlType, xsmodel);
   }
View Full Code Here

Examples of org.apache.xerces.xs.XSModel

   {
      if (xmlName == null)
         throw new IllegalArgumentException("xmlName is null");
      if (xsdLocation == null)
         throw new IllegalArgumentException("xsdLocation is null");
      XSModel xsmodel = parseSchema(xsdLocation);
      boolean bool = false;
      String name = xmlName.getLocalPart();
      if (name == null)
         throw new IllegalArgumentException("xmlName has a null name");
      String ns = xmlName.getNamespaceURI();
      if (ns == null)
         throw new IllegalArgumentException("xmlName has a null namespace");
      if (xsmodel.getElementDeclaration(name, ns) != null)
         bool = true;
      return bool;
   }
View Full Code Here

Examples of org.apache.xerces.xs.XSModel

    * @return schema model
    */
   public XSModel parseSchema(String schemaLoc)
   {
      XSLoader xsloader = getXSLoader();
      XSModel xsModel = xsloader.loadURI(schemaLoc);
      if (xsModel == null)
         throw new WSException("Cannot parse schema: " + schemaLoc);
      return xsModel;
   }
View Full Code Here

Examples of org.apache.xerces.xs.XSModel

      /**
       * Builds the anonymous type mapping. This is intended to be called lazily.
       */
      public void build()
      {
         XSModel model = JBossXSModel.this;

         anonymousTypeMap = new HashMap<String, XSTypeDefinition>();

         anonymousElementMap = new HashMap<String, XSElementDeclaration>();

        
         processed.clear();
        
         XSNamedMap namedMap = model.getComponents(XSConstants.TYPE_DEFINITION);
         for (int i = 0; i < namedMap.getLength(); i++)
         {
            XSTypeDefinition type = (XSTypeDefinition)namedMap.item(i);
            if (type.getTypeCategory() != XSTypeDefinition.COMPLEX_TYPE)
               continue;

            analyzeComplexType((XSComplexTypeDefinition)type, null, type.getNamespace());
         }

         namedMap = model.getComponents(XSConstants.ELEMENT_DECLARATION);
         for (int i = 0; i < namedMap.getLength(); i++)
         {
            XSElementDeclaration element = (XSElementDeclaration)namedMap.item(i);
            analyzeElement(element, null, element.getNamespace(), null, null);
         }
View Full Code Here

Examples of org.apache.xerces.xs.XSModel

      JBossXSErrorHandler xserr = new JBossXSErrorHandler();
      JBossWSEntityResolver resolver = new JBossWSEntityResolver();
      JBossXSEntityResolver xsresolve = new JBossXSEntityResolver(resolver, new HashMap<String, URL>());
      XMLSchemaLoader loader = (XMLSchemaLoader)schemautils.getXSLoader(xserr, xsresolve);

      XSModel xsmodel = loader.loadURI(xsdURL.toExternalForm());
      if (xsmodel == null)
         throw new WSException("Cannot load schema: " + xsdURL);

      WSSchemaUtils sutils = WSSchemaUtils.getInstance(null, null);
      JBossXSModel jbxs = new JBossXSModel();
View Full Code Here

Examples of org.apache.xerces.xs.XSModel

                  log.warn(ioe.getMessage(), ioe);
               }
            }
         }
      }
      XSModel xsmodel = new XSModelImpl(gs);

      // Convert Xerces XSModel into r/w JBossXSModel
      WSSchemaUtils sutils = WSSchemaUtils.getInstance(null, null);
      JBossXSModel jbxs = new JBossXSModel();
      sutils.copyXSModel(xsmodel, jbxs);
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.