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

name.remal.java.lang.Class-kotlin.Annotation.kt Maven / Gradle / Ivy

There is a newer version: 1.26.147
Show newest version
package name.remal

import name.remal.annotation.AnnotationUtils
import java.lang.annotation.ElementType
import java.lang.annotation.Inherited
import java.lang.reflect.AnnotatedElement
import java.lang.reflect.Method

val  Class.isLangCoreAnnotation get() = AnnotationUtils.isLangCoreAnnotation(this)

val  Class.isInherited: Boolean get() = null != getDeclaredAnnotation(Inherited::class.java)

val  Class.canAnnotateTypes: Boolean get() = canAnnotate(ElementType.TYPE)
val  Class.canAnnotateFields: Boolean get() = canAnnotate(ElementType.FIELD)
val  Class.canAnnotateMethods: Boolean get() = canAnnotate(ElementType.METHOD)
val  Class.canAnnotateParameters: Boolean get() = canAnnotate(ElementType.PARAMETER)
val  Class.canAnnotateConstructors: Boolean get() = canAnnotate(ElementType.CONSTRUCTOR)
val  Class.canAnnotateLocalVariables: Boolean get() = canAnnotate(ElementType.LOCAL_VARIABLE)
val  Class.canAnnotateAnnotations: Boolean get() = canAnnotate(ElementType.ANNOTATION_TYPE)
val  Class.canAnnotatePackages: Boolean get() = canAnnotate(ElementType.PACKAGE)
val  Class.canAnnotateTypeParameters: Boolean get() = canAnnotate(ElementType.TYPE_PARAMETER)
val  Class.canAnnotateTypeUses: Boolean get() = canAnnotate(ElementType.TYPE_USE)

val  Class.attributeMethods: List get() = AnnotationUtils.getAttributeMethods(this)


fun  Class.canAnnotate(elementType: ElementType) = AnnotationUtils.canAnnotate(this, elementType)
fun  Class.canAnnotate(element: AnnotatedElement) = AnnotationUtils.canAnnotate(this, element)

fun  Class.newAnnotationInstance(attributes: Map? = null) = AnnotationUtils.newAnnotationInstance(this, attributes)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy