Package dap4.dap4lib
Class DSPRegistry
- java.lang.Object
-
- dap4.dap4lib.DSPRegistry
-
public class DSPRegistry extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
DSPRegistry.Registration
-
Field Summary
Fields Modifier and Type Field Description static boolean
FIRST
static boolean
LAST
protected static ClassLoader
loader
protected List<DSPRegistry.Registration>
registry
Define a map of known DSP classes.
-
Constructor Summary
Constructors Constructor Description DSPRegistry()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description D4DSP
findMatchingDSP(String path, DapContext cxt)
void
register(Class<? extends D4DSP> klass, boolean last)
Register a DSP class.void
register(String className, boolean last)
Register a DSP, using its class string name.boolean
registered(Class<? extends D4DSP> klass)
See if a specific DSP is registeredstatic void
setLoader(ClassLoader ldr)
void
unregister(Class<? extends D4DSP> klass)
Unregister dsp.
-
-
-
Field Detail
-
LAST
public static final boolean LAST
- See Also:
- Constant Field Values
-
FIRST
public static final boolean FIRST
- See Also:
- Constant Field Values
-
loader
protected static ClassLoader loader
-
registry
protected List<DSPRegistry.Registration> registry
Define a map of known DSP classes. Must be ordered to allow control over test order
-
-
Method Detail
-
setLoader
public static void setLoader(ClassLoader ldr)
-
register
public void register(String className, boolean last) throws DapException
Register a DSP, using its class string name.- Parameters:
className
- Name of class that implements DSP.- Throws:
IllegalAccessException
- if class is not accessible.InstantiationException
- if class doesnt have a no-arg constructor.ClassNotFoundException
- if class not found.DapException
-
register
public void register(Class<? extends D4DSP> klass, boolean last)
Register a DSP class.- Parameters:
klass
- Class that implements DSP.last
- true=>insert at the end of the list; otherwise front- Throws:
IllegalAccessException
- if class is not accessible.InstantiationException
- if class doesnt have a no-arg constructor.ClassCastException
- if class doesnt implement DSP interface.
-
registered
public boolean registered(Class<? extends D4DSP> klass)
See if a specific DSP is registered- Parameters:
klass
- Class for which to search
-
unregister
public void unregister(Class<? extends D4DSP> klass)
Unregister dsp.- Parameters:
klass
- Class for which to search
-
findMatchingDSP
public D4DSP findMatchingDSP(String path, DapContext cxt) throws DapException
- Parameters:
path
-- Returns:
- new DSP object that can process this path
- Throws:
DapException
-
-