public class XmlDriverLoader extends Object
The drivers stream structure is as follows:
<drivers> <driver name=“...” [manufacturer="..." hwVersion="..." swVersion="..."]> <behaviour api="..." impl="..."/> ... [<property name=“key”>value</key>] ... </driver> ... </drivers>
Constructor and Description |
---|
XmlDriverLoader(ClassLoader classLoader,
BehaviourClassResolver resolver)
Creates a new driver loader capable of loading drivers from the supplied
class loader.
|
Modifier and Type | Method and Description |
---|---|
DefaultDriver |
loadDriver(org.apache.commons.configuration.HierarchicalConfiguration driverCfg,
DriverResolver resolver)
Loads a driver from the supplied hierarchical configuration.
|
DefaultDriverProvider |
loadDrivers(org.apache.commons.configuration.HierarchicalConfiguration driversCfg,
DriverResolver resolver)
Loads a driver provider from the supplied hierarchical configuration.
|
DefaultDriverProvider |
loadDrivers(InputStream driversStream,
DriverResolver resolver)
Loads the specified drivers resource as an XML stream and parses it to
produce a ready-to-register driver provider.
|
public XmlDriverLoader(ClassLoader classLoader, BehaviourClassResolver resolver)
classLoader
- class loader to useresolver
- behaviour class resolverpublic DefaultDriverProvider loadDrivers(InputStream driversStream, DriverResolver resolver) throws IOException
driversStream
- stream containing the drivers definitionsresolver
- driver resolverIOException
- if issues are encountered reading the stream
or parsing the driver definitions withinpublic DefaultDriverProvider loadDrivers(org.apache.commons.configuration.HierarchicalConfiguration driversCfg, DriverResolver resolver)
driversCfg
- hierarchical configuration containing the drivers definitionsresolver
- driver resolverpublic DefaultDriver loadDriver(org.apache.commons.configuration.HierarchicalConfiguration driverCfg, DriverResolver resolver)
driverCfg
- hierarchical configuration containing the driver definitionresolver
- driver resolver