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

gsonpath.model.FieldInfo.kt Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package gsonpath.model

import javax.lang.model.element.Element

/**
 * Contains important information about a class field within a class annotated with the AutoGsonAdapter annotation.
 */
interface FieldInfo {
    val fieldType: FieldType

    /**
     * The name of the class that field is contained within.
     */
    val parentClassName: String

    /**
     * Searches for an annotation that is attached to the field.
     */
    fun  getAnnotation(annotationClass: Class): T?

    /**
     * The name of the field this [FieldInfo] represents.
     */
    val fieldName: String

    /**
     * The mechanism for accessing the field from the class.
     *
     * This allows the library to either access the variable via an exposed field, or potentially a getter instead.
     */
    val fieldAccessor: String

    /**
     * Returns the raw names of all annotations attached to the field.
     *
     * This is useful for finding annotations without having the annotation class included in the
     * annotation processor library.
     */
    val annotationNames: List

    /**
     * The raw annotation processor field element.
     * This should mainly be used for reporting errors back to the user.
     */
    val element: Element

    /**
     * Whether the field has a default value assigned.
     */
    val hasDefaultValue: Boolean
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy