Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.StringList


            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 values = new ArrayList(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


      short variety = xsSimple.getVariety();
      if (XSSimpleTypeDefinition.VARIETY_ATOMIC == variety)
      {
         //If the simple type has an enumerated list, then just use its type
         StringList slist = xsSimple.getLexicalEnumeration();
         if (slist != null && slist.getLength() > 0)
         {
            //Enumerated List
            String packageName = getPackageName(xsSimple.getNamespace());
            jwriter.createJavaFileForEnumeratedValues(fname, slist, getLocationForJavaGeneration(packageName), packageName, xsSimple);
         }
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

               }
            }
         }
      }

      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 (trace)
         log.trace("Model groups: " + groups.getLength());
View Full Code Here

      XSTypeDefinition baseTypeDef = type.getBaseType();
      TypeBinding baseType = baseTypeDef == null ? null : bindType(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

            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 values = new ArrayList(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

      short variety = xsSimple.getVariety();
      if (XSSimpleTypeDefinition.VARIETY_ATOMIC == variety)
      {
         //If the simple type has an enumerated list, then just use its type
         StringList slist = xsSimple.getLexicalEnumeration();
         if (slist != null && slist.getLength() > 0)
         {
            //Enumerated List
            String packageName = getPackageName(xsSimple.getNamespace());
            jwriter.createJavaFileForEnumeratedValues(fname, slist, getLocationForJavaGeneration(packageName), packageName, xsSimple);
         }
View Full Code Here

   public static String getTargetNamespace(XSModel xsmodel)
   {
      if (xsmodel == null)
         throw new IllegalArgumentException("Illegal Null Argument: xsmodel");
      String targetNS = null;
      StringList slist = xsmodel.getNamespaces();
      int len = slist != null ? slist.getLength() : 0;
      for (int i = 0; i < len; i++)
      {
         String ns = slist.item(i);
         if (Constants.NS_SCHEMA_XSD.equals(ns))
            continue;
         targetNS = ns;
         break;
      }
View Full Code Here

/*     */   public static String getTargetNamespace(XSModel xsmodel)
/*     */   {
/* 546 */     if (xsmodel == null)
/* 547 */       throw new IllegalArgumentException("Illegal Null Argument: xsmodel");
/* 548 */     String targetNS = null;
/* 549 */     StringList slist = xsmodel.getNamespaces();
/* 550 */     int len = slist != null ? slist.getLength() : 0;
/* 551 */     for (int i = 0; i < len; i++)
/*     */     {
/* 553 */       String ns = slist.item(i);
/* 554 */       if ("http://www.w3.org/2001/XMLSchema".equals(ns))
/*     */         continue;
/* 556 */       targetNS = ns;
/* 557 */       break;
/*     */     }
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.