Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.StringList


        updateImportListFor(newGrammar);
        return newGrammar;
    }

    private void addNewGrammarLocations(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
        final StringList locations = srcGrammar.getDocumentLocations();
        final int locSize = locations.size();
        final StringList locations2 = dstGrammar.getDocumentLocations();
       
        for (int i=0; i<locSize; i++) {
            String loc = locations.item(i);
            if (!locations2.contains(loc)) {
                dstGrammar.addDocument(null, loc);
            }
        }
    }
View Full Code Here


        processPSVISchemaAnnotations(item.getAnnotations());
        sendUnIndentedElement("psv:namespaceSchemaInformation");
    }

    private void processPSVISchemaDocuments(XSNamespaceItem item) {
        StringList locations =
            item == null ? null : item.getDocumentLocations();
        if (locations == null || locations.getLength() == 0) {
            sendEmptyElementEvent("psv:schemaDocuments");
            return;
        }
        sendIndentedElement("psv:schemaDocuments");
        for (int i = 0; i < locations.getLength(); i++) {
            sendIndentedElement("psv:schemaDocument");
            sendElementEvent("psv:documentLocation", locations.item(i));
            // It's supposed to point to a <document> element, and we're not really
            // dealing with those (except for the one at the root)
            sendElementEvent("psv:document");
            sendUnIndentedElement("psv:schemaDocument");
        }
View Full Code Here

                for (int i = 0; i < multiValueFacets.getLength(); i++) {
                    XSMultiValueFacet facet =
                        (XSMultiValueFacet)multiValueFacets.item(i);
                    String name = this.translateFacetKind(facet.getFacetKind());
                    sendIndentedElement("psv:" + name);
                    StringList values = facet.getLexicalFacetValues();
                    for (int j = 0; j < values.getLength(); j++) {
                        sendElementEvent("psv:value", values.item(j));
                    }
                    sendElementEvent("psv:fixed", "false");
                    processPSVIAnnotations(facet.getAnnotations());
                    sendUnIndentedElement("psv:" + name);
                }
View Full Code Here

        sendElementEvent(
            "psv:variety",
            this.translateConstraintType(wildcard.getConstraintType()));

        StringBuffer constraintBuffer = new StringBuffer();
        StringList constraints = wildcard.getNsConstraintList();
        if (constraints != null && constraints.getLength() > 0) {
            for (int i = 0; i < constraints.getLength() - 1; i++) {
                constraintBuffer.append(constraints.item(i));
                constraintBuffer.append(" ");
            }
            constraintBuffer.append(
                constraints.item(constraints.getLength() - 1));
        }
        sendElementEvent("psv:namespaces", constraintBuffer.toString());

        sendUnIndentedElement("psv:namespaceConstraint");
        sendElementEvent(
View Full Code Here

      {
         localDoc = new DocumentBindingImpl(delegate);
      }

      XSModel model = loadSchema(xsdUrl);
      StringList namespaces = model.getNamespaces();
      for(int i = 0; i < namespaces.getLength(); ++i)
      {
         String namespaceUri = namespaces.item(i);
         NamespaceBindingImpl ns = localDoc.bindNamespace(namespaceUri);

         XSNamedMap components = model.getComponentsByNamespace(XSConstants.ELEMENT_DECLARATION, namespaceUri);
         for(int j = 0; j < components.getLength(); ++j)
         {
View Full Code Here

     */
    protected void printEnum(String cppEnumTypeName, XSSimpleTypeDefinition simpleType) {
        enumHeaderFile.println("enum " + cppEnumTypeName);
        enumHeaderFile.println("{");

        StringList enumStringList = simpleType.getLexicalEnumeration();
        List<String> enumValues = Util.stringListToList(enumStringList);
        for (int i = 0; i < enumValues.size(); i++) {
            enumHeaderFile.print(config.getIndentation());
            enumHeaderFile.print(Util.createEnumValueName(cppEnumTypeName, enumValues, i, simpleType, config));
            enumHeaderFile.print(" = ");
View Full Code Here

        enumSourceFile.println(TemplateEngine.fillInTemplate(TemplateEngine.fillInEnumTemplate(config
                .getTemplateEnumMapDefinitionStart(), cppEnumTypeName, simpleType, null, 0, this), null, null, null,
                null, null, null, this));
        enumSourceFile.println("{");

        StringList enumStringList = simpleType.getLexicalEnumeration();
        List<String> enumValues = Util.stringListToList(enumStringList);
        Collections.sort(enumValues);
        for (int i = 0; i < enumValues.size(); i++) {
            enumSourceFile.print(TemplateEngine.fillInTemplate(TemplateEngine.fillInEnumTemplate(config
                    .getTemplateEnumMapEntry(), cppEnumTypeName, simpleType, enumValues, i, this), null, null, null,
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

    /**
     * Obtains pattern facet of simple type.
     */
    public static String collectPatternFacet(XSSimpleTypeDefinition simpleType) {
        String pattern = new String();
        StringList lexicalPatterns = simpleType.getLexicalPattern();

        // TODO check how to use multiple pattern values
        // http://www.w3.org/TR/xmlschema11-2/#rf-pattern
        // 4.3.4.2 XML Representation of pattern Schema Components

        // for (int i = 0; i < lexicalPatterns.getLength(); i++) {
        // pattern += lexicalPatterns.item(i);
        // }

        // for (int i = 0; i < lexicalPatterns.getLength(); i++) {
        // if (i != 0) {
        // // pattern = "|" + pattern;
        // pattern = "&(" + pattern + ")";
        // }
        // pattern += lexicalPatterns.item(i);
        // }

        // if (lexicalPatterns.getLength() > 0) {
        // pattern = lexicalPatterns.item(0);
        // }

        if (lexicalPatterns.getLength() > 0) {
            pattern = lexicalPatterns.item(lexicalPatterns.getLength() - 1);
        }

        return pattern;
    }
View Full Code Here

        fprintfSourceFile.println();
        fprintfSourceFile.println("{");

        fprintfSourceFile.print(getConfig().getIndentation());
        fprintfSourceFile.println("switch ( value ) {");
        StringList enumStringList = simpleType.getLexicalEnumeration();
        List<String> enumValues = Util.stringListToList(enumStringList);
        for (int i = 0; i < enumValues.size(); i++) {
            fprintfSourceFile.print(getConfig().getIndentation());
            fprintfSourceFile.print("case ");
            fprintfSourceFile.print(Util.createEnumValueName(cppEnumTypeName, enumValues, i, simpleType, getConfig()));
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.