Package org.primefaces.expression
Class SearchExpressionFacade
java.lang.Object
org.primefaces.expression.SearchExpressionFacade
Simple facade for the whole Search Expression module.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionprotected static void
cannotFindComponent
(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression) protected static boolean
isNestable
(String expression) Checks if the given expression can be nested.protected static boolean
isPassTroughExpression
(String expression) Checks if the given expression must not be resolved by aSearchExpressionResolver
, before rendering it to the client.static String
resolveClientId
(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression) Resolves aUIComponent
clientId and/or passtrough expression for the given expression.static String
resolveClientId
(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression, Set<SearchExpressionHint> hints) Resolves aUIComponent
clientId and/or passtrough expression for the given expression.static String
resolveClientIds
(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expressions) Resolves a list ofUIComponent
clientIds and/or passtrough expressions for the given expression or expressions.static String
resolveClientIds
(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expressions, Set<SearchExpressionHint> hints) Resolves a list ofUIComponent
clientIds and/or passtrough expressions for the given expression or expressions.static javax.faces.component.UIComponent
resolveComponent
(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression) Resolves aUIComponent
for the given expression.static javax.faces.component.UIComponent
resolveComponent
(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression, Set<SearchExpressionHint> hints) Resolves aUIComponent
for the given expression.static List<javax.faces.component.UIComponent>
resolveComponents
(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expressions) Resolves a list ofUIComponent
s for the given expression or expressions.static List<javax.faces.component.UIComponent>
resolveComponents
(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expressions, Set<SearchExpressionHint> hints) Resolves a list ofUIComponent
s for the given expression or expressions.static String[]
Splits the given string by the given separator, but ignoring separators inside parentheses.protected static String[]
splitExpressions
(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expressions) protected static void
validateExpression
(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression, char separatorChar) Validates the given search expression.protected static void
validateExpressions
(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expressions, String[] splittedExpressions) Validates the given search expressions.protected static void
validateRenderer
(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, javax.faces.component.UIComponent component, String expression, Set<SearchExpressionHint> hints)
-
Field Details
-
EXPRESSION_SEPARATORS
public static final char[] EXPRESSION_SEPARATORS
-
-
Method Details
-
resolveComponents
public static List<javax.faces.component.UIComponent> resolveComponents(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expressions) Resolves a list ofUIComponent
s for the given expression or expressions.- Parameters:
context
- TheFacesContext
.source
- The source component. E.g. a button.expressions
- The search expressions.- Returns:
- A
List
with resolvedUIComponent
s.
-
resolveComponents
public static List<javax.faces.component.UIComponent> resolveComponents(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expressions, Set<SearchExpressionHint> hints) Resolves a list ofUIComponent
s for the given expression or expressions.- Parameters:
context
- TheFacesContext
.source
- The source component. E.g. a button.expressions
- The search expressions.hints
- The hints.- Returns:
- A
List
with resolvedUIComponent
s.
-
resolveClientIds
public static String resolveClientIds(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expressions) Resolves a list ofUIComponent
clientIds and/or passtrough expressions for the given expression or expressions.- Parameters:
context
- TheFacesContext
.source
- The source component. E.g. a button.expressions
- The search expressions.- Returns:
- A
List
with resolved clientIds and/or passtrough expression (like PFS, widgetVar).
-
resolveClientIds
public static String resolveClientIds(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expressions, Set<SearchExpressionHint> hints) Resolves a list ofUIComponent
clientIds and/or passtrough expressions for the given expression or expressions.- Parameters:
context
- TheFacesContext
.source
- The source component. E.g. a button.expressions
- The search expressions.hints
- The hints.- Returns:
- A
List
with resolved clientIds and/or passtrough expression (like PFS, widgetVar).
-
validateRenderer
protected static void validateRenderer(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, javax.faces.component.UIComponent component, String expression, Set<SearchExpressionHint> hints) -
resolveClientId
public static String resolveClientId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression) Resolves aUIComponent
clientId and/or passtrough expression for the given expression.- Parameters:
context
- TheFacesContext
.source
- The source component. E.g. a button.expression
- The search expression.- Returns:
- A resolved clientId and/or passtrough expression (like PFS, widgetVar).
-
resolveClientId
public static String resolveClientId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression, Set<SearchExpressionHint> hints) Resolves aUIComponent
clientId and/or passtrough expression for the given expression.- Parameters:
context
- TheFacesContext
.source
- The source component. E.g. a button.expression
- The search expression.hints
- The hints.- Returns:
- A resolved clientId and/or passtrough expression (like PFS, widgetVar).
-
resolveComponent
public static javax.faces.component.UIComponent resolveComponent(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression) Resolves aUIComponent
for the given expression.- Parameters:
context
- TheFacesContext
.source
- The source component. E.g. a button.expression
- The search expression.- Returns:
- A resolved
UIComponent
ornull
.
-
resolveComponent
public static javax.faces.component.UIComponent resolveComponent(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression, Set<SearchExpressionHint> hints) Resolves aUIComponent
for the given expression.- Parameters:
context
- TheFacesContext
.source
- The source component. E.g. a button.expression
- The search expression.hints
- The hints.- Returns:
- A resolved
UIComponent
ornull
.
-
cannotFindComponent
protected static void cannotFindComponent(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression) -
splitExpressions
-
validateExpression
protected static void validateExpression(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression, char separatorChar) Validates the given search expression. We only validate it, for performance reasons, if the currentProjectStage
isProjectStage.Development
.- Parameters:
context
- TheFacesContext
.source
- The source component. E.g. a button.expression
- The search expression.separatorChar
- The separator as char.
-
validateExpressions
protected static void validateExpressions(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expressions, String[] splittedExpressions) Validates the given search expressions. We only validate it, for performance reasons, if the currentProjectStage
isProjectStage.Development
.- Parameters:
context
- TheFacesContext
.source
- The source component. E.g. a button.expressions
- The search expression.splittedExpressions
- The already splitted expressions.
-
split
public static String[] split(javax.faces.context.FacesContext context, String value, char... separators) Splits the given string by the given separator, but ignoring separators inside parentheses.- Parameters:
context
- The currentFacesContext
.value
- The string value.separators
- The separators.- Returns:
- The splitted string.
-
isPassTroughExpression
Checks if the given expression must not be resolved by aSearchExpressionResolver
, before rendering it to the client. e.g. @all or- Parameters:
expression
- The search expression.- Returns:
true
if it should just be rendered without manipulation or resolving.
-
isNestable
Checks if the given expression can be nested. e.g. @form:@parent This should not be possible e.g. with @none or @all.- Parameters:
expression
- The search expression.- Returns:
true
if it's nestable.
-