Class ClassQueryTool


  • public abstract class ClassQueryTool
    extends java.lang.Object
    The class-query tool loads classes using a classloader and calls "processClass" for each class encountered. This is highly expensive and sometimes dangerous excercise as the classloading may trigger static initializers and may exhaust the "permgen" space of the Virtual machine. If possible anyhow, do not use this class.
    Author:
    Thomas Morgner
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void processDirectory​(java.io.File directory)
      Processes all entries from a given directory, ignoring any subdirectory contents.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • processDirectory

        public void processDirectory​(java.io.File directory)
                              throws java.io.IOException
        Processes all entries from a given directory, ignoring any subdirectory contents. If the directory contains sub-directories these directories are not searched for JAR or ZIP files.

        In addition to the directory given as parameter, the direcories and JAR/ZIP-files on the classpath are also searched for entries.

        If directory is null, only the classpath is searched.

        Parameters:
        directory - the directory to be searched, or null to just use the classpath.
        Throws:
        java.io.IOException - if an error occured while loading the resources from the directory.
        java.lang.SecurityException - if access to the system properties or access to the classloader is restricted.