myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sless...@apache.org
Subject svn commit: r696515 - in /myfaces/core/branches/2_0_0: api/src/main/java/javax/faces/application/ impl/src/main/java/org/apache/myfaces/application/
Date Wed, 17 Sep 2008 23:25:42 GMT
Author: slessard
Date: Wed Sep 17 16:25:41 2008
New Revision: 696515

URL: http://svn.apache.org/viewvc?rev=696515&view=rev
Log:
MYFACES-1913 - Implement: Application.getResourceHandler()
MYFACES-1916 - Implement: Application.setResourceHandler(ResourceHandler resourceHandler)

Added:
    myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
Modified:
    myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/application/Application.java
    myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java

Modified: myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/application/Application.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/application/Application.java?rev=696515&r1=696514&r2=696515&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/application/Application.java
(original)
+++ myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/application/Application.java
Wed Sep 17 16:25:41 2008
@@ -107,9 +107,7 @@
     
     public ResourceHandler getResourceHandler()
     {
-        // TODO: JSF 2.0 #3
-        // VALIDATE: Shouldn't this be abstract or throw UnsupportedOperationException?
-        return null;
+        throw new UnsupportedOperationException();
     }
 
     public void addELContextListener(ELContextListener listener)
@@ -229,8 +227,7 @@
     
     public void setResourceHandler(ResourceHandler resourceHandler)
     {
-        // TODO: JSF 2.0 #6
-        // VALIDATE: Shouldn't this be abstract?
+        throw new UnsupportedOperationException();
     }
 
     public abstract void setStateManager(javax.faces.application.StateManager manager);

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java?rev=696515&r1=696514&r2=696515&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java
(original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java
Wed Sep 17 16:25:41 2008
@@ -40,6 +40,7 @@
 import javax.faces.application.Application;
 import javax.faces.application.NavigationHandler;
 import javax.faces.application.ProjectStage;
+import javax.faces.application.ResourceHandler;
 import javax.faces.application.StateManager;
 import javax.faces.application.ViewHandler;
 import javax.faces.component.UIComponent;
@@ -108,6 +109,7 @@
     private NavigationHandler _navigationHandler;
     private ActionListener _actionListener;
     private String _defaultRenderKitId;
+    private ResourceHandler _resourceHandler;
     private StateManager _stateManager;
 
     private ArrayList<ELContextListener> _elContextListeners;
@@ -178,6 +180,7 @@
         _defaultRenderKitId = "HTML_BASIC";
         _stateManager = new JspStateManagerImpl();
         _elContextListeners = new ArrayList<ELContextListener>();
+        _resourceHandler = new ResourceHandlerImpl();
         _runtimeConfig = runtimeConfig;
 
         if (log.isTraceEnabled())
@@ -564,6 +567,20 @@
     {
         return PROPERTYRESOLVER;
     }
+    
+    @Override
+    public final void setResourceHandler(ResourceHandler resourceHandler)
+    {
+        checkNull(resourceHandler, "resourceHandler");
+
+        _resourceHandler = resourceHandler;
+    }
+    
+    @Override
+    public final ResourceHandler getResourceHandler()
+    {
+        return _resourceHandler;
+    }
 
     @Override
     public final void setSupportedLocales(final Collection<Locale> locales)
@@ -1072,6 +1089,8 @@
     @Override
     public final void setStateManager(final StateManager stateManager)
     {
+        checkNull(stateManager, "stateManager");
+
         _stateManager = stateManager;
     }
 
@@ -1079,7 +1098,7 @@
     {
         if (param == null)
         {
-            throw new NullPointerException(paramName + " can not be null.");
+            throw new NullPointerException(paramName + " cannot be null.");
         }
     }
 
@@ -1087,7 +1106,7 @@
     {
         if (param.length() == 0)
         {
-            throw new NullPointerException("String " + paramName + " can not be empty.");
+            throw new NullPointerException("String " + paramName + " cannot be empty.");
         }
     }
 }

Added: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java?rev=696515&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
(added)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
Wed Sep 17 16:25:41 2008
@@ -0,0 +1,75 @@
+/*
+ * 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.application;
+
+import javax.faces.application.Resource;
+import javax.faces.application.ResourceHandler;
+import javax.faces.context.FacesContext;
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author Simon Lessard (latest modification by $Author: lu4242 $)
+ * 
+ * @version $Revision: 695059 $ $Date: 2008-09-13 19:10:53 -0400 (sam., 13 sept. 2008) $
+ */
+public class ResourceHandlerImpl extends ResourceHandler
+{
+    @Override
+    public Resource createResource(String resourceName)
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public Resource createResource(String resourceName, String libraryName)
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public Resource createResource(String resourceName, String libraryName, String contentType)
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public String getRendererTypeForResourceName(String resourceName)
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public void handleResourceRequest(FacesContext context)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    public boolean isResourceRequest(FacesContext context)
+    {
+        // TODO Auto-generated method stub
+        return false;
+    }
+}



Mime
View raw message