All Downloads are FREE. Search and download functionalities are using the official Maven repository.

godot.entrygenerator.checks.DefaultConstructorCheck.kt Maven / Gradle / Ivy

There is a newer version: 0.10.0-4.3.0
Show newest version
package godot.entrygenerator.checks

import godot.entrygenerator.model.SourceFile
import godot.entrygenerator.utils.Logger

class DefaultConstructorCheck(logger: Logger, sourceFiles: List): BaseCheck(logger, sourceFiles) {
    override fun execute(): Boolean {
        var hasIssue = false
        sourceFiles
            .flatMap { it.registeredClasses }
            .filter { !it.isAbstract }
            .forEach { registeredClass ->
                if (registeredClass.constructors.none { it.parameters.isEmpty() }) {
                    hasIssue = true
                    logger.error(registeredClass, "RegisteredClass does not have a public default constructor")
                }
            }
        return hasIssue
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy