public class ClassList<T> extends Object
Modifier and Type | Field and Description |
---|---|
private Class<T> |
base
Base class to which all classes are assignable.
|
private List<Class<? extends T>> |
classes
List of classes.
|
private static org.slf4j.Logger |
LOGGER |
Constructor and Description |
---|
ClassList(Class<T> base)
Constructs a list of classes, initially empty.
|
ClassList(String file,
Class<T> base)
Constructs a list of classes from the given configuration file.
|
ClassList(String file,
Class<T> base,
Class<?> location)
Constructs a list of classes from the given configuration file.
|
Modifier and Type | Method and Description |
---|---|
void |
addClass(Class<? extends T> c)
Adds the given class, which must be assignable
to the base class, to the list.
|
private Class<? extends T> |
cast(Class<?> rawClass)
Cast the given class to something that extends the base class.
|
Class<? extends T>[] |
getClasses()
Gets the list of classes as an array.
|
void |
removeClass(Class<? extends T> c)
Removes the given class from the list.
|
public ClassList(Class<T> base)
base
- Base class to which all classes are assignable.public ClassList(String file, Class<T> base) throws IOException
file
- Configuration file containing the list of classes.base
- Base class to which all classes are assignable.IOException
- if the file cannot be read.public ClassList(String file, Class<T> base, Class<?> location) throws IOException
file
- Configuration file containing the list of classes.base
- Base class to which all classes are assignable.location
- Class indicating which package to search for the file.
If null, 'file' is interpreted as an absolute path name.IOException
- if the file cannot be read.Copyright © 2015 Open Microscopy Environment