Package org.pf4j.util

Class 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.AnnotationMirror getAnnotationMirror​(javax.lang.model.element.TypeElement typeElement, java.lang.Class<?> annotationClass)
      Get a certain annotation of a TypeElement.
      static javax.lang.model.element.AnnotationValue getAnnotationValue​(javax.lang.model.element.AnnotationMirror annotationMirror, java.lang.String annotationParameter)
      Get a certain parameter of an AnnotationMirror.
      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 a TypeElement.
      private static java.util.List<java.lang.String> toString​(java.util.List<java.lang.Class<?>> classes)
      Uses Class.getSimpleName() to convert from Class to String.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClassUtils

        public ClassUtils()
    • 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 a TypeElement. See stackoverflow.com for more information.
        Parameters:
        typeElement - the type element, that contains the requested annotation
        annotationClass - 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 - if typeElement or annotationClass is 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 an AnnotationMirror. See stackoverflow.com for more information.
        Parameters:
        annotationMirror - the annotation, that contains the requested parameter
        annotationParameter - 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 - if annotationMirror is 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 a TypeElement. See stackoverflow.com for more information.
        Parameters:
        typeElement - the type element, that contains the requested annotation
        annotationClass - the class of the requested annotation
        annotationParameter - 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 - if typeElement or annotationClass is null
      • toString

        private static java.util.List<java.lang.String> toString​(java.util.List<java.lang.Class<?>> classes)
        Uses Class.getSimpleName() to convert from Class to String.
        Parameters:
        classes -
        Returns: