Package dap4.core.data
Class DSPRegistry
- java.lang.Object
-
- dap4.core.data.DSPRegistry
-
public class DSPRegistry extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classDSPRegistry.Registration
-
Field Summary
Fields Modifier and Type Field Description static booleanFIRSTstatic booleanLASTprotected static ClassLoaderloaderprotected List<DSPRegistry.Registration>registryDefine 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 DSPfindMatchingDSP(String path, DapContext cxt)voidregister(Class<? extends DSP> klass, boolean last)Register a DSP class.voidregister(String className, boolean last)Register a DSP, using its class string name.booleanregistered(Class<? extends DSP> klass)See if a specific DSP is registeredstatic voidsetLoader(ClassLoader ldr)voidunregister(Class<? extends DSP> 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 DSP> 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 DSP> klass)
See if a specific DSP is registered- Parameters:
klass- Class for which to search
-
unregister
public void unregister(Class<? extends DSP> klass)
Unregister dsp.- Parameters:
klass- Class for which to search
-
findMatchingDSP
public DSP findMatchingDSP(String path, DapContext cxt) throws DapException
- Parameters:
path-- Returns:
- new DSP object that can process this path
- Throws:
DapException
-
-