You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ms...@apache.org on 2012/04/11 21:37:56 UTC
svn commit: r1324940 - in /myfaces/trinidad/trunk:
trinidad-api/src/main/java/org/apache/myfaces/trinidad/view/
trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/
Author: mstarets
Date: Wed Apr 11 19:37:55 2012
New Revision: 1324940
URL: http://svn.apache.org/viewvc?rev=1324940&view=rev
Log:
TRINIDAD-2255 - Need to Expose ViewDeclarationLanguageWrapper
Added:
myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/view/
myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/view/ViewDeclarationLanguageWrapper.java
Modified:
myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewDeclarationLanguageFactoryImpl.java
Added: myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/view/ViewDeclarationLanguageWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/view/ViewDeclarationLanguageWrapper.java?rev=1324940&view=auto
==============================================================================
--- myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/view/ViewDeclarationLanguageWrapper.java (added)
+++ myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/view/ViewDeclarationLanguageWrapper.java Wed Apr 11 19:37:55 2012
@@ -0,0 +1,121 @@
+/*
+ * 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.
+ */
+
+/**
+ * This class will be deprecated when we move to JSF 2.2
+ */
+package org.apache.myfaces.trinidad.view;
+
+import java.io.IOException;
+
+import java.util.List;
+
+import javax.faces.FacesWrapper;
+import javax.faces.application.Resource;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+import javax.faces.view.AttachedObjectHandler;
+import javax.faces.view.StateManagementStrategy;
+import javax.faces.view.ViewDeclarationLanguage;
+import javax.faces.view.ViewMetadata;
+
+import java.beans.BeanInfo;
+
+public abstract class ViewDeclarationLanguageWrapper extends ViewDeclarationLanguage
+ implements FacesWrapper<ViewDeclarationLanguage>
+{
+ @Override
+ public abstract ViewDeclarationLanguage getWrapped();
+
+ @Override
+ public BeanInfo getComponentMetadata(FacesContext context, Resource componentResource)
+ {
+ return getWrapped().getComponentMetadata(context, componentResource);
+ }
+
+ @Override
+ public ViewMetadata getViewMetadata(FacesContext context, String viewId)
+ {
+ return getWrapped().getViewMetadata(context, viewId);
+ }
+
+ @Override
+ public Resource getScriptComponentResource(FacesContext context, Resource componentResource)
+ {
+ return getWrapped().getScriptComponentResource(context, componentResource);
+ }
+
+ @Override
+ public UIViewRoot createView(FacesContext context, String viewId)
+ {
+ return getWrapped().createView(context, viewId);
+ }
+
+ @Override
+ public UIViewRoot restoreView(FacesContext context, String viewId)
+ {
+ return getWrapped().restoreView(context, viewId);
+ }
+
+ @Override
+ public void retargetAttachedObjects(FacesContext context, UIComponent topLevelComponent,
+ List<AttachedObjectHandler> handlers)
+ {
+ getWrapped().retargetAttachedObjects(context, topLevelComponent, handlers);
+ }
+
+ @Override
+ public void retargetMethodExpressions(FacesContext context, UIComponent topLevelComponent)
+ {
+ getWrapped().retargetMethodExpressions(context, topLevelComponent);
+ }
+
+ @Override
+ public void buildView(FacesContext context, UIViewRoot root)
+ throws IOException
+ {
+ getWrapped().buildView(context, root);
+ }
+
+ @Override
+ public void renderView(FacesContext context, UIViewRoot view)
+ throws IOException
+ {
+ getWrapped().renderView(context, view);
+ }
+
+ @Override
+ public StateManagementStrategy getStateManagementStrategy(FacesContext context, String viewId)
+ {
+ return getWrapped().getStateManagementStrategy(context, viewId);
+ }
+
+ @Override
+ public boolean viewExists(FacesContext context, String viewId)
+ {
+ return getWrapped().viewExists(context, viewId);
+ }
+
+ @Override
+ public String getId()
+ {
+ return getWrapped().getId();
+ }
+}
Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewDeclarationLanguageFactoryImpl.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewDeclarationLanguageFactoryImpl.java?rev=1324940&r1=1324939&r2=1324940&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewDeclarationLanguageFactoryImpl.java (original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewDeclarationLanguageFactoryImpl.java Wed Apr 11 19:37:55 2012
@@ -50,6 +50,7 @@ import org.apache.myfaces.trinidad.chang
import org.apache.myfaces.trinidad.context.RequestContext;
import org.apache.myfaces.trinidad.logging.TrinidadLogger;
import org.apache.myfaces.trinidad.render.InternalView;
+import org.apache.myfaces.trinidad.view.ViewDeclarationLanguageWrapper;
public class ViewDeclarationLanguageFactoryImpl
@@ -301,7 +302,7 @@ public class ViewDeclarationLanguageFact
* customization (usually SessionChangeManager). Note that this works both for Facelets and JSPs.
*/
// TODO: start using ViewDeclarationLanguageWrapper once we upgrade to JSF 2.2
- private static class ChangeApplyingVDLWrapper extends ViewDeclarationLanguage
+ private static class ChangeApplyingVDLWrapper extends ViewDeclarationLanguageWrapper
{
ChangeApplyingVDLWrapper(ViewDeclarationLanguage wrapped)
{
@@ -309,40 +310,16 @@ public class ViewDeclarationLanguageFact
}
@Override
- public BeanInfo getComponentMetadata(FacesContext facesContext, Resource resource)
+ public ViewDeclarationLanguage getWrapped()
{
- return _wrapped.getComponentMetadata(facesContext, resource);
- }
-
- @Override
- public ViewMetadata getViewMetadata(FacesContext facesContext, String string)
- {
- return _wrapped.getViewMetadata(facesContext, string);
- }
-
- @Override
- public Resource getScriptComponentResource(FacesContext facesContext, Resource resource)
- {
- return _wrapped.getScriptComponentResource(facesContext, resource);
- }
-
- @Override
- public UIViewRoot createView(FacesContext facesContext, String string)
- {
- return _wrapped.createView(facesContext, string);
- }
-
- @Override
- public UIViewRoot restoreView(FacesContext facesContext, String string)
- {
- return _wrapped.restoreView(facesContext, string);
+ return _wrapped;
}
@Override
public void buildView(FacesContext facesContext, UIViewRoot uiViewRoot)
throws IOException
{
- _wrapped.buildView(facesContext, uiViewRoot);
+ getWrapped().buildView(facesContext, uiViewRoot);
if(PhaseId.RENDER_RESPONSE.equals(FacesContext.getCurrentInstance().getCurrentPhaseId()))
{
ChangeManager cm = RequestContext.getCurrentInstance().getChangeManager();
@@ -350,37 +327,6 @@ public class ViewDeclarationLanguageFact
}
}
- @Override
- public void renderView(FacesContext facesContext, UIViewRoot uiViewRoot)
- throws IOException
- {
- _wrapped.renderView(facesContext, uiViewRoot);
- }
-
- @Override
- public StateManagementStrategy getStateManagementStrategy(FacesContext facesContext, String string)
- {
- return _wrapped.getStateManagementStrategy(facesContext, string);
- }
-
- @Override
- public void retargetAttachedObjects(FacesContext context,
- UIComponent topLevelComponent,
- List<AttachedObjectHandler> handlers)
- {
- _wrapped.retargetAttachedObjects(context, topLevelComponent, handlers);
- }
-
- @Override
- public void retargetMethodExpressions(FacesContext context,
- UIComponent topLevelComponent)
- {
-
- _wrapped.retargetMethodExpressions(context, topLevelComponent);
-
- }
-
-
private final ViewDeclarationLanguage _wrapped;
}
}