-
public class MirrorThe central class used to retrieve mirrors of Core Reflection objects
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classMirror.TypesEasy access to core Java types (void + primitives + Object)
-
Field Summary
Fields Modifier and Type Field Description private final static Mirror.Typestypespublic final static MirrorINSTANCE
-
Method Summary
Modifier and Type Method Description final static TypeMirrorreflect(Type type)Gets the type mirror representing the passed type final static TypeMirrorreflect(TypeToken<?> type)Gets the type mirror representing the passed type final static TypeMirrorreflect(AnnotatedType type)Gets the type mirror representing the passed annotated type final <T extends Any> TypeMirrorreflect()Gets the type mirror representing the specified type final static FieldMirrorreflect(Field field)Gets the field mirror representing the passed field final static MethodMirrorreflect(Method method)Gets the method mirror representing the passed method final static ConstructorMirrorreflect(Constructor<?> constructor)Gets the constructor mirror representing the passed constructor final static ExecutableMirrorreflect(Executable executable)Gets the method or constructor mirror representing the passed method or constructor final static ClassMirrorreflectClass(TypeToken<?> token)Gets the ClassMirror representing the passed annotated type. final static ClassMirrorreflectClass(AnnotatedType type)Gets the ClassMirror representing the passed annotated type. final static ClassMirrorreflectClass(Type type)Gets the ClassMirror representing the passed type. final <T extends Any> ClassMirrorreflectClass()Gets the ClassMirror representing the specified type. final static <T extends Annotation> TnewAnnotation(Class<T> clazz, Map<String, Object> arguments)Dynamically creates a new annotation instance. final static <T extends Annotation> TnewAnnotation(Class<T> clazz)Dynamically creates a new annotation instance. final static <T extends Annotation> TnewAnnotation(Class<T> clazz, Pair<String, Object> arguments)Dynamically creates a new annotation instance. final <T extends Annotation> TnewAnnotation(Map<String, Object> arguments)Dynamically creates a new annotation instance. final <T extends Annotation> TnewAnnotation(Pair<String, Object> arguments)Dynamically creates a new annotation instance. final static StringannotationToString(Annotation annotation)Converts an annotation into a Java string representation final static StringannotationToJavaString(Annotation annotation)Converts an annotation into a Java string representation final static StringannotationToKotlinString(Annotation annotation)Converts an annotation into a Kotlin string representation final static ArrayMirrorcreateArrayType(TypeMirror type)Create an array whose component type is the passed mirror final static <T extends AnnotatedType> TtoCanonical(T type)Transforms the passed type to an equivalent one that implements the equals and hashCode methods. final static Mirror.TypesgetTypes()-
-
Method Detail
-
reflect
final static TypeMirror reflect(Type type)
Gets the type mirror representing the passed type
-
reflect
final static TypeMirror reflect(TypeToken<?> type)
Gets the type mirror representing the passed type
-
reflect
final static TypeMirror reflect(AnnotatedType type)
Gets the type mirror representing the passed annotated type
-
reflect
final <T extends Any> TypeMirror reflect()
Gets the type mirror representing the specified type
-
reflect
final static FieldMirror reflect(Field field)
Gets the field mirror representing the passed field
-
reflect
final static MethodMirror reflect(Method method)
Gets the method mirror representing the passed method
-
reflect
final static ConstructorMirror reflect(Constructor<?> constructor)
Gets the constructor mirror representing the passed constructor
-
reflect
final static ExecutableMirror reflect(Executable executable)
Gets the method or constructor mirror representing the passed method or constructor
-
reflectClass
final static ClassMirror reflectClass(TypeToken<?> token)
Gets the ClassMirror representing the passed annotated type. This is a convenience method for when the type is known to be a class, rather than an array, void, type variable, or wildcard.
-
reflectClass
final static ClassMirror reflectClass(AnnotatedType type)
Gets the ClassMirror representing the passed annotated type. This is a convenience method for when the type is known to be a class, rather than an array, void, type variable, or wildcard.
-
reflectClass
final static ClassMirror reflectClass(Type type)
Gets the ClassMirror representing the passed type. This is a convenience method for when the type is known to be a class, rather than an array, void, type type variable, or wildcard.
-
reflectClass
final <T extends Any> ClassMirror reflectClass()
Gets the ClassMirror representing the specified type. This is a convenience method for when the type is known to be a class, rather than an array or void.
-
newAnnotation
@JvmOverloads() final static <T extends Annotation> T newAnnotation(Class<T> clazz, Map<String, Object> arguments)
Dynamically creates a new annotation instance.
-
newAnnotation
@JvmOverloads() final static <T extends Annotation> T newAnnotation(Class<T> clazz)
Dynamically creates a new annotation instance.
-
newAnnotation
final static <T extends Annotation> T newAnnotation(Class<T> clazz, Pair<String, Object> arguments)
Dynamically creates a new annotation instance.
-
newAnnotation
final <T extends Annotation> T newAnnotation(Map<String, Object> arguments)
Dynamically creates a new annotation instance.
-
newAnnotation
final <T extends Annotation> T newAnnotation(Pair<String, Object> arguments)
Dynamically creates a new annotation instance.
-
annotationToString
final static String annotationToString(Annotation annotation)
Converts an annotation into a Java string representation
-
annotationToJavaString
final static String annotationToJavaString(Annotation annotation)
Converts an annotation into a Java string representation
-
annotationToKotlinString
final static String annotationToKotlinString(Annotation annotation)
Converts an annotation into a Kotlin string representation
-
createArrayType
final static ArrayMirror createArrayType(TypeMirror type)
Create an array whose component type is the passed mirror
-
toCanonical
final static <T extends AnnotatedType> T toCanonical(T type)
Transforms the passed type to an equivalent one that implements the equals and hashCode methods.
-
getTypes
final static Mirror.Types getTypes()
-
-
-
-