Class CppQtAbstractCodegen

    • Constructor Detail

      • CppQtAbstractCodegen

        public CppQtAbstractCodegen()
    • Method Detail

      • getTypeDeclaration

        public String getTypeDeclaration​(io.swagger.v3.oas.models.media.Schema p)
        Optional - type declaration. This is a String which is used by the templates to instantiate your types. There is typically special handling for different property types
        Specified by:
        getTypeDeclaration in interface CodegenConfig
        Overrides:
        getTypeDeclaration in class DefaultCodegen
        Parameters:
        p - property schema
        Returns:
        a string value used as the `dataType` field for model templates, `returnType` for api templates
      • toDefaultValue

        public String toDefaultValue​(io.swagger.v3.oas.models.media.Schema p)
        Description copied from class: DefaultCodegen
        Return the default value of the property

        This method should be overridden in the generator to meet its requirement. Return null if you do NOT want a default value. Any non-null value will cause {{#defaultValue} check to pass.

        Overrides:
        toDefaultValue in class DefaultCodegen
        Parameters:
        p - Property schema
        Returns:
        string presentation of the default value of the property
      • getSchemaType

        public String getSchemaType​(io.swagger.v3.oas.models.media.Schema p)
        Optional - OpenAPI type conversion. This is used to map OpenAPI types in a `Schema` into either language specific types via `typeMapping` or into complex models if there is not a mapping.
        Overrides:
        getSchemaType in class DefaultCodegen
        Parameters:
        p - property schema
        Returns:
        a string value of the type or complex model for this property
      • toVarName

        public String toVarName​(String name)
        Description copied from class: DefaultCodegen
        Return the variable name by removing invalid characters and proper escaping if it's a reserved word.
        Overrides:
        toVarName in class AbstractCppCodegen
        Parameters:
        name - the variable name
        Returns:
        the sanitized variable name
      • toParamName

        public String toParamName​(String name)
        Description copied from class: DefaultCodegen
        Return the parameter name by removing invalid characters and proper escaping if it's a reserved word.
        Specified by:
        toParamName in interface CodegenConfig
        Overrides:
        toParamName in class AbstractCppCodegen
        Parameters:
        name - Codegen property object
        Returns:
        the sanitized parameter name
      • needToImport

        protected boolean needToImport​(String type)
        Description copied from class: DefaultCodegen
        Check the type to see if it needs import the library/module/package
        Overrides:
        needToImport in class DefaultCodegen
        Parameters:
        type - name of the type
        Returns:
        true if the library/module/package of the corresponding type needs to be imported
      • isDataTypeString

        public boolean isDataTypeString​(String dataType)
        Description copied from class: DefaultCodegen
        checks if the data should be classified as "string" in enum e.g. double in C# needs to be double-quoted (e.g. "2.8") by treating it as a string In the future, we may rename this function to "isEnumString"
        Overrides:
        isDataTypeString in class DefaultCodegen
        Parameters:
        dataType - data type
        Returns:
        true if it's a enum string
      • setContentCompressionEnabled

        public void setContentCompressionEnabled​(boolean flag)