You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2010/05/18 04:07:26 UTC
svn commit: r945458 -
/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java
Author: lu4242
Date: Tue May 18 02:07:26 2010
New Revision: 945458
URL: http://svn.apache.org/viewvc?rev=945458&view=rev
Log:
MYFACES-2288 Implement Bean Validation (clean parameter ordering)
Modified:
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java?rev=945458&r1=945457&r2=945458&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java Tue May 18 02:07:26 2010
@@ -327,7 +327,7 @@ public class ComponentTagHandlerDelegate
{
// add default validators here, because this feature
// is only available in facelets (see MYFACES-2362 for details)
- addDefaultValidators(facesContext, mctx, (EditableValueHolder) c);
+ addDefaultValidators(mctx, facesContext, (EditableValueHolder) c);
}
_delegate.onComponentPopulated(ctx, c, parent);
@@ -498,7 +498,7 @@ public class ComponentTagHandlerDelegate
* @param mctx the AbstractFaceletContext
* @param component The EditableValueHolder to which the validators should be added
*/
- private void addDefaultValidators(FacesContext context, FaceletCompositionContext mctx,
+ private void addDefaultValidators(FaceletCompositionContext mctx, FacesContext context,
EditableValueHolder component)
{
// add all defaultValidators
@@ -507,7 +507,7 @@ public class ComponentTagHandlerDelegate
{
for (Map.Entry<String, String> entry : defaultValidators.entrySet())
{
- addDefaultValidator(context, mctx, component, entry.getKey(), entry.getValue());
+ addDefaultValidator( mctx, context, component, entry.getKey(), entry.getValue());
}
}
// add all enclosing validators
@@ -519,13 +519,13 @@ public class ComponentTagHandlerDelegate
String validatorId = enclosingValidatorIds.next();
if (!defaultValidators.containsKey(validatorId))
{
- addDefaultValidator(context, mctx, component, validatorId, null);
+ addDefaultValidator(mctx, context, component, validatorId, null);
}
}
}
}
- private void addDefaultValidator(FacesContext context, FaceletCompositionContext mctx,
+ private void addDefaultValidator(FaceletCompositionContext mctx, FacesContext context,
EditableValueHolder component, String validatorId, String validatorClassName)
{
Validator enclosingValidator = null;
@@ -554,7 +554,7 @@ public class ComponentTagHandlerDelegate
if (validator == null)
{
- if (shouldAddDefaultValidator(validatorId, context, mctx, component))
+ if (shouldAddDefaultValidator(mctx, context, component, validatorId))
{
if (enclosingValidator != null)
{
@@ -614,9 +614,10 @@ public class ComponentTagHandlerDelegate
* @return true if the Validator should be added, false otherwise.
*/
@SuppressWarnings("unchecked")
- private boolean shouldAddDefaultValidator(String validatorId, FacesContext context,
- FaceletCompositionContext mctx,
- EditableValueHolder component)
+ private boolean shouldAddDefaultValidator(FaceletCompositionContext mctx,
+ FacesContext facesContext,
+ EditableValueHolder component,
+ String validatorId)
{
// check if the validatorId is on the exclusion list on the component
List<String> exclusionList
@@ -654,8 +655,8 @@ public class ComponentTagHandlerDelegate
{
return false;
}
- ExternalContext externalContext = context.getExternalContext();
- String disabled = externalContext.getInitParameter(BeanValidator.DISABLE_DEFAULT_BEAN_VALIDATOR_PARAM_NAME);
+
+ String disabled = facesContext.getExternalContext().getInitParameter(BeanValidator.DISABLE_DEFAULT_BEAN_VALIDATOR_PARAM_NAME);
if (disabled != null && disabled.toLowerCase().equals("true"))
{
// check if there are any enclosing <f:validateBean> tags with the validatorId of the BeanValidator