myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject [myfaces] branch master updated: refactored
Date Mon, 24 Dec 2018 16:35:56 GMT
This is an automated email from the ASF dual-hosted git repository.

tandraschko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces.git


The following commit(s) were added to refs/heads/master by this push:
     new eccc2a6  refactored
eccc2a6 is described below

commit eccc2a6949dbcc4217128786a0c79a148f4639dc
Author: Thomas Andraschko <tandraschko@apache.org>
AuthorDate: Mon Dec 24 17:36:07 2018 +0100

    refactored
---
 .../myfaces/application/NavigationHandlerImpl.java    |  8 ++++----
 .../visit/MyFacesVisitHints.java}                     |  8 ++++----
 .../apache/myfaces/context/RequestViewContext.java    |  8 ++++----
 .../context/servlet/PartialViewContextImpl.java       |  6 +++---
 .../apache/myfaces/lifecycle/RestoreViewSupport.java  |  8 ++++----
 .../org/apache/myfaces/renderkit/ErrorPageWriter.java |  6 +++---
 .../renderkit/html/base/HtmlRendererUtils.java        |  4 ++--
 .../DefaultFaceletsStateManagementStrategy.java       | 19 ++++++++++---------
 .../view/facelets/FaceletViewDeclarationLanguage.java |  4 ++--
 .../facelets/tag/jsf/ComponentTagHandlerDelegate.java |  4 ++--
 .../view/facelets/tag/ui/DebugPhaseListener.java      |  6 +++---
 11 files changed, 41 insertions(+), 40 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
b/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
index aae6f48..0f68133 100755
--- a/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
@@ -71,7 +71,7 @@ import org.apache.myfaces.util.HashMapUtils;
 import org.apache.myfaces.util.StringUtils;
 import org.apache.myfaces.util.FilenameUtils;
 import org.apache.myfaces.util.LangUtils;
-import org.apache.myfaces.util.VisitHintsHelper;
+import org.apache.myfaces.component.visit.MyFacesVisitHints;
 import org.apache.myfaces.view.facelets.ViewPoolProcessor;
 import org.apache.myfaces.view.facelets.tag.jsf.PreDisposeViewEvent;
 
@@ -310,15 +310,15 @@ public class NavigationHandlerImpl extends ConfigurableNavigationHandler
                 {
                     try
                     {
-                        facesContext.getAttributes().put(VisitHintsHelper.SKIP_ITERATION_HINT,
Boolean.TRUE);
+                        facesContext.getAttributes().put(MyFacesVisitHints.SKIP_ITERATION_HINT,
Boolean.TRUE);
 
                         VisitContext visitContext = VisitContext.createVisitContext(facesContext,
-                                null, VisitHintsHelper.SKIP_ITERATION_VISIT_HINTS);
+                                null, MyFacesVisitHints.SET_SKIP_ITERATION);
                         facesContext.getViewRoot().visitTree(visitContext, PreDisposeViewCallback.INSTANCE);
                     }
                     finally
                     {
-                        facesContext.getAttributes().remove(VisitHintsHelper.SKIP_ITERATION_HINT);
+                        facesContext.getAttributes().remove(MyFacesVisitHints.SKIP_ITERATION_HINT);
                     }
                 }
                 
diff --git a/impl/src/main/java/org/apache/myfaces/util/VisitHintsHelper.java b/impl/src/main/java/org/apache/myfaces/component/visit/MyFacesVisitHints.java
similarity index 79%
rename from impl/src/main/java/org/apache/myfaces/util/VisitHintsHelper.java
rename to impl/src/main/java/org/apache/myfaces/component/visit/MyFacesVisitHints.java
index e970773..b4b01cd 100644
--- a/impl/src/main/java/org/apache/myfaces/util/VisitHintsHelper.java
+++ b/impl/src/main/java/org/apache/myfaces/component/visit/MyFacesVisitHints.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.myfaces.util;
+package org.apache.myfaces.component.visit;
 
 import java.util.Collections;
 import java.util.EnumSet;
@@ -24,13 +24,13 @@ import java.util.Set;
 import javax.faces.component.visit.VisitHint;
 
 
