Package org.apache.xerces.xs

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>();

         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


   public void generateJavaSource(String schemaFile, File dirloc, String packageName,
                           boolean createPackageDir)
      throws IOException
   {
      XSLoader xsloader = SchemaUtils.getInstance().getXSLoader();
      XSModel xsmodel = xsloader.loadURI(schemaFile);

      if (createPackageDir) dirloc = utils.createPackage(dirloc.getAbsolutePath(), packageName);
      generateJavaSource(xsmodel, dirloc, packageName);
   }
View Full Code Here

      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

         catch (Exception ex)
         {
            throw new IllegalStateException("Cannot parse schema", ex);
         }
      }
      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

             String targetNamespace)
   {
      if(targetNamespace == null)
         throw new IllegalArgumentException("Illegal Null Argument: targetNamespace");

      XSModel xsmodel = creator.getXSModel();
      if(xsmodel == null) creator.setXSModel(new JBossXSModel());
      //    Special case: if javaType is a Standard jaxrpc holder
      Class cls = utils.getJavaTypeForHolder(javaType);
      if(cls != null) return null;
      creator.generateType(null, javaType  );
View Full Code Here

    *                 and also will be set on the returned instance of SchemaBinding
    * @return SchemaBinding mapping
    */
   public static SchemaBinding bind(String xsdUrl, SchemaBindingResolver resolver)
   {
      XSModel model = Util.loadSchema(xsdUrl, resolver);
      return bind(model, resolver);
   }
View Full Code Here

    * @param processAnnotations whether to process annotations
    * @return SchemaBinding mapping
    */
   public static SchemaBinding bind(InputStream xsdStream, String encoding, SchemaBindingResolver resolver, boolean processAnnotations)
   {
      XSModel model = Util.loadSchema(xsdStream, encoding, resolver);
      return bind(model, resolver, processAnnotations);
   }
View Full Code Here

    *                  and also will be set on the returned instance of SchemaBinding
    * @return SchemaBinding mapping
    */
   public static SchemaBinding bind(Reader xsdReader, String encoding, SchemaBindingResolver resolver)
   {
      XSModel model = Util.loadSchema(xsdReader, encoding, resolver);
      return bind(model, resolver);
   }
View Full Code Here

    *                 and also will be set on the returned instance of SchemaBinding
    * @return SchemaBinding mapping
    */
   public static SchemaBinding bind(String xsd, String encoding, SchemaBindingResolver resolver)
   {
      XSModel model = Util.loadSchema(xsd, encoding);
      return bind(model, resolver);
   }
View Full Code Here

      if(resolver == null)
      {
         resolver = new DefaultSchemaResolver();
      }

      XSModel model = Util.loadSchema(xsdUrl, resolver);
      return parse(model);
   }
View Full Code Here

TOP

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

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.