Package org.pf4j.util
Class ClassUtils
- java.lang.Object
-
- org.pf4j.util.ClassUtils
-
public class ClassUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ClassUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<java.lang.Class<?>>getAllInterfaces(java.lang.Class<?> aClass)static java.util.List<java.lang.String>getAllInterfacesNames(java.lang.Class<?> aClass)static javax.lang.model.element.AnnotationMirrorgetAnnotationMirror(javax.lang.model.element.TypeElement typeElement, java.lang.Class<?> annotationClass)Get a certain annotation of aTypeElement.static javax.lang.model.element.AnnotationValuegetAnnotationValue(javax.lang.model.element.AnnotationMirror annotationMirror, java.lang.String annotationParameter)Get a certain parameter of anAnnotationMirror.static javax.lang.model.element.AnnotationValuegetAnnotationValue(javax.lang.model.element.TypeElement typeElement, java.lang.Class<?> annotationClass, java.lang.String annotationParameter)Get a certain annotation parameter of aTypeElement.private static java.util.List<java.lang.String>toString(java.util.List<java.lang.Class<?>> classes)UsesClass.getSimpleName()to convert fromClasstoString.
-
-
-
Method Detail
-
getAllInterfacesNames
public static java.util.List<java.lang.String> getAllInterfacesNames(java.lang.Class<?> aClass)
-
getAllInterfaces
public static java.util.List<java.lang.Class<?>> getAllInterfaces(java.lang.Class<?> aClass)
-
getAnnotationMirror
public static javax.lang.model.element.AnnotationMirror getAnnotationMirror(javax.lang.model.element.TypeElement typeElement, java.lang.Class<?> annotationClass)Get a certain annotation of aTypeElement. See stackoverflow.com for more information.- Parameters:
typeElement- the type element, that contains the requested annotationannotationClass- the class of the requested annotation- Returns:
- the requested annotation or null, if no annotation of the provided class was found
- Throws:
java.lang.NullPointerException- iftypeElementorannotationClassis null
-
getAnnotationValue
public static javax.lang.model.element.AnnotationValue getAnnotationValue(javax.lang.model.element.AnnotationMirror annotationMirror, java.lang.String annotationParameter)Get a certain parameter of anAnnotationMirror. See stackoverflow.com for more information.- Parameters:
annotationMirror- the annotation, that contains the requested parameterannotationParameter- the name of the requested annotation parameter- Returns:
- the requested parameter or null, if no parameter of the provided name was found
- Throws:
java.lang.NullPointerException- ifannotationMirroris null
-
getAnnotationValue
public static javax.lang.model.element.AnnotationValue getAnnotationValue(javax.lang.model.element.TypeElement typeElement, java.lang.Class<?> annotationClass, java.lang.String annotationParameter)Get a certain annotation parameter of aTypeElement. See stackoverflow.com for more information.- Parameters:
typeElement- the type element, that contains the requested annotationannotationClass- the class of the requested annotationannotationParameter- the name of the requested annotation parameter- Returns:
- the requested parameter or null, if no annotation for the provided class was found or no annotation parameter was found
- Throws:
java.lang.NullPointerException- iftypeElementorannotationClassis null
-
toString
private static java.util.List<java.lang.String> toString(java.util.List<java.lang.Class<?>> classes)
UsesClass.getSimpleName()to convert fromClasstoString.- Parameters:
classes-- Returns:
-
-