cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gkossakow...@apache.org
Subject svn commit: r562411 - in /cocoon/trunk: blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/components/accessor/ blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/instruction/ core/cocoon-core/...
Date Fri, 03 Aug 2007 11:20:39 GMT
Author: gkossakowski
Date: Fri Aug  3 04:20:38 2007
New Revision: 562411

URL: http://svn.apache.org/viewvc?view=rev&rev=562411
Log:
  * move TemplateObjectModelHelper to the cocoon-expression-impl module
  * extract ParametersMap class from TemplateObjectModelHelper

Added:
    cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/objectmodel/helper/
    cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/objectmodel/helper/ParametersMap.java
  (with props)
    cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/objectmodel/helper/TemplateObjectModelHelper.java
      - copied, changed from r562402, cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/TemplateObjectModelHelper.java
Removed:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/TemplateObjectModelHelper.java
Modified:
    cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/components/accessor/FlowAttributeAccessor.java
    cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/instruction/Import.java
    cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/template/environment/FlowObjectModelHelper.java

Modified: cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/components/accessor/FlowAttributeAccessor.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/components/accessor/FlowAttributeAccessor.java?view=diff&rev=562411&r1=562410&r2=562411
==============================================================================
--- cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/components/accessor/FlowAttributeAccessor.java
(original)
+++ cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/components/accessor/FlowAttributeAccessor.java
Fri Aug  3 04:20:38 2007
@@ -20,7 +20,7 @@
 import java.util.Map;
 
 import org.apache.cocoon.components.flow.FlowHelper;
-import org.apache.cocoon.environment.TemplateObjectModelHelper;
+import org.apache.cocoon.objectmodel.helper.TemplateObjectModelHelper;
 
 /**
  * @version $Id$

Modified: cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/instruction/Import.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/instruction/Import.java?view=diff&rev=562411&r1=562410&r2=562411
==============================================================================
--- cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/instruction/Import.java
(original)
+++ cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/instruction/Import.java
Fri Aug  3 04:20:38 2007
@@ -20,8 +20,8 @@
 import java.util.Stack;
 
 import org.apache.cocoon.ProcessingException;
-import org.apache.cocoon.environment.TemplateObjectModelHelper;
 import org.apache.cocoon.objectmodel.ObjectModel;
+import org.apache.cocoon.objectmodel.helper.TemplateObjectModelHelper;
 import org.apache.cocoon.template.environment.ErrorHolder;
 import org.apache.cocoon.template.environment.ExecutionContext;
 import org.apache.cocoon.template.environment.ParsingContext;

Added: cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/objectmodel/helper/ParametersMap.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/objectmodel/helper/ParametersMap.java?view=auto&rev=562411
==============================================================================
--- cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/objectmodel/helper/ParametersMap.java
(added)
+++ cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/objectmodel/helper/ParametersMap.java
Fri Aug  3 04:20:38 2007
@@ -0,0 +1,166 @@
+/**
+ * 
+ */
+package org.apache.cocoon.objectmodel.helper;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.avalon.framework.parameters.ParameterException;
+import org.apache.avalon.framework.parameters.Parameters;
+
+final class ParametersMap extends Parameters implements Map {
+
+    protected final Parameters wrappedParameters;
+    protected Map map;
+
+    public ParametersMap(Parameters wrapped) {
+        wrappedParameters = wrapped;
+    }
+
+    public boolean equals(Object arg0) {
+        return wrappedParameters.equals(arg0);
+    }
+
+    public String[] getNames() {
+        return wrappedParameters.getNames();
+    }
+
+    public String getParameter(String arg0, String arg1) {
+        return wrappedParameters.getParameter(arg0, arg1);
+    }
+
+    public String getParameter(String arg0) throws ParameterException {
+        return wrappedParameters.getParameter(arg0);
+    }
+
+    public boolean getParameterAsBoolean(String arg0, boolean arg1) {
+        return wrappedParameters.getParameterAsBoolean(arg0, arg1);
+    }
+
+    public boolean getParameterAsBoolean(String arg0) throws ParameterException {
+        return wrappedParameters.getParameterAsBoolean(arg0);
+    }
+
+    public float getParameterAsFloat(String arg0, float arg1) {
+        return wrappedParameters.getParameterAsFloat(arg0, arg1);
+    }
+
+    public float getParameterAsFloat(String arg0) throws ParameterException {
+        return wrappedParameters.getParameterAsFloat(arg0);
+    }
+
+    public int getParameterAsInteger(String arg0, int arg1) {
+        return wrappedParameters.getParameterAsInteger(arg0, arg1);
+    }
+
+    public int getParameterAsInteger(String arg0) throws ParameterException {
+        return wrappedParameters.getParameterAsInteger(arg0);
+    }
+
+    public long getParameterAsLong(String arg0, long arg1) {
+        return wrappedParameters.getParameterAsLong(arg0, arg1);
+    }
+
+    public long getParameterAsLong(String arg0) throws ParameterException {
+        return wrappedParameters.getParameterAsLong(arg0);
+    }
+
+    public Iterator getParameterNames() {
+        return wrappedParameters.getParameterNames();
+    }
+
+    public int hashCode() {
+        return wrappedParameters.hashCode();
+    }
+
+    public boolean isParameter(String arg0) {
+        return wrappedParameters.isParameter(arg0);
+    }
+
+    public void makeReadOnly() {
+        wrappedParameters.makeReadOnly();
+    }
+
+    public Parameters merge(Parameters arg0) {
+        return wrappedParameters.merge(arg0);
+    }
+
+    public void removeParameter(String arg0) {
+        wrappedParameters.removeParameter(arg0);
+    }
+
+    public String setParameter(String arg0, String arg1) throws IllegalStateException {
+        return wrappedParameters.setParameter(arg0, arg1);
+    }
+
+    public void clear() {
+        this.checkWriteable();
+    }
+
+    protected Map getMap() {
+        if ( this.map == null ) {
+            this.map = new HashMap();
+            String[] names = this.getNames();
+            for(int i=0; i<names.length;i++) {
+                map.put(names[i], this.getParameter(names[i], null));
+            }
+        }
+        return this.map;
+    }
+
+    public boolean containsKey(Object arg0) {
+        if ( arg0 == null ) {
+            return false;
+        }
+        return this.getParameter(arg0.toString(), null) != null;
+    }
+
+    public boolean containsValue(Object arg0) {
+        return this.getMap().containsValue(arg0);
+    }
+
+    public Set entrySet() {
+        return this.getMap().entrySet();
+    }
+
+    public Object get(Object arg0) {
+        if ( arg0 == null ) {
+            return null;
+        }
+        return this.getParameter(arg0.toString(), null);
+    }
+
+    public boolean isEmpty() {
+        return this.getNames().length == 0;
+    }
+
+    public Set keySet() {
+        return this.getMap().keySet();
+    }
+
+    public Object put(Object arg0, Object arg1) {
+        this.checkWriteable();
+        return null;
+    }
+
+    public void putAll(Map arg0) {
+        this.checkWriteable();
+    }
+
+    public Object remove(Object arg0) {
+        this.checkWriteable();
+        return null;
+    }
+
+    public int size() {
+        return this.getNames().length;
+    }
+
+    public Collection values() {
+        return this.getMap().values();
+    }
+}
\ No newline at end of file

