public final class ModelTypeUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static TypeMirror |
getTypeMirror(Supplier<Class<?>> supplier)
Gets the type mirror for the supplied class object.
|
static List<TypeMirror> |
getTypeMirrorsOfClassArrayAnnotationValue(List<? extends AnnotationMirror> annotationMirrors,
Class<? extends Annotation> annotationClass,
String memberName)
Gets the list
TypeMirrors which represent the values of an annotation member of type Class-array. |
public static TypeMirror getTypeMirror(Supplier<Class<?>> supplier)
supplier - the class object supplier.public static List<TypeMirror> getTypeMirrorsOfClassArrayAnnotationValue(List<? extends AnnotationMirror> annotationMirrors, Class<? extends Annotation> annotationClass, String memberName)
TypeMirrors which represent the values of an annotation member of type Class-array.
Given:
@Foo(barClasses={Bar1.class, Bar2.class})
then:
List<String> classNames = getTypeMirrorsOfClassArrayAnnotationValue(annotationMirrors, Foo.class, "barClasses").stream()
.map(TypeMirror::toString)
.collect(Collectors.toList());
returns:
["package1.Bar1", "package2.Bar2"]
Copyright © 2002–2019 SoftSmithy. All rights reserved.