gsonpath.model.FieldInfo.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gsonpath-compiler-base Show documentation
Show all versions of gsonpath-compiler-base Show documentation
An annotation processor which generates Type Adapters for the Google Gson library
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
}