Class ClassReferences


  • public class ClassReferences
    extends java.lang.Object
    A utility class that searches for classes and interfaces that are potentially converted in JSON form.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.reflections.Reflections ref  
    • Constructor Summary

      Constructors 
      Constructor Description
      ClassReferences()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Collection<java.lang.Class<?>> search​(java.lang.Class<?> clazz, com.google.common.base.Predicate<java.lang.Class<?>> filter)
      Returns all the classes and interfaces that are referenced by the public methods declared by the given class.
      • Methods inherited from class java.lang.Object

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

      • ref

        public static org.reflections.Reflections ref
    • Constructor Detail

      • ClassReferences

        public ClassReferences()
    • Method Detail

      • search

        public static java.util.Collection<java.lang.Class<?>> search​(java.lang.Class<?> clazz,
                                                                      com.google.common.base.Predicate<java.lang.Class<?>> filter)
        Returns all the classes and interfaces that are referenced by the public methods declared by the given class. A class considered to be referenced by a method if either of the following holds 1) The class or its superclass or an interface it implements is mentioned in the signature of the method as an argument or as a return type either directly or as a type of an array or a collection. 2) The class or its superclass or an interface it implements is used as a return type of a getter method in a class referenced (note recursion here) by a method. However, the following kind of classes never considered to be referenced: 1) Anonymous classes 2) Classes that are not defined within package "ch."
        Parameters:
        clazz - class whose references should be searched.