cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: rev 47010 - cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/variables
Date Wed, 22 Sep 2004 01:11:17 GMT
Author: vgritsenko
Date: Tue Sep 21 18:11:17 2004
New Revision: 47010

Modified:
   cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/variables/VariableResolverFactory.java
Log:
backport (partially) from 2.2


Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/variables/VariableResolverFactory.java
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/variables/VariableResolverFactory.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/variables/VariableResolverFactory.java
Tue Sep 21 18:11:17 2004
@@ -1,12 +1,12 @@
 /*
  * Copyright 1999-2004 The Apache Software Foundation.
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,18 +16,21 @@
 package org.apache.cocoon.components.treeprocessor.variables;
 
 import org.apache.avalon.framework.component.ComponentManager;
+import org.apache.avalon.framework.component.WrapperComponentManager;
+import org.apache.avalon.framework.service.ServiceManager;
+
 import org.apache.cocoon.sitemap.PatternException;
 
 import java.util.List;
 
 /**
  *
- * @version CVS $Id: VariableResolverFactory.java,v 1.4 2004/03/05 13:02:53 bdelacretaz Exp
$
+ * @version CVS $Id$
  */
 public class VariableResolverFactory {
-    
+
     private static ThreadLocal disposableCollector = new ThreadLocal();
-    
+
     /**
      * Set the thread-local list where all created resolvers that need to be
      * disposed will be collected.
@@ -69,7 +72,7 @@
         // Nothing found...
         return false;
     }
-    
+
     /**
      * Unescape an expression that doesn't need to be resolved, but may contain
      * escaped '{' characters.
@@ -98,19 +101,25 @@
      * Get a resolver for a given expression. Chooses the most efficient implementation
      * depending on <code>expression</code>.
      */
+    public static VariableResolver getResolver(String expression, ServiceManager manager)
throws PatternException {
+        return getResolver(expression, new WrapperComponentManager(manager));
+    }
+
+    /**
+     * Get a resolver for a given expression. Chooses the most efficient implementation
+     * depending on <code>expression</code>.
+     */
     public static VariableResolver getResolver(String expression, ComponentManager manager)
throws PatternException {
         if (needsResolve(expression)) {
             VariableResolver resolver = new PreparedVariableResolver(expression, manager);
             List collector = (List)disposableCollector.get();
             if (collector != null)
                 collector.add(resolver);
-            
+
             return resolver;
-            
+
         } else {
             return new NOPVariableResolver(expression);
         }
     }
 }
-
-

Mime
View raw message