myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r709776 - in /myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/unified/resolver/implicitobject: ImplicitObjectResolver.java ViewScopeImplicitObject.java
Date Sat, 01 Nov 2008 20:42:53 GMT
Author: lu4242
Date: Sat Nov  1 13:42:53 2008
New Revision: 709776

URL: http://svn.apache.org/viewvc?rev=709776&view=rev
Log:
MYFACES-2029 Add EL Resolver for #{viewScope}

Added:
    myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/unified/resolver/implicitobject/ViewScopeImplicitObject.java
  (with props)
Modified:
    myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/unified/resolver/implicitobject/ImplicitObjectResolver.java

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/unified/resolver/implicitobject/ImplicitObjectResolver.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/unified/resolver/implicitobject/ImplicitObjectResolver.java?rev=709776&r1=709775&r2=709776&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/unified/resolver/implicitobject/ImplicitObjectResolver.java
(original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/unified/resolver/implicitobject/ImplicitObjectResolver.java
Sat Nov  1 13:42:53 2008
@@ -85,7 +85,9 @@
         ImplicitObject io15 = new ComponentImplicitObject();
         forFacesList.put(io15.getName(), io15);
         ImplicitObject io16 = new ResourceImplicitObject();
-        forFacesList.put(io16.getName(), io16);        
+        forFacesList.put(io16.getName(), io16);
+        ImplicitObject io17 = new ViewScopeImplicitObject();
+        forFacesList.put(io17.getName(), io17);
         return new ImplicitObjectResolver(forFacesList);
     }
 

Added: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/unified/resolver/implicitobject/ViewScopeImplicitObject.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/unified/resolver/implicitobject/ViewScopeImplicitObject.java?rev=709776&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/unified/resolver/implicitobject/ViewScopeImplicitObject.java
(added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/unified/resolver/implicitobject/ViewScopeImplicitObject.java
Sat Nov  1 13:42:53 2008
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.el.unified.resolver.implicitobject;
+
+import javax.el.ELContext;
+import java.beans.FeatureDescriptor;
+import java.util.Map;
+
+/**
+ * Encapsulates information needed by the ImplicitObjectResolver
+ * 
+ * @author Leonardo Uribe
+ */
+public class ViewScopeImplicitObject extends ImplicitObject
+{
+
+    private static final String NAME = "viewScope".intern();
+
+    /** Creates a new instance of ViewScopeImplicitObject */
+    public ViewScopeImplicitObject()
+    {
+    }
+
+    @Override
+    public Object getValue(ELContext context)
+    {
+        return facesContext(context).getViewRoot().getViewMap();
+    }
+
+    @Override
+    public String getName()
+    {
+        return NAME;
+    }
+
+    @Override
+    public Class<?> getType()
+    {
+        return null;
+    }
+
+    @Override
+    public FeatureDescriptor getDescriptor()
+    {
+        return makeDescriptor(NAME, "View scope attributes", Map.class);
+    }
+
+}

Propchange: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/unified/resolver/implicitobject/ViewScopeImplicitObject.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/unified/resolver/implicitobject/ViewScopeImplicitObject.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL



Mime
View raw message