in commons-digester3-core/src/main/java/org/apache/commons/digester3/plugins/Declaration.java [153:209]
public void init( final Digester digester, final PluginManager pm )
throws PluginException
{
final Log log = digester.getLogger();
final boolean debug = log.isDebugEnabled();
if ( debug )
{
log.debug( "init being called!" );
}
if ( initialized )
{
throw new PluginAssertionFailure( "Init called multiple times." );
}
if ( pluginClass == null && pluginClassName != null )
{
try
{
// load the plugin class object
pluginClass = digester.getClassLoader().loadClass( pluginClassName );
}
catch ( final ClassNotFoundException cnfe )
{
throw new PluginException( "Unable to load class " + pluginClassName, cnfe );
}
}
if ( ruleLoader == null )
{
// the caller didn't provide a ruleLoader to the constructor,
// so get the plugin manager to "discover" one.
log.debug( "Searching for ruleloader..." );
ruleLoader = pm.findLoader( digester, id, pluginClass, properties );
}
else
{
log.debug( "This declaration has an explicit ruleLoader." );
}
if ( debug )
{
if ( ruleLoader == null )
{
log.debug( "No ruleLoader found for plugin declaration" + " id [" + id + "]" + ", class ["
+ pluginClass.getName() + "]." );
}
else
{
log.debug( "RuleLoader of type [" + ruleLoader.getClass().getName()
+ "] associated with plugin declaration" + " id [" + id + "]" + ", class ["
+ pluginClass.getName() + "]." );
}
}
initialized = true;
}