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

main.name.remal.gradle_plugins.plugins.generate_sources.GeneratingStringWriter.kt Maven / Gradle / Ivy

There is a newer version: 1.9.2
Show newest version
package name.remal.gradle_plugins.plugins.generate_sources

import name.remal.default
import name.remal.gradle_plugins.dsl.artifact.CachedArtifactsCollection
import java.io.File
import java.io.StringWriter

open class GeneratingStringWriter(protected val classpath: Iterable = emptyList()) : StringWriter(), GeneratingWriterInterface {

    final override fun toString() = super.toString()

    override fun write(cbuf: CharArray, from: Int, len: Int) = super.write(cbuf, from, len)
    override fun write(obj: Any?) = super.write(obj?.toString().default("null"))

    override fun append(csq: CharSequence?) = super.append(csq)
    override fun append(csq: CharSequence?, start: Int, end: Int) = super.append(csq, start, end)
    override fun append(c: Char) = super.append(c)

    override fun isClassInClasspath(className: String) = CachedArtifactsCollection(classpath).containsClass(className)

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy