org.javalid.core.el
Class ELSupport

java.lang.Object
  extended by org.javalid.core.el.ELSupport

public class ELSupport
extends java.lang.Object

Supportive class to get default resolver for framework and other shared resolver methods.

Since:
1.1
Version:
1.0
Author:
M.Reuvers

Constructor Summary
ELSupport()
           
 
Method Summary
static javax.el.ELResolver getDefaultELResolver(boolean fieldResolver, boolean readOnly)
           
static java.util.List<ELString> splitPossibleExpressionString(java.lang.String value)
          Attempts to split String in parts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ELSupport

public ELSupport()
Method Detail

getDefaultELResolver

public static final javax.el.ELResolver getDefaultELResolver(boolean fieldResolver,
                                                             boolean readOnly)

splitPossibleExpressionString

public static final java.util.List<ELString> splitPossibleExpressionString(java.lang.String value)
Attempts to split String in parts. The String may contain multiple expressions. E.g. "This is #{this.name} calling from #{this.country.name}". Returns a List with split parts, denoting if such a part is an expression string or not. Callers then know what part to resolve and what not. If no expression was found, simply returns a single ELString element in the List telling it is not a expression.

One can ofcourse resolve such a String at once using the ELResolver, however when using the database we must use binding parameters to prevent SQL injection. Specially for such purposes we split the String like this. So the expression parts can be resolved separately.

Parameters:
value - The String value containing possibly 1 or more expressions.
Returns:
List containing ELString parts, if value is null returns an empty list