Propchange: cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/objectmodel/helper/ParametersMap.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/objectmodel/helper/TemplateObjectModelHelper.java
(from r562402, cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/TemplateObjectModelHelper.java)
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/objectmodel/helper/TemplateObjectModelHelper.java?view=diff&rev=562411&p1=cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/TemplateObjectModelHelper.java&r1=562402&p2=cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/objectmodel/helper/TemplateObjectModelHelper.java&r2=562411
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/TemplateObjectModelHelper.java
(original)
+++ cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/objectmodel/helper/TemplateObjectModelHelper.java
Fri Aug  3 04:20:38 2007
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.cocoon.environment;
+package org.apache.cocoon.objectmodel.helper;
 
 import java.beans.PropertyDescriptor;
 import java.lang.reflect.Method;

Modified: cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/template/environment/FlowObjectModelHelper.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/template/environment/FlowObjectModelHelper.java?view=diff&rev=562411&r1=562410&r2=562411
==============================================================================
--- cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/template/environment/FlowObjectModelHelper.java
(original)
+++ cocoon/trunk/core/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/template/environment/FlowObjectModelHelper.java
Fri Aug  3 04:20:38 2007
@@ -21,8 +21,8 @@
 
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.cocoon.components.flow.FlowHelper;
-import org.apache.cocoon.environment.TemplateObjectModelHelper;
 import org.apache.cocoon.objectmodel.ObjectModel;
+import org.apache.cocoon.objectmodel.helper.TemplateObjectModelHelper;
 import org.mozilla.javascript.Context;
 import org.mozilla.javascript.Scriptable;
 



Mime
View raw message