public RuleLoader findLoader(Digester d,
Class pluginClass,
Properties p) throws PluginException {
String resourceName =
pluginClass.getName().replace('.", '/")
+ resourceSuffix;
InputStream is =
pluginClass.getClassLoader().getResourceAsStream(
resourceName);
if (is == null) {
// ok, no such resource
return null;
}
return FinderFromResource.loadRules(d, pluginClass, is, resourceName);
}
If there exists a resource file whose name is equal to the plugin
class name + the suffix specified in the constructor, then
load that file, run it through the xmlrules module and return an object
encapsulating those rules.
If there is no such resource file, then just return null.
The returned object (when non-null) will add the selected rules to
the digester whenever its addRules method is invoked. |