Class ClassPathEntry

java.lang.Object
repast.simphony.util.ClassPathEntry

public class ClassPathEntry extends Object
Encapsulates a path on which classes or jars might be found together with a class name filters. The filters work according to "or" semantics, so if any filter is passed then the class name passes.
Author:
Nick Collier
  • Constructor Details

    • ClassPathEntry

      public ClassPathEntry(File path)
    • ClassPathEntry

      public ClassPathEntry(File path, ClassPathFilter filter)
    • ClassPathEntry

      public ClassPathEntry(File path, List<String> filters)
  • Method Details

    • addFilter

      public void addFilter(ClassPathFilter filter)
      Adds the specified filter to this PathEntry.
      Parameters:
      filter - the filter to add
    • addFilter

      public void addFilter(String filter)
      Adds the specified filter as a ClassPathFilter to this PathEntry.
      Parameters:
      filter - the filter to add
    • getPath

      public File getPath()
      Gets the path.
      Returns:
      the path.
    • filter

      public boolean filter(String className)
      Returns true if the
      Parameters:
      className -
      Returns:
    • isValid

      public boolean isValid()
      Gets whether or not this ClassPathEntry contains a directory that contains classes, or jars.
      Returns:
    • getFilter

      public Filter<String> getFilter()
      Gets the filter associated with this ClassPathEntry.
      Returns:
      the filter associated with this ClassPathEntry.
    • getClassPaths

      public List<File> getClassPaths()
      Gets the paths to jars and / or classes that this ClassPathEntry contains.
      Returns:
      the paths to jars and / or classes that this ClassPathEntry contains.
    • getClassNames

      public Iterable<String> getClassNames() throws IOException, ClassNotFoundException
      Gets the names of the classes on this path. The classes must pass the filter in order to be returned.
      Returns:
      the names of the classes on this path. The classes must pass the filter in order to be returned.
      Throws:
      IOException
      ClassNotFoundException