cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r676327 - /cocoon/whiteboard/corona/trunk/corona-sitemap/src/main/java/org/apache/cocoon/corona/sitemap/objectmodel/ObjectModel.java
Date Sun, 13 Jul 2008 14:19:25 GMT
Author: reinhard
Date: Sun Jul 13 07:19:25 2008
New Revision: 676327

URL: http://svn.apache.org/viewvc?rev=676327&view=rev
Log:
add all input parameters to the object model

Modified:
    cocoon/whiteboard/corona/trunk/corona-sitemap/src/main/java/org/apache/cocoon/corona/sitemap/objectmodel/ObjectModel.java

Modified: cocoon/whiteboard/corona/trunk/corona-sitemap/src/main/java/org/apache/cocoon/corona/sitemap/objectmodel/ObjectModel.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-sitemap/src/main/java/org/apache/cocoon/corona/sitemap/objectmodel/ObjectModel.java?rev=676327&r1=676326&r2=676327&view=diff
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-sitemap/src/main/java/org/apache/cocoon/corona/sitemap/objectmodel/ObjectModel.java
(original)
+++ cocoon/whiteboard/corona/trunk/corona-sitemap/src/main/java/org/apache/cocoon/corona/sitemap/objectmodel/ObjectModel.java
Sun Jul 13 07:19:25 2008
@@ -28,27 +28,33 @@
 
     private SitemapParameters sitemapParameters = new SitemapParameters();
 
-    private Map<String, Object> model = new HashMap<String, Object>();
+    private final Map<String, Object> parameters;
 
-    public ObjectModel() {
-        this.model.put("corona", new HashMap<String, Object>());
+    public ObjectModel(Map<String, Object> parameters) {
+        super();
+
+        this.parameters = parameters;
+        this.parameters.put("corona", new HashMap<String, Object>());
     }
 
     public void put(String key, Object object) {
-        this.model.put(key, object);
+        if ("corona".equals(key)) {
+            throw new IllegalArgumentException("The corona object can't be set.");
+        }
+        this.parameters.put(key, object);
     }
 
     public Object get(String key) {
-        return this.model.get(key);
+        return this.parameters.get(key);
     }
 
-    public Map<String, Object> getModel() {
-        return this.model;
+    public Map<String, Object> getParameters() {
+        return this.parameters;
     }
 
     @SuppressWarnings("unchecked")
     public Map<String, Object> getCoronaObject() {
-        return (Map<String, Object>) this.model.get("corona");
+        return (Map<String, Object>) this.parameters.get("corona");
     }
 
     public SitemapParameters getSitemapParameters() {



Mime
View raw message