Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSObject


      //Now that we have the schema, lets build the types for the schema
      XSNamedMap xsnamedmap = xsmodel.getComponents(XSConstants.TYPE_DEFINITION);
      int len = xsnamedmap != null ? xsnamedmap.getLength() : 0;
      for (int i = 0; i < len; i++)
      {
         XSObject type = xsnamedmap.item(i);
         if (type instanceof XSComplexTypeDefinition)
         {
            XSComplexTypeDefinition ctype = (XSComplexTypeDefinition)type;
            //Ignore xsd:anyType
            String nsuri = type.getNamespace();
            String tname = type.getName();
            if (Constants.NS_SCHEMA_XSD.equals(nsuri) && "anyType".equals(tname)) continue;
            checkXSDTypeToJava();
            xsdJava.createJavaFile(ctype, dirloc.getPath(), packageName, xsmodel);
         }
         else if (type instanceof XSSimpleTypeDefinition)
         {
            XSSimpleTypeDefinition stype = (XSSimpleTypeDefinition)type;
            //Ignore xsd:anyType
            String nsuri = type.getNamespace();
            String tname = type.getName();
            if (Constants.NS_SCHEMA_XSD.equals(nsuri) && "anyType".equals(tname)) continue;
            checkXSDTypeToJava();
            xsdJava.createJavaFile(stype, dirloc.getPath(), packageName, xsmodel);
         }
      }
View Full Code Here


/*  59 */     return (XSObject)this.list.get(index);
/*     */   }
/*     */
/*     */   public XSObject itemByName(String namespace, String localName)
/*     */   {
/*  79 */     XSObject xso = null;
/*     */
/*  81 */     for (XSObject obj : this.list)
/*     */     {
/*  83 */       if ((localName.equals(obj.getName())) && (namespace.equals(obj.getNamespace())))
/*     */       {
View Full Code Here

/*      */         {
/*  310 */           XSNamedMap components = model.getComponents(2);
/*  311 */           String roots = "";
/*  312 */           for (int j = 0; j < components.getLength(); j++)
/*      */           {
/*  314 */             XSObject xsObject = components.item(j);
/*  315 */             if (j > 0)
/*      */             {
/*  317 */               roots = roots + ", ";
/*      */             }
/*  319 */             roots = roots + "{" + xsObject.getNamespace() + "}" + xsObject.getName();
/*      */           }
/*  321 */           throw new IllegalStateException("Root element not found: " + qName + " among " + roots);
/*      */         }
/*      */
/*  324 */         Object o = provider.getRoot(root, null, element.getNamespace(), element.getName());
View Full Code Here

/*      */         {
/*  995 */           List typeNames = new ArrayList();
/*  996 */           XSNamedMap types = this.model.getComponents(3);
/*  997 */           for (int i = 0; i < types.getLength(); i++)
/*      */           {
/*  999 */             XSObject type = types.item(i);
/* 1000 */             if ("http://www.w3.org/2001/XMLSchema".equals(type.getNamespace()))
/*      */               continue;
/* 1002 */             typeNames.add(new QName(type.getNamespace(), type.getName()));
/*      */           }
/*      */
/* 1005 */           throw new JBossXBRuntimeException("Type " + mapping.typeName + " is not defined in the schema." + " Defined types are: " + typeNames);
/*      */         }
/*      */
View Full Code Here

/*     */   {
/*  96 */     XSNamedMap xsnamedmap = xsmodel.getComponents(3);
/*  97 */     int len = xsnamedmap != null ? xsnamedmap.getLength() : 0;
/*  98 */     for (int i = 0; i < len; i++)
/*     */     {
/* 100 */       XSObject type = xsnamedmap.item(i);
/* 101 */       if ((type instanceof XSComplexTypeDefinition))
/*     */       {
/* 103 */         XSComplexTypeDefinition ctype = (XSComplexTypeDefinition)type;
/*     */
/* 105 */         String nsuri = type.getNamespace();
/* 106 */         String tname = type.getName();
/* 107 */         if ((!"http://www.w3.org/2001/XMLSchema".equals(nsuri)) || (!"anyType".equals(tname))) {
/* 108 */           checkXSDTypeToJava();
/* 109 */           this.xsdJava.createJavaFile(ctype, dirloc, packageName, xsmodel);
/*     */         }
/*     */       } else {
/* 111 */         if (!(type instanceof XSSimpleTypeDefinition))
/*     */           continue;
/* 113 */         XSSimpleTypeDefinition stype = (XSSimpleTypeDefinition)type;
/*     */
/* 115 */         String nsuri = type.getNamespace();
/* 116 */         String tname = type.getName();
/* 117 */         if ((!"http://www.w3.org/2001/XMLSchema".equals(nsuri)) || (!"anyType".equals(tname))) {
/* 118 */           checkXSDTypeToJava();
/* 119 */           this.xsdJava.createJavaFile(stype, dirloc, packageName, xsmodel);
/*     */         }
/*     */       }
View Full Code Here

        continue;
      if (this.fMaps != null)
        return (XSObject)this.fMaps[i].get(paramString2);
      for (int j = 0; j < this.fLength; j++)
      {
        XSObject localXSObject = this.fArray[j];
        if (localXSObject.getName().equals(paramString2))
          return localXSObject;
      }
      return null;
    }
    return null;
View Full Code Here

            {
               XSNamedMap components = model.getComponents(XSConstants.ELEMENT_DECLARATION);
               String roots = "";
               for(int j = 0; j < components.getLength(); ++j)
               {
                  XSObject xsObject = components.item(j);
                  if(j > 0)
                  {
                     roots += ", ";
                  }
                  roots += "{" + xsObject.getNamespace() + "}" + xsObject.getName();
               }
               throw new IllegalStateException("Root element not found: " + qName + " among " + roots);
            }

            Object o = provider.getRoot(root, null, element.getNamespace(), element.getName());
View Full Code Here

         {
            List<QName> typeNames = new ArrayList<QName>();
            XSNamedMap types = model.getComponents(XSConstants.TYPE_DEFINITION);
            for(int i = 0; i < types.getLength(); ++i)
            {
               XSObject type = types.item(i);
               if(!Constants.NS_XML_SCHEMA.equals(type.getNamespace()))
               {
                  typeNames.add(new QName(type.getNamespace(), type.getName()));
               }
            }
            throw new JBossXBRuntimeException("Type " +
               mapping.typeName +
               " is not defined in the schema." +
View Full Code Here

                if (fMaps != null) {
                    return (XSObject)fMaps[i].get(localName);
                }
                // Otherwise (it's created from an array)
                // go through the array to find a matching name
                XSObject ret;
                for (int j = 0; j < fLength; j++) {
                    ret = fArray[j];
                    if (ret.getName().equals(localName)) {
                        return ret;
                    }
                }
                return null;
            }
View Full Code Here

        // Defer creation of the entry set until it is actually needed.
        if (fEntrySet == null) {
            final int length = getLength();
            final XSNamedMapEntry[] entries = new XSNamedMapEntry[length];
            for (int i = 0; i < length; ++i) {
                XSObject xso = item(i);
                entries[i] = new XSNamedMapEntry(new QName(xso.getNamespace(), xso.getName()), xso);
            }
            // Create a view of this immutable map.
            fEntrySet = new AbstractSet() {
                public Iterator iterator() {
                    return new Iterator() {
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.