Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.StringList


/* 551 */           String prefix = getPrefix(ns);
/* 552 */           baseType = prefix + ":" + baseType;
/*     */         }
/*     */
/* 556 */         buf.append("<restriction base='" + baseType + "'>");
/* 557 */         StringList list = ((XSSimpleTypeDefinition)xstype).getLexicalEnumeration();
/* 558 */         for (int i = 0; i < list.getLength(); i++)
/*     */         {
/* 560 */           String listItem = DOMWriter.normalize(list.item(i), false);
/* 561 */           buf.append("<enumeration value='" + listItem + "'/>");
/*     */         }
/* 563 */         buf.append("</restriction>");
/*     */       }
/* 565 */       buf.append("</simpleType>");
View Full Code Here


/*  434 */         this.schema.setPackageMetaData(packageMetaData);
/*      */       }
/*      */
/*      */     }
/*      */
/*  441 */     StringList namespaceList = model.getNamespaces();
/*  442 */     Set namespaces = new LinkedHashSet(namespaceList.getLength());
/*  443 */     for (int i = 0; i < namespaceList.getLength(); i++)
/*  444 */       namespaces.add(namespaceList.item(i));
/*  445 */     this.schema.setNamespaces(namespaces);
/*      */
/*  447 */     XSNamedMap groups = model.getComponents(6);
/*  448 */     if (this.trace) {
/*  449 */       log.trace("Model groups: " + groups.getLength());
View Full Code Here

/*  530 */     XSTypeDefinition baseTypeDef = type.getBaseType();
/*  531 */     TypeBinding baseType = baseTypeDef == null ? null : bindType(baseTypeDef);
/*      */
/*  533 */     binding = baseType == null ? new TypeBinding(typeName) : new TypeBinding(typeName, baseType);
/*      */
/*  535 */     StringList strList = type.getLexicalPattern();
/*  536 */     if ((strList != null) && (strList.getLength() > 0))
/*      */     {
/*  538 */       for (int i = 0; i < strList.getLength(); i++)
/*      */       {
/*  540 */         binding.addLexicalPattern(strList.item(i));
/*      */       }
/*      */     }
/*      */
/*  544 */     strList = type.getLexicalEnumeration();
/*  545 */     if ((strList != null) && (strList.getLength() > 0))
/*      */     {
/*  547 */       for (int i = 0; i < strList.getLength(); i++)
/*      */       {
/*  549 */         binding.addEnumValue(strList.item(i));
/*      */       }
/*      */     }
/*      */
/*  553 */     if (type.getItemType() != null)
/*      */     {
View Full Code Here

/* 1189 */           marshalled = ((Boolean)value).booleanValue() ? "true" : "false";
/*      */         }
/*      */       }
/*      */       else
/*      */       {
/* 1194 */         StringList lexicalEnumeration = type.getLexicalEnumeration();
/* 1195 */         if ((lexicalEnumeration != null) && (lexicalEnumeration.getLength() > 0))
/*      */         {
/*      */           Method getValue;
/*      */           try {
/* 1200 */             getValue = value.getClass().getMethod("value", null);
/*      */           }
/*      */           catch (NoSuchMethodException e)
/*      */           {
/*      */             try
/*      */             {
/* 1206 */               getValue = value.getClass().getMethod("getValue", null);
/*      */             }
/*      */             catch (NoSuchMethodException e1)
/*      */             {
/* 1210 */               List values = new ArrayList(lexicalEnumeration.getLength());
/* 1211 */               for (int i = 0; i < lexicalEnumeration.getLength(); i++)
/*      */               {
/* 1213 */                 values.add(lexicalEnumeration.item(i));
/*      */               }
/*      */
/* 1216 */               throw new JBossXBRuntimeException("Failed to find neither value() nor getValue() in " + value.getClass() + " which is bound to enumeration type (" + type.getNamespace() + ", " + type.getName() + "): " + values);
/*      */             }
/*      */
View Full Code Here

/* 164 */     XSTypeDefinition baseType = xsSimple.getBaseType();
/*     */
/* 166 */     short variety = xsSimple.getVariety();
/* 167 */     if (1 == variety)
/*     */     {
/* 170 */       StringList slist = xsSimple.getLexicalEnumeration();
/* 171 */       if ((slist != null) && (slist.getLength() > 0))
/*     */       {
/* 174 */         this.jwriter.createJavaFileForEnumeratedValues(this.fname, slist, this.loc, this.pkgname, xsSimple);
/*     */       }
/*     */       else
/*     */       {
View Full Code Here

            marshalled = ((Boolean)value).booleanValue() ? "true" : "false";
         }
      }
      else
      {
         StringList lexicalEnumeration = type.getLexicalEnumeration();
         if(lexicalEnumeration != null && lexicalEnumeration.getLength() > 0)
         {
            Method getValue;
            try
            {
               getValue = value.getClass().getMethod("value", null);
            }
            catch(NoSuchMethodException e)
            {
               try
               {
                  getValue = value.getClass().getMethod("getValue", null);
               }
               catch(NoSuchMethodException e1)
               {
                  List<String> values = new ArrayList<String>(lexicalEnumeration.getLength());
                  for(int i = 0; i < lexicalEnumeration.getLength(); ++i)
                  {
                     values.add(lexicalEnumeration.item(i));
                  }

                  throw new JBossXBRuntimeException("Failed to find neither value() nor getValue() in " +
                     value.getClass() +
                     " which is bound to enumeration type (" +
View Full Code Here

               }
            }
         }
      }

      StringList namespaceList = model.getNamespaces();
      Set namespaces = new LinkedHashSet(namespaceList.getLength());
      for (int i = 0; i < namespaceList.getLength(); ++i)
         namespaces.add(namespaceList.item(i));
      schema.setNamespaces(namespaces);
     
      XSNamedMap groups = model.getComponents(XSConstants.MODEL_GROUP_DEFINITION);
      if (ctx.trace)
         log.trace("Model groups: " + groups.getLength());
View Full Code Here

      XSTypeDefinition baseTypeDef = type.getBaseType();
      TypeBinding baseType = baseTypeDef == null ? null : bindType(ctx, baseTypeDef);

      binding = baseType == null ? new TypeBinding(typeName) : new TypeBinding(typeName, baseType);

      StringList strList = type.getLexicalPattern();
      if(strList != null && strList.getLength() > 0)
      {
         for(int i = 0; i < strList.getLength(); ++i)
         {
            binding.addLexicalPattern(strList.item(i));
         }
      }

      strList = type.getLexicalEnumeration();
      if(strList != null && strList.getLength() > 0)
      {
         for(int i = 0; i < strList.getLength(); ++i)
         {
            binding.addEnumValue(strList.item(i));
         }
      }

      if(type.getItemType() != null)
      {
View Full Code Here

TOP

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

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.