Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.StringList


               baseType = prefix + ":" + baseType;
            }

            // currently only handle enumerations
            buf.append("<restriction base='" + baseType + "'>");
            StringList list = ((XSSimpleTypeDefinition)xstype).getLexicalEnumeration();
            for (int i = 0; i < list.getLength(); i++)
            {
               String listItem = DOMWriter.normalize(list.item(i), false);
               buf.append("<enumeration value='" + listItem + "'/>");
            }
            buf.append("</restriction>");
         }
         buf.append("</simpleType>");
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
            jwriter.createJavaFileForEnumeratedValues(fname, slist, loc, pkgname, xsSimple);
         }
         else
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

                        for (Object item : (Collection) value) {
                            model.addElement(item);
                        }
                    }
                    else if (value instanceof StringList) {
                        StringList strList = (StringList) value;
                        for (int i = 0; i < strList.getLength(); ++i) {
                            model.addElement(strList.item(i));
                        }
                    }
                    else if (value instanceof XSModelGroup) {
                        XSModelGroup group = (XSModelGroup) value;
                        XSObjectList list = group.getParticles();
View Full Code Here

         */
        XSNamespaceItemList namespaces = model.getNamespaceItems();
        final URI absolutePath = schema.getAbsoluteFile().toURI();
        for (int i = 0; i < namespaces.getLength(); ++i) {
            XSNamespaceItem namespace = namespaces.item(i);
            StringList documentLocations = namespace.getDocumentLocations();
            for (int j = 0; j < documentLocations.getLength(); ++j) {

                try {
                    URI fname = new URI(documentLocations.item(j));
                    XSModelHelper.logger.debug("Namespace [" + namespace.getSchemaNamespace() + "] file [" + fname + "] absolute path [" + absolutePath + "]");
                    if (absolutePath.equals(fname)) { return namespace; }
                }
                catch (URISyntaxException e) {
                    e.printStackTrace();
                    XSModelHelper.logger.error("Cannot construct URI from document location [" + documentLocations.item(i) + "] for namespace [" + namespace + "].", e);
                }

            }
        }
        return null;
View Full Code Here

        XSTypeDefinition baseType = SimpleTypeDescription.getBaseTypeRecursive(stypedef);
        AbstractTypeDescription.appendBaseType(signature, baseType);

        // get facets
        Map<Short, String> facets = SimpleTypeDescription.getFacets(stypedef);
        StringList patterns = stypedef.getLexicalPattern();

        for (Short facet : XSAnalyzerConstants.USED_FACETS) {
            signature.append(facet).append(":");
            signature.append(facets.get(facet)).append(":");
        }
        for (int i = 0; i < patterns.getLength(); ++i) {
            signature.append(patterns.item(i)).append(":");
        }

        // handle enumeration
        StringList enumeration = stypedef.getLexicalEnumeration();
        List<String> enumCollection = XSListHelper.asList(enumeration);
        Collections.sort(enumCollection);
        for (String value : enumCollection) {
            signature.append(value).append(":");
        }
View Full Code Here

        @Override
        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
            final JLabel cell = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);

            if (value instanceof StringList) {
                StringList def = (StringList) value;
                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < def.getLength(); ++i) {
                    sb.append(def.item(i));
                    if (i < (def.getLength() - 1)) {
                        sb.append(", ");
                    }
                }
                cell.setText(sb.toString());
            }
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

               baseType = prefix + ":" + baseType;
            }

            // currently only handle enumerations
            buf.append("<restriction base='" + baseType + "'>");
            StringList list = ((XSSimpleTypeDefinition)xstype).getLexicalEnumeration();
            for (int i = 0; i < list.getLength(); i++)
            {
               String listItem = DOMWriter.normalize(list.item(i), false);
               buf.append("<enumeration value='" + listItem + "'/>");
            }
            buf.append("</restriction>");
         }
         buf.append("</simpleType>");
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.