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/07/19 14:21:18 UTC
svn commit: r965450 -
/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/el/CompositeComponentELUtils.java
Author: lu4242
Date: Mon Jul 19 12:21:18 2010
New Revision: 965450
URL: http://svn.apache.org/viewvc?rev=965450&view=rev
Log:
MYFACES-2826 replace String with Pattern, like we did on ExternalContextResourceLoader
Modified:
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/el/CompositeComponentELUtils.java
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/el/CompositeComponentELUtils.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/el/CompositeComponentELUtils.java?rev=965450&r1=965449&r2=965450&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/el/CompositeComponentELUtils.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/el/CompositeComponentELUtils.java Mon Jul 19 12:21:18 2010
@@ -19,6 +19,7 @@
package org.apache.myfaces.view.facelets.el;
import java.util.LinkedList;
+import java.util.regex.Pattern;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -54,7 +55,7 @@ public final class CompositeComponentELU
/**
* A regular expression used to determine if cc is used in an expression String.
*/
- public static final String CC_EXPRESSION_REGEX = ".*[^\\w\\.]cc[^\\w].*";
+ public static final Pattern CC_EXPRESSION_REGEX = Pattern.compile(".*[^\\w\\.]cc[^\\w].*");
/**
* A regular expression used to determine if cc.attrs is used as a method expression
@@ -69,7 +70,7 @@ public final class CompositeComponentELU
* - [^\\.]* - There must be no dot after cc.attrs to indicate a method invocation on cc.attrs
* - (\\(.*)? - If there is a left paranthesis after cc.attrs, a dot is allowed again
*/
- public static final String CC_ATTRS_METHOD_EXPRESSION_REGEX = "[^\\(]*[^\\w\\.\\(]cc\\.attrs\\.[^\\.]*(\\(.*)?";
+ public static final Pattern CC_ATTRS_METHOD_EXPRESSION_REGEX = Pattern.compile("[^\\(]*[^\\w\\.\\(]cc\\.attrs\\.[^\\.]*(\\(.*)?");
/**
* private constructor
@@ -166,7 +167,7 @@ public final class CompositeComponentELU
*/
public static boolean isCompositeComponentExpression(String expression)
{
- return expression.matches(CC_EXPRESSION_REGEX);
+ return CC_EXPRESSION_REGEX.matcher(expression).matches();
}
/**
@@ -179,7 +180,7 @@ public final class CompositeComponentELU
*/
public static boolean isCompositeComponentAttrsMethodExpression(String expression)
{
- return expression.matches(CC_ATTRS_METHOD_EXPRESSION_REGEX);
+ return CC_ATTRS_METHOD_EXPRESSION_REGEX.matcher(expression).matches();
}
}