|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.javalid.core.el.ELSupport
public class ELSupport
Supportive class to get default resolver for framework and other shared resolver methods.
| Constructor Summary | |
|---|---|
ELSupport()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
addExpression(java.lang.String expression)
Makes an expression for given text. |
static javax.el.ELResolver |
getDefaultELResolver(boolean fieldResolver,
boolean readOnly)
|
static java.lang.String |
getExpressionParent()
|
static java.lang.String |
getExpressionThis()
|
static java.lang.String |
getNameParent()
|
static java.lang.String |
getNameThis()
|
static boolean |
isExpression(java.lang.String value)
Checks if given value starts with #{ or ${ and ends with }. |
static void |
registerDefaultExpressionForClassLevelValidation(javax.el.ExpressionFactory factory,
javax.el.ELContext ctx,
java.lang.Object thisObject)
Registers the ${me} variables into given context. |
static void |
registerDefaultExpressionsForStandardValidation(javax.el.ExpressionFactory factory,
javax.el.ELContext ctx,
java.lang.Object thisObject,
java.lang.Object parentObject)
Registers the ${this} and ${parent} variables into given context. |
static java.lang.Object |
resolveSingleExpression(javax.el.ExpressionFactory factory,
javax.el.ELContext ctx,
java.lang.String expression,
boolean allowsNull)
Resolves a single expression and returns the value that was resolved from it. |
static void |
setParentName(java.lang.String name)
Allows you to override the default name for registering the parent in EL. |
static void |
setThisName(java.lang.String name)
Allows you to override the default name for registering the this in EL. |
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 |
|---|
public ELSupport()
| Method Detail |
|---|
public static final boolean isExpression(java.lang.String value)
Note: checks and expects a single expression.
value - The value to check
public static final java.lang.String addExpression(java.lang.String expression)
expression - The text to make an expression from
public static final java.lang.String getExpressionParent()
public static final java.lang.String getExpressionThis()
public static final java.lang.String getNameParent()
public static final java.lang.String getNameThis()
public static final void setParentName(java.lang.String name)
name - New name (must NOT be an expression, just a normal name)public static final void setThisName(java.lang.String name)
name - New name (must NOT be an expression, just a normal name)
public static final javax.el.ELResolver getDefaultELResolver(boolean fieldResolver,
boolean readOnly)
public static final java.util.List<ELString> splitPossibleExpressionString(java.lang.String value)
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.
value - The String value containing possibly 1 or more expressions.
public static final void registerDefaultExpressionsForStandardValidation(javax.el.ExpressionFactory factory,
javax.el.ELContext ctx,
java.lang.Object thisObject,
java.lang.Object parentObject)
factory - The current factoryctx - The context to register them inparentObject - The actual class (not the method/field value but instead the instance where thisObject was defined).thisObject - The this value (the actual object that is under validation on a method / field)
public static final void registerDefaultExpressionForClassLevelValidation(javax.el.ExpressionFactory factory,
javax.el.ELContext ctx,
java.lang.Object thisObject)
factory - The current factoryctx - The context to register them inthisObject - The class value (the instance under validation, note instance as is on classlevel)
public static final java.lang.Object resolveSingleExpression(javax.el.ExpressionFactory factory,
javax.el.ELContext ctx,
java.lang.String expression,
boolean allowsNull)
factory - Expression factoryctx - The contextexpression - The expression to resolve (must be a valid expression), if not: behavior is not defined.allowsNull - True if you want the method to check if resolved value is null, if so raises an exception. When false simply returns the value (null or not)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||