Class AbstractScalaCodegen

    • Field Detail

      • modelPropertyNaming

        protected String modelPropertyNaming
      • invokerPackage

        protected String invokerPackage
      • sourceFolder

        protected String sourceFolder
      • stripPackageName

        protected boolean stripPackageName
    • Constructor Detail

      • AbstractScalaCodegen

        public AbstractScalaCodegen()
    • Method Detail

      • setSourceFolder

        public void setSourceFolder​(String sourceFolder)
      • getSourceFolder

        public String getSourceFolder()
      • escapeReservedWord

        public String escapeReservedWord​(String name)
        Description copied from class: DefaultCodegen
        Return the escaped name of the reserved word
        Overrides:
        escapeReservedWord in class DefaultCodegen
        Parameters:
        name - the name to be escaped
        Returns:
        the escaped reserved word throws Runtime exception as reserved word is not allowed (default behavior)
      • processCompiler

        public com.samskivert.mustache.Mustache.Compiler processCompiler​(com.samskivert.mustache.Mustache.Compiler compiler)
        Overrides:
        processCompiler in class DefaultCodegen
      • getTypeDeclaration

        public String getTypeDeclaration​(io.swagger.models.properties.Property p)
        Description copied from class: DefaultCodegen
        Output the type declaration of the property
        Overrides:
        getTypeDeclaration in class DefaultCodegen
        Parameters:
        p - Swagger Property object
        Returns:
        a string presentation of the property type
      • getSwaggerType

        public String getSwaggerType​(io.swagger.models.properties.Property p)
        Description copied from class: DefaultCodegen
        returns the swagger type for the property
        Overrides:
        getSwaggerType in class DefaultCodegen
        Parameters:
        p - Swagger property object
        Returns:
        string presentation of the type
      • toInstantiationType

        public String toInstantiationType​(io.swagger.models.properties.Property p)
        Description copied from class: DefaultCodegen
        Return the instantiation type of the property, especially for map and array
        Overrides:
        toInstantiationType in class DefaultCodegen
        Parameters:
        p - Swagger property object
        Returns:
        string presentation of the instantiation type of the property
      • toDefaultValue

        public String toDefaultValue​(io.swagger.models.properties.Property p)
        Description copied from class: DefaultCodegen
        Return the default value of the property
        Overrides:
        toDefaultValue in class DefaultCodegen
        Parameters:
        p - Swagger property object
        Returns:
        string presentation of the default value of the property
      • toModelFilename

        public String toModelFilename​(String name)
        Description copied from class: DefaultCodegen
        Return the capitalized file name of the model
        Overrides:
        toModelFilename in class DefaultCodegen
        Parameters:
        name - the model name
        Returns:
        the file name of the model
      • escapeUnsafeCharacters

        public String escapeUnsafeCharacters​(String input)
        Description copied from class: DefaultCodegen
        override with any special text escaping logic to handle unsafe characters so as to avoid code injection
        Overrides:
        escapeUnsafeCharacters in class DefaultCodegen
        Parameters:
        input - String to be cleaned up
        Returns:
        string with unsafe characters removed or escaped
      • formatIdentifier

        protected String formatIdentifier​(String name,
                                          boolean capitalized)
      • stripPackageName

        protected String stripPackageName​(String input)
      • escapeQuotationMark

        public String escapeQuotationMark​(String input)
        Description copied from class: DefaultCodegen
        Escape single and/or double quote to avoid code injection
        Overrides:
        escapeQuotationMark in class DefaultCodegen
        Parameters:
        input - String to be cleaned up
        Returns:
        string with quotation mark removed or escaped