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

gsonpath.Logger.kt Maven / Gradle / Ivy

Go to download

An annotation processor which generates Type Adapters for the Google Gson library

There is a newer version: 4.0.0
Show newest version
package gsonpath

import javax.annotation.processing.ProcessingEnvironment
import javax.lang.model.element.Element
import javax.tools.Diagnostic

class Logger(private val processingEnv: ProcessingEnvironment) {

    fun printMessage(message: String) {
        println(LOG_PREFIX + message)
    }

    fun printError(message: String, element: Element? = null) {
        if (element != null) {
            processingEnv.messager.printMessage(Diagnostic.Kind.ERROR, LOG_PREFIX + message, element)
        } else {
            processingEnv.messager.printMessage(Diagnostic.Kind.ERROR, LOG_PREFIX + message)
        }
    }

    companion object {
        private const val LOG_PREFIX = "Gson Path: "
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy