Package repast.simphony.util
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 Summary
Constructors Constructor Description ClassPathEntry(File path)
ClassPathEntry(File path, List<String> filters)
ClassPathEntry(File path, ClassPathFilter filter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFilter(String filter)
Adds the specified filter as a ClassPathFilter to this PathEntry.void
addFilter(ClassPathFilter filter)
Adds the specified filter to this PathEntry.boolean
filter(String className)
Returns true if theIterable<String>
getClassNames()
Gets the names of the classes on this path.List<File>
getClassPaths()
Gets the paths to jars and / or classes that this ClassPathEntry contains.Filter<String>
getFilter()
Gets the filter associated with this ClassPathEntry.File
getPath()
Gets the path.boolean
isValid()
Gets whether or not this ClassPathEntry contains a directory that contains classes, or jars.
-
-
-
Method Detail
-
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
-
-