Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSSimpleTypeDefinition


                            + Util.replaceCharactersForbiddenInCppIdentifiers(element.getName());
                }
            }
            xsSimpleType2validationFunctionName.put(type, name);

            XSSimpleTypeDefinition itemType = type.getItemType();
            if (itemType != null) {
                // TODO check if it is save to pass unchanged cppName here.
                createSimpleValidationFunctionName(cppName, element, itemType);
            }
        }
View Full Code Here


            for (int i = 0; i < attributeUses.getLength(); i++) {
                XSObject item = attributeUses.item(i);
                if (item instanceof XSAttributeUse) {
                    XSAttributeUse attrUse = (XSAttributeUse) item;
                    XSSimpleTypeDefinition simpleType = Util.getType(attrUse);
                    createSimpleValidationFunctionName(element2ElementName.get(element).cppElementName, element,
                            simpleType);
                }
            }
        }
        XSSimpleTypeDefinition simpleType = Util.findSimpleTypeDefinition(element.getTypeDefinition());
        if (simpleType != null) {
            if (Util.hasStreamingFacets(simpleType)) {
                createComplexValidationDataStructName(element2ElementName.get(element).cppElementName, element,
                        simpleType);
            }
View Full Code Here

         ct.setContentType(XSComplexTypeDefinition.CONTENTTYPE_EMPTY);
         xt = ct;
      }
      else
      {
         XSSimpleTypeDefinition xstype = (new SchemaDVFactoryImpl()).getBuiltInType(localpart);
         xt = new JBossXSSimpleTypeDefinition(xstype);

      }
      return xt;
   }
View Full Code Here

                countAttrPresent = true;
                break;
            }
        }
        if (countAttrPresent) {
            XSSimpleTypeDefinition simpleType = Util.findSimpleTypeDefinition(element.getTypeDefinition());
            if (simpleType != null) {
                Variety variety = Util.findVariety(simpleType);
                if (variety == Variety.LIST) {
                    return true;
                }
View Full Code Here

        String xsNamespace = config.getXSNamespace();
        if (typeMapping.containsKey(type.getName()) && namespace.equals(xsNamespace)) {
            return type;
        } else {
            XSTypeDefinition baseType = type.getBaseType();
            XSSimpleTypeDefinition simpleBaseType = findSimpleTypeDefinition(baseType);
            if (simpleBaseType != null) {
                return findBuildinBaseType(simpleBaseType, config);
            } else {
                return null;
            }
View Full Code Here

     * @param type
     *            XSD type to find C++ type for.
     * @return C++ type.
     */
    static public String findCorrectCppAtomicType(XSTypeDefinition type, Config config) {
        XSSimpleTypeDefinition simpleType = Util.findSimpleTypeDefinition(type);
        Variety variety = Util.findVariety(simpleType);
        if (variety == Variety.LIST) {
            simpleType = Util.findListItemType(simpleType);
        }
        String xsdType = Util.findXSDSimpleTypeString(simpleType, config);
View Full Code Here

        if (simpleType == null) {
            // TODO check what happens here
            // System.err.println("*** Try to find type for null");
            return Constants.DEFAULT_XSD_TYPE;
        }
        XSSimpleTypeDefinition baseType = findBuildinBaseType(simpleType, config);
        if (baseType != null) {
            return baseType.getName();
        } else {
            // TODO check what happens here
            // System.err.println("*** Could not find base type for: " +
            // simpleType.getName());
            return Constants.DEFAULT_XSD_TYPE;
View Full Code Here

     * @param config
     *            Config.
     * @return True if initialization is required, false otherwise.
     */
    public static boolean isAttributeInitializationRequired(XSAttributeUse attrUse, Config config) {
        XSSimpleTypeDefinition type = getType(attrUse);
        Variety variety = findVariety(type);
        if (variety == Variety.LIST || variety == Variety.UNION) {
            return true;
        } else {
            if (hasFacetEnum(type) || isStringType(type, config) || isNumericType(type, config)
View Full Code Here

    /**
     * Finds out if it is necessary to crate a C++ present mask for given
     * attribute.
     */
    public static boolean presentMaskRequired(XSAttributeUse attrUse, Config config) {
        XSSimpleTypeDefinition type = getType(attrUse);
        Variety variety = findVariety(type);
        if (variety == Variety.LIST || variety == Variety.UNION) {
            return true;
        } else {
            if (hasFacetEnum(type)) {
View Full Code Here

        fprintfSourceFile.print(getConfig().getIndentation());
        fprintfSourceFile.print(getConfig().getIndentation());
        fprintfSourceFile.println("for (size_t i=0; i<" + value + ".size; ++i) {");

        XSSimpleTypeDefinition itemType = attrType.getItemType();
        if (Util.findVariety(itemType) == Variety.UNION) {
            printAttributeListItemUnion(itemType, value);
        } else if (Util.isFloatType(itemType, getConfig())) {
            printAttributeListItemFloat(itemType, value);
        } else if (Util.isNumericType(itemType, getConfig()) || Util.isBoolType(itemType, getConfig())) {
View Full Code Here

TOP

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

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.