-public class VisitHintsHelper
+public class MyFacesVisitHints
 {
     public static final String SKIP_ITERATION_HINT = "javax.faces.visit.SKIP_ITERATION";
     
-    public static final Set<VisitHint> SKIP_ITERATION_VISIT_HINTS = Collections.unmodifiableSet(

+    public static final Set<VisitHint> SET_SKIP_ITERATION = Collections.unmodifiableSet(

             EnumSet.of(VisitHint.SKIP_ITERATION));
     
-    public static final Set<VisitHint> SKIP_UNRENDERED_VISIT_HINTS = Collections.unmodifiableSet(

+    public static final Set<VisitHint> SET_SKIP_UNRENDERED = Collections.unmodifiableSet(

             EnumSet.of(VisitHint.SKIP_UNRENDERED));
 }
diff --git a/impl/src/main/java/org/apache/myfaces/context/RequestViewContext.java b/impl/src/main/java/org/apache/myfaces/context/RequestViewContext.java
index 31c7794..faaadad 100644
--- a/impl/src/main/java/org/apache/myfaces/context/RequestViewContext.java
+++ b/impl/src/main/java/org/apache/myfaces/context/RequestViewContext.java
@@ -31,7 +31,7 @@ import javax.faces.component.visit.VisitCallback;
 import javax.faces.component.visit.VisitContext;
 import javax.faces.component.visit.VisitResult;
 import javax.faces.context.FacesContext;
-import org.apache.myfaces.util.VisitHintsHelper;
+import org.apache.myfaces.component.visit.MyFacesVisitHints;
 
 /**
  *
@@ -214,17 +214,17 @@ public class RequestViewContext
             {
                 try
                 {
-                    facesContext.getAttributes().put(VisitHintsHelper.SKIP_ITERATION_HINT,
Boolean.TRUE);
+                    facesContext.getAttributes().put(MyFacesVisitHints.SKIP_ITERATION_HINT,
Boolean.TRUE);
 
                     VisitContext visitContext = VisitContext.createVisitContext(facesContext,
-                            null, VisitHintsHelper.SKIP_ITERATION_VISIT_HINTS);
+                            null, MyFacesVisitHints.SET_SKIP_ITERATION);
                     facet.visitTree(visitContext, new RefreshViewContext());
                 }
                 finally
                 {
                     // We must remove hint in finally, because an exception can break this
phase,
                     // but lifecycle can continue, if custom exception handler swallows the
exception
-                    facesContext.getAttributes().remove(VisitHintsHelper.SKIP_ITERATION_HINT);
+                    facesContext.getAttributes().remove(MyFacesVisitHints.SKIP_ITERATION_HINT);
                 }
             }
         }
diff --git a/impl/src/main/java/org/apache/myfaces/context/servlet/PartialViewContextImpl.java
b/impl/src/main/java/org/apache/myfaces/context/servlet/PartialViewContextImpl.java
index a5c7161..7d6d078 100644
--- a/impl/src/main/java/org/apache/myfaces/context/servlet/PartialViewContextImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/context/servlet/PartialViewContextImpl.java
@@ -57,7 +57,7 @@ import org.apache.myfaces.renderkit.html.HtmlResponseStateManager;
 import org.apache.myfaces.renderkit.html.util.JSFAttr;
 import org.apache.myfaces.renderkit.html.util.ResourceUtils;
 import org.apache.myfaces.util.StringUtils;
-import org.apache.myfaces.util.VisitHintsHelper;
+import org.apache.myfaces.component.visit.MyFacesVisitHints;
 
 public class PartialViewContextImpl extends PartialViewContext
 {
@@ -524,8 +524,8 @@ public class PartialViewContextImpl extends PartialViewContext
                         processRenderResource(_facesContext, writer, rvc, updatedComponents,
"body");
                         processRenderResource(_facesContext, writer, rvc, updatedComponents,
"form");
 
-                        VisitContext visitCtx = getVisitContextFactory().getVisitContext(
-                                _facesContext, renderIds, VisitHintsHelper.SKIP_UNRENDERED_VISIT_HINTS);
+                        VisitContext visitCtx = getVisitContextFactory().getVisitContext(_facesContext,
renderIds,
+                                MyFacesVisitHints.SET_SKIP_UNRENDERED);
                         viewRoot.visitTree(visitCtx,
                                            new PhaseAwareVisitCallback(_facesContext, phaseId,
updatedComponents));
                     }
diff --git a/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewSupport.java b/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewSupport.java
index 1d0d670..6abfa9a 100644
--- a/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewSupport.java
+++ b/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewSupport.java
@@ -31,7 +31,7 @@ import javax.faces.context.FacesContext;
 import javax.faces.event.PostRestoreStateEvent;
 import javax.faces.render.RenderKitFactory;
 import javax.faces.render.ResponseStateManager;
-import org.apache.myfaces.util.VisitHintsHelper;
+import org.apache.myfaces.component.visit.MyFacesVisitHints;
 
 /**
  * @author Mathias Broekelmann (latest modification by $Author$)
@@ -60,17 +60,17 @@ public class RestoreViewSupport
         // hint, JSF21-based libraries can use both.
         try
         {
-            facesContext.getAttributes().put(VisitHintsHelper.SKIP_ITERATION_HINT, Boolean.TRUE);
+            facesContext.getAttributes().put(MyFacesVisitHints.SKIP_ITERATION_HINT, Boolean.TRUE);
 
             VisitContext visitContext = (VisitContext) visitContextFactory.getVisitContext(facesContext,
-                    null, VisitHintsHelper.SKIP_ITERATION_VISIT_HINTS);
+                    null, MyFacesVisitHints.SET_SKIP_ITERATION);
             component.visitTree(visitContext, new RestoreStateCallback());
         }
         finally
         {
             // We must remove hint in finally, because an exception can break this phase,
             // but lifecycle can continue, if custom exception handler swallows the exception
-            facesContext.getAttributes().remove(VisitHintsHelper.SKIP_ITERATION_HINT);
+            facesContext.getAttributes().remove(MyFacesVisitHints.SKIP_ITERATION_HINT);
         }
     }
 
diff --git a/impl/src/main/java/org/apache/myfaces/renderkit/ErrorPageWriter.java b/impl/src/main/java/org/apache/myfaces/renderkit/ErrorPageWriter.java
index ab8938b..5fd17ef 100644
--- a/impl/src/main/java/org/apache/myfaces/renderkit/ErrorPageWriter.java
+++ b/impl/src/main/java/org/apache/myfaces/renderkit/ErrorPageWriter.java
@@ -67,7 +67,7 @@ import org.apache.myfaces.lifecycle.ViewNotFoundException;
 import org.apache.myfaces.config.MyfacesConfig;
 import org.apache.myfaces.util.ClassUtils;
 import org.apache.myfaces.application.viewstate.StateUtils;
-import org.apache.myfaces.util.VisitHintsHelper;
+import org.apache.myfaces.component.visit.MyFacesVisitHints;
 import org.apache.myfaces.view.facelets.component.UIRepeat;
 import org.apache.myfaces.view.facelets.el.ContextAware;
 
@@ -781,8 +781,8 @@ public final class ErrorPageWriter
     private static void _writeExtendedComponentTree(Writer writer,
             FacesContext facesContext) throws IOException
     {
-        VisitContext visitContext = VisitContext.createVisitContext(
-                facesContext, null, VisitHintsHelper.SKIP_UNRENDERED_VISIT_HINTS);
+        VisitContext visitContext = VisitContext.createVisitContext(facesContext, null,
+                MyFacesVisitHints.SET_SKIP_UNRENDERED);
         facesContext.getViewRoot().visitTree(visitContext, new ExtendedComponentTreeVisitCallback(writer));
         _clearVisitedFacetCountMap(facesContext);
     }
diff --git a/impl/src/main/java/org/apache/myfaces/renderkit/html/base/HtmlRendererUtils.java
b/impl/src/main/java/org/apache/myfaces/renderkit/html/base/HtmlRendererUtils.java
index 707c572..c804c22 100644
--- a/impl/src/main/java/org/apache/myfaces/renderkit/html/base/HtmlRendererUtils.java
+++ b/impl/src/main/java/org/apache/myfaces/renderkit/html/base/HtmlRendererUtils.java
@@ -71,7 +71,7 @@ import org.apache.myfaces.util.ComponentUtils;
 import org.apache.myfaces.util.StringUtils;
 import org.apache.myfaces.renderkit.html.util.HTML;
 import org.apache.myfaces.util.LangUtils;
-import org.apache.myfaces.util.VisitHintsHelper;
+import org.apache.myfaces.component.visit.MyFacesVisitHints;
 
 public final class HtmlRendererUtils
 {
@@ -274,7 +274,7 @@ public final class HtmlRendererUtils
                                         component.getClientId(facesContext),
                                         component.getValueExpression("value") != null);
                         form.visitTree(VisitContext.createVisitContext(facesContext,
-                                null, VisitHintsHelper.SKIP_UNRENDERED_VISIT_HINTS),
+                                null, MyFacesVisitHints.SET_SKIP_UNRENDERED),
                                 callback);
                     }
                 }
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
index dae47f5..afdbc7f 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
@@ -54,7 +54,7 @@ import org.apache.myfaces.context.RequestViewContext;
 import org.apache.myfaces.config.MyfacesConfig;
 import org.apache.myfaces.util.ClassUtils;
 import org.apache.myfaces.util.HashMapUtils;
-import org.apache.myfaces.util.VisitHintsHelper;
+import org.apache.myfaces.component.visit.MyFacesVisitHints;
 import org.apache.myfaces.view.facelets.compiler.CheckDuplicateIdFaceletUtils;
 import org.apache.myfaces.view.facelets.pool.ViewEntry;
 import org.apache.myfaces.view.facelets.pool.ViewPool;
@@ -935,11 +935,11 @@ public class DefaultFaceletsStateManagementStrategy extends StateManagementStrat
     private void saveStateOnMapVisitTree(final FacesContext facesContext, final Map<String,Object>
states,
             final UIViewRoot uiViewRoot)
     {
-        facesContext.getAttributes().put(VisitHintsHelper.SKIP_ITERATION_HINT, Boolean.TRUE);
+        facesContext.getAttributes().put(MyFacesVisitHints.SKIP_ITERATION_HINT, Boolean.TRUE);
         try
         {
-            uiViewRoot.visitTree( getVisitContextFactory().getVisitContext(
-                    facesContext, null, VisitHintsHelper.SKIP_ITERATION_VISIT_HINTS), new
VisitCallback()
+            uiViewRoot.visitTree(getVisitContextFactory().getVisitContext(facesContext, null,
+                    MyFacesVisitHints.SET_SKIP_ITERATION), new VisitCallback()
             {
                 @Override
                 public VisitResult visit(VisitContext context, UIComponent target)
@@ -1035,7 +1035,7 @@ public class DefaultFaceletsStateManagementStrategy extends StateManagementStrat
         }
         finally
         {
-            facesContext.getAttributes().remove(VisitHintsHelper.SKIP_ITERATION_HINT);
+            facesContext.getAttributes().remove(MyFacesVisitHints.SKIP_ITERATION_HINT);
         }
         if (!uiViewRoot.isTransient())
         {
@@ -1053,7 +1053,7 @@ public class DefaultFaceletsStateManagementStrategy extends StateManagementStrat
     private SaveStateAndResetViewCallback saveStateOnMapVisitTreeAndReset(final FacesContext
facesContext,
             final Map<String,Object> states, final UIViewRoot uiViewRoot, boolean forceHardReset)
     {
-        facesContext.getAttributes().put(VisitHintsHelper.SKIP_ITERATION_HINT, Boolean.TRUE);
+        facesContext.getAttributes().put(MyFacesVisitHints.SKIP_ITERATION_HINT, Boolean.TRUE);
         SaveStateAndResetViewCallback callback = new SaveStateAndResetViewCallback(
                 facesContext.getViewRoot(), states, forceHardReset);
         if (forceHardReset)
@@ -1088,12 +1088,13 @@ public class DefaultFaceletsStateManagementStrategy extends StateManagementStrat
 
             try
             {
-                uiViewRoot.visitTree( getVisitContextFactory().getVisitContext(
-                        facesContext, null, VisitHintsHelper.SKIP_ITERATION_VISIT_HINTS),
callback);
+                uiViewRoot.visitTree(getVisitContextFactory().getVisitContext(
+                        facesContext, null, MyFacesVisitHints.SET_SKIP_ITERATION),
+                        callback);
             }
             finally
             {
-                facesContext.getAttributes().remove(VisitHintsHelper.SKIP_ITERATION_HINT);
+                facesContext.getAttributes().remove(MyFacesVisitHints.SKIP_ITERATION_HINT);
             }
             
             if (callback.isViewResetable() && callback.isRemoveAddedComponents())
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
index 5ff9599..f044f3c 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
@@ -96,7 +96,7 @@ import org.apache.myfaces.application.ViewIdSupport;
 import org.apache.myfaces.config.MyfacesConfig;
 import org.apache.myfaces.util.ClassUtils;
 import org.apache.myfaces.util.StringUtils;
-import org.apache.myfaces.util.VisitHintsHelper;
+import org.apache.myfaces.component.visit.MyFacesVisitHints;
 import org.apache.myfaces.util.WebConfigParamUtils;
 import org.apache.myfaces.view.ViewDeclarationLanguageStrategy;
 import org.apache.myfaces.view.ViewMetadataBase;
@@ -443,7 +443,7 @@ public class FaceletViewDeclarationLanguage extends FaceletViewDeclarationLangua
                 if (FaceletViewDeclarationLanguageBase.isDynamicComponentRefreshTransientBuildActive(context))
                 {
                     VisitContext visitContext = (VisitContext) getVisitContextFactory().
-                        getVisitContext(context, null, VisitHintsHelper.SKIP_ITERATION_VISIT_HINTS);
+                        getVisitContext(context, null, MyFacesVisitHints.SET_SKIP_ITERATION);
                     view.visitTree(visitContext, PublishDynamicComponentRefreshTransientBuildCallback.INSTANCE);
                 }
                 if (!usePartialStateSavingOnThisView || refreshTransientBuildOnPSS)
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java
index 7d442f7..120bda1 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java
@@ -55,7 +55,7 @@ import javax.faces.view.facelets.ValidatorHandler;
 
 import org.apache.myfaces.renderkit.html.util.ResourceUtils;
 import org.apache.myfaces.util.ExternalSpecifications;
-import org.apache.myfaces.util.VisitHintsHelper;
+import org.apache.myfaces.component.visit.MyFacesVisitHints;
 import org.apache.myfaces.view.facelets.AbstractFaceletContext;
 import org.apache.myfaces.view.facelets.ComponentState;
 import org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy;
@@ -251,7 +251,7 @@ public class ComponentTagHandlerDelegate extends TagHandlerDelegate
                     FaceletDynamicComponentRefreshTransientBuildEvent.DYNAMIC_COMPONENT_BINDING_NEEDS_REFRESH))
             {
                 VisitContext visitContext = (VisitContext) mctx.getVisitContextFactory().
-                    getVisitContext(facesContext, null, VisitHintsHelper.SKIP_ITERATION_VISIT_HINTS);
+                    getVisitContext(facesContext, null, MyFacesVisitHints.SET_SKIP_ITERATION);
                 c.visitTree(visitContext, PublishFaceletDynamicComponentRefreshTransientBuildCallback.INSTANCE);
             }
             
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/ui/DebugPhaseListener.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/ui/DebugPhaseListener.java
index 0ed1039..a20dec0 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/ui/DebugPhaseListener.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/ui/DebugPhaseListener.java
@@ -38,7 +38,7 @@ import javax.faces.event.PhaseId;
 import javax.faces.event.PhaseListener;
 
 import org.apache.myfaces.renderkit.ErrorPageWriter;
-import org.apache.myfaces.util.VisitHintsHelper;
+import org.apache.myfaces.component.visit.MyFacesVisitHints;
 
 /**
  * PhaseListener to create extended debug information.
@@ -311,8 +311,8 @@ public class DebugPhaseListener implements PhaseListener
         {
             // skip all unrendered components to really only show
             // the rendered components and to circumvent data access problems
-            viewroot.visitTree(VisitContext.createVisitContext(
-                    event.getFacesContext(), null, VisitHintsHelper.SKIP_UNRENDERED_VISIT_HINTS),
+            viewroot.visitTree(VisitContext.createVisitContext(event.getFacesContext(), null,
+                    MyFacesVisitHints.SET_SKIP_UNRENDERED),
                     _visitCallback);
         }
     }


Mime
View raw message