Examples of XSSimpleTypeDefinition


Examples of org.apache.xerces.xs.XSSimpleTypeDefinition

     */
    public static String fillInTemplate(String tmpl, String cppElementName, XSElementDeclaration element,
            XSAttributeUse attrUse, String dataMethodName, XSTypeDefinition type, String simpleTypeValiTmpl,
            IGenerationDataProvider dataProvider) {

        XSSimpleTypeDefinition simpleType = Util.findSimpleTypeDefinition(type);
        Variety variety = Util.findVariety(simpleType);
        XSSimpleTypeDefinition listType = null;
        if (variety == Variety.LIST) {
            listType = simpleType;
            simpleType = Util.findListItemType(simpleType);
        }
        String xsdType = Util.findXSDSimpleTypeString(simpleType, dataProvider.getConfig());
View Full Code Here

Examples of org.apache.xerces.xs.XSSimpleTypeDefinition

            if (tmpl.contains(Constants.TMPL_UNION_TO_UNION_PER_MEMBER)) {
                String allMembersCode = new String();
                List<XSSimpleTypeDefinition> memberTypes = Util.objectListToList(unionType.getMemberTypes());
                for (int i = 0; i < memberTypes.size(); i++) {
                    String perMemberTmpl = config.getTemplateUnionFuncToUnionPerMember();
                    XSSimpleTypeDefinition memberType = memberTypes.get(i);
                    perMemberTmpl = fillInUnionMemberTemplate(perMemberTmpl, unionType, memberType, i, dataProvider);
                    allMembersCode += perMemberTmpl;
                }
                tmpl = tmpl.replace(Constants.TMPL_UNION_TO_UNION_PER_MEMBER, allMembersCode);
            }
View Full Code Here

Examples of org.apache.xerces.xs.XSSimpleTypeDefinition

    /**
     * Creates parameter list of data convenience method.
     */
    protected String createDataConvenienceParameterList(XSTypeDefinition type) {
        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

Examples of org.apache.xerces.xs.XSSimpleTypeDefinition

     * {@inheritDoc}
     *
     * @see de.netallied.xsd2cppsax.IGenerationDataProvider#findCorrectCppTypeForAttribute(com.sun.org.apache.xerces.internal.xs.XSTypeDefinition)
     */
    public String findCorrectCppTypeForAttribute(XSTypeDefinition type) {
        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

Examples of org.apache.xerces.xs.XSSimpleTypeDefinition

                printBeginConvenienceMethod(cppName, element, hasAttributes);
                printEndConvenienceMethod(cppName, element);

                if (hasChardata) {
                    XSSimpleTypeDefinition simpleType = Util.findSimpleTypeDefinition(typeDefinition);
                    if (Util.hasStreamingFacets(simpleType)) {
                        printComplexValidationDataStruct(cppName, element);
                    }
                    if (xsSimpleType2validationFunctionName.get(simpleType) != null) {
                        printSimpleValidationFunctions(simpleType);
                    }
                    if (Util.findVariety(simpleType) == Variety.LIST) {
                        printSimpleValidationFunctions(simpleType.getItemType());
                    }
                    printDataConvenienceMethod(cppName, element);
                }

                // printPrivate();
View Full Code Here

Examples of org.apache.xerces.xs.XSSimpleTypeDefinition

     * special XSD types we have to generate own C++ types for. They have to be
     * handled independent of elements to avoid mixing up of generated methods.
     */
    protected void handleEnumsAndUnions() {
        for (EnumNameTypePair pair : unionsToBeHandled) {
            XSSimpleTypeDefinition unionType = pair.getXsdType();
            List<XSSimpleTypeDefinition> memberTypes = Util.objectListToList(unionType.getMemberTypes());
            for (XSSimpleTypeDefinition memberType : memberTypes) {
                if (Util.hasFacetEnum(memberType)) {
                    String cppType = cppEnumOrUnionNameCreator.createEnumTypeName(memberType, getElementStack());
                    enumsToBeHandled.add(new EnumNameTypePair(cppType, memberType));
                }
View Full Code Here

Examples of org.apache.xerces.xs.XSSimpleTypeDefinition

     */
    protected void printAttributeFreeing(String cppName, XSElementDeclaration element, List<XSAttributeUse> attrs) {
        printAttributeFreeingDataStructCast(cppName, element);

        for (XSAttributeUse attr : attrs) {
            XSSimpleTypeDefinition type = Util.getType(attr);
            Variety variety = Util.findVariety(type);
            if (variety == Variety.LIST) {
                privateImplSourceFile.println(TemplateEngine.fillInTemplate(config.getTemplateFreeAttrList(), cppName,
                        element, attr, null, null, null, this));
            }
View Full Code Here

Examples of org.apache.xerces.xs.XSSimpleTypeDefinition

            privateImplSourceFile.println("case "
                    + Util.createAttributeNameHashIdentifier(Util.getAttributeOriginalName(attr, config)) + ":");
            privateImplSourceFile.print(config.getIndentation());
            privateImplSourceFile.println("{");

            XSSimpleTypeDefinition attrType = Util.getType(attr);
            String template = null;
            String simpleTypeValiTmpl = null;
            switch (Util.findVariety(attrType)) {
            case ATOMIC:
                template = config.getTemplateAttributeAtomicConversion();
                if (!Util.hasFacetEnum(attrType)) {
                    if (Util.isNumericType(attrType, config)) {
                        simpleTypeValiTmpl = config.getTemplateSimpleValidationNumericAtomicAttribute();
                    } else {
                        if (xsType2validationDataStructName.get(attrType) != null
                                || xsSimpleType2validationFunctionName.get(attrType) != null) {
                            simpleTypeValiTmpl = config.getTemplateSimpleValidationStringAtomicAttribute();
                        }
                    }
                }
                break;
            case LIST:
                template = config.getTemplateAttributeListConversion();
                XSSimpleTypeDefinition itemType = attrType.getItemType();
                if (Util.isNumericType(itemType, config) && !Util.hasFacetEnum(itemType)) {
                    simpleTypeValiTmpl = config.getTemplateSimpleValidationNumericListAttribute();
                } else {
                    simpleTypeValiTmpl = config.getTemplateSimpleValidationStringListAttribute();
                }
View Full Code Here

Examples of org.apache.xerces.xs.XSSimpleTypeDefinition

            privateImplSourceFile.print("0, ");
        }

        for (int i = 0; i < attributeUses.size(); i++) {
            XSAttributeUse attributeUse = attributeUses.get(i);
            XSSimpleTypeDefinition simpleTypeDefinition = Util.getType(attributeUse);
            Variety variety = Util.findVariety(simpleTypeDefinition);
            if (variety == Variety.ATOMIC) {
                if (Util.hasDefaultValue(attributeUse)) {
                    if (Util.hasFacetEnum(simpleTypeDefinition)) {
                        String constraintValueString = attributeUse.getConstraintValue();
                        List<String> enumValues = Util.stringListToList(simpleTypeDefinition.getLexicalEnumeration());
                        int j = 0;
                        while (j < enumValues.size()) {
                            if (enumValues.get(j).equals(constraintValueString)) {
                                break;
                            }
View Full Code Here

Examples of org.apache.xerces.xs.XSSimpleTypeDefinition

        }

        // attributes
        for (XSAttributeUse attrUse : attributeUses) {
            attrHeaderFile.print(config.getIndentation());
            XSSimpleTypeDefinition typeDefinition = Util.getType(attrUse);

            if (xsSimpleType2validationFunctionName.get(typeDefinition) != null) {
                printSimpleValidationFunctions(typeDefinition);
            }
            if (Util.findVariety(typeDefinition) == Variety.LIST) {
                printSimpleValidationFunctions(typeDefinition.getItemType());
            }

            String cppMemberTypeName = findCorrectCppTypeForAttribute(typeDefinition);
            attrHeaderFile.print(cppMemberTypeName);
            attrHeaderFile.print(" ");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.