public enum ElementKind { /** A package. */ PACKAGE, // Declared types /** An enum class. */ ENUM, /** * A class not described by a more specific kind (like {@code * ENUM} or {@code RECORD}). */ CLASS, /** An annotation interface. (Formerly known as an annotation type.) */ ANNOTATION_TYPE, /** * An interface not described by a more specific kind (like * {@code ANNOTATION_TYPE}). */ INTERFACE, // Variables /** An enum constant. */ ENUM_CONSTANT, /** * A field not described by a more specific kind (like * {@code ENUM_CONSTANT}). */ FIELD, /** A parameter of a method or constructor. */ PARAMETER, /** A local variable. */ LOCAL_VARIABLE, /** A parameter of an exception handler. */ EXCEPTION_PARAMETER, // Executables /** A method. */ METHOD, /** A constructor. */ CONSTRUCTOR, /** A static initializer. */ STATIC_INIT, /** An instance initializer. */ INSTANCE_INIT, /** A type parameter. */ TYPE_PARAMETER, /** * An implementation-reserved element. This is not the element * you are looking for. */ OTHER, // Constants added since initial release /** * A resource variable. * @since 1.7 */ RESOURCE_VARIABLE, /** * A module. * @since 9 */ MODULE, /** * A record class. * @since 16 */ RECORD, /** * A record component of a {@code record}. * @since 16 */ RECORD_COMPONENT, /** * A binding variable in a pattern. * @since 16 */ BINDING_VARIABLE;}Modifier
public enum Modifier {/** The modifier {@code public} */ PUBLIC, /** The modifier {@code protected} */ PROTECTED, /** The modifier {@code private} */ PRIVATE, /** The modifier {@code abstract} */ ABSTRACT, /** * The modifier {@code default} * @since 1.8 */ DEFAULT, /** The modifier {@code static} */ STATIC, /** * The modifier {@code sealed} * @since 17 */ SEALED, /** * The modifier {@code non-sealed} * @since 17 */ NON_SEALED { public String toString() { return "non-sealed"; } }, /** The modifier {@code final} */ FINAL, /** The modifier {@code transient} */ TRANSIENT, /** The modifier {@code volatile} */ VOLATILE, /** The modifier {@code synchronized} */ SYNCHRONIZED, /** The modifier {@code native} */ NATIVE, /** The modifier {@code strictfp} */ STRICTFP;}TypeMirror接口
public interface TypeMirror extends javax.lang.model.AnnotatedConstruct { //返回TypeKind范例,java语言中的范例.Types包罗基本范例,声明范例(类范例和接口类 //型),数组,范例变量和空范例 TypeKind getKind(); @Override List<? extends AnnotationMirror> getAnnotationMirrors(); @Override <A extends Annotation> A getAnnotation(Class<A> annotationType); @Override <A extends Annotation> A[] getAnnotationsByType(Class<A> annotationType);}public enum TypeKind { /** * The primitive type {@code boolean}. */ BOOLEAN, /** * The primitive type {@code byte}. */ BYTE, /** * The primitive type {@code short}. */ SHORT, /** * The primitive type {@code int}. */ INT, /** * The primitive type {@code long}. */ LONG, /** * The primitive type {@code char}. */ CHAR, /** * The primitive type {@code float}. */ FLOAT, /** * The primitive type {@code double}. */ DOUBLE, /** * The pseudo-type corresponding to the keyword {@code void}. * @see NoType */ VOID, /** * A pseudo-type used where no actual type is appropriate. * @see NoType */ NONE, /** * The null type. */ NULL, /** * An array type. */ ARRAY, /** * A class or interface type. */ DECLARED, /** * A class or interface type that could not be resolved. */ ERROR, /** * A type variable. */ TYPEVAR, /** * A wildcard type argument. */ WILDCARD, /** * A pseudo-type corresponding to a package element. * @see NoType */ PACKAGE, /** * A method, constructor, or initializer. */ EXECUTABLE, /** * An implementation-reserved type. * This is not the type you are looking for. */ OTHER, /** * A union type. * * @since 1.7 */ UNION, /** * An intersection type. * * @since 1.8 */ INTERSECTION, /** * A pseudo-type corresponding to a module element. * @see NoType * @since 9 */ MODULE}代码示例
获取一个类注解的值,而且获取类内里的方法
使用注解
@NativeAnnotation(path = " path hahaha")public class test { public native int nativeInit(Fragment i, int j, String[] strings, ArrayList arrayList);}