You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sk...@apache.org on 2005/02/20 07:58:50 UTC

svn commit: r154478 - jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/plugins/PluginDeclarationScope.java

Author: skitching
Date: Sat Feb 19 22:58:49 2005
New Revision: 154478

URL: http://svn.apache.org/viewcvs?view=rev&rev=154478
Log:
Move findLoader method to Declaration class.

Modified:
    jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/plugins/PluginDeclarationScope.java

Modified: jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/plugins/PluginDeclarationScope.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/plugins/PluginDeclarationScope.java?view=diff&r1=154477&r2=154478
==============================================================================
--- jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/plugins/PluginDeclarationScope.java (original)
+++ jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/plugins/PluginDeclarationScope.java Sat Feb 19 22:58:49 2005
@@ -145,7 +145,7 @@
      * so that we can really log here. Currently, all
      * logging is disabled from this method.
      *
-     *@param decl an object representing a plugin class.
+     * @param decl an object representing a plugin class.
      */
     public void addDeclaration(Declaration decl) {
         Log log = LogUtils.getLogger(null);
@@ -196,53 +196,5 @@
         }
 
         return decl;
-    }
-
-    /**
-     * Given a plugin class and some associated properties, scan the
-     * list of known RuleFinder instances until one detects a source of
-     * custom rules for this plugin (aka a RuleLoader).
-     * <p>
-     * If no source of custom rules can be found, null is returned.
-     */
-    public RuleLoader findLoader(
-    Context context, String id, 
-    Class pluginClass, Properties props) 
-    throws PluginException {    
-
-        // iterate over the list of RuleFinders, trying each one 
-        // until one of them locates a source of dynamic rules given
-        // this specific plugin class and the associated declaration 
-        // properties.
-        Log log = LogUtils.getLogger(context);
-        boolean debug = log.isDebugEnabled();
-        log.debug("scanning ruleFinders to locate loader..");
-        
-        PluginConfiguration pluginConfig = 
-            PluginConfiguration.getInstance(context.getSAXHandler());
-
-        List ruleFinders = pluginConfig.getRuleFinders();
-        RuleLoader ruleLoader = null;
-        try {
-            for(Iterator i = ruleFinders.iterator(); 
-                i.hasNext() && ruleLoader == null; ) {
-                    
-                RuleFinder finder = (RuleFinder) i.next();
-                if (debug) {
-                    log.debug("checking finder of type " + finder.getClass().getName());
-                }
-                ruleLoader = finder.findLoader(context, pluginClass, props);
-            }
-        }
-        catch(PluginException e) {
-            throw new PluginException(
-                "Unable to locate plugin rules for plugin"
-                + " with id [" + id + "]"
-                + ", and class [" + pluginClass.getName() + "]"
-                + ":" + e.getMessage(), e.getCause());
-        }
-        log.debug("scanned ruleFinders.");
-        
-        return ruleLoader;
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org