-
Field Summary
Fields inherited from class jakarta.faces.component.search.SearchExpressionHandler
EXPRESSION_SEPARATOR_CHARS, KEYWORD_PREFIX
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addHint
(SearchExpressionContext searchExpressionContext, SearchExpressionHint hint) protected String
extractFirstCommand
(FacesContext facesContext, String expression) Extract the first command from the expression.protected void
invokeKeywordResolvers
(SearchExpressionContext searchExpressionContext, UIComponent previous, String keyword, String remainingExpression, ContextCallback callback) void
invokeOnComponent
(SearchExpressionContext searchExpressionContext, UIComponent previous, String expression, ContextCallback callback) Resolves multipleUIComponent
s for the given expression.protected boolean
isHintSet
(SearchExpressionContext searchExpressionContext, SearchExpressionHint hint) boolean
isPassthroughExpression
(SearchExpressionContext searchExpressionContext, String expression) Checks if the given expression is a "passtrough expression".boolean
isValidExpression
(SearchExpressionContext searchExpressionContext, String expression) Checks if the given expression is a valid expression.resolveClientId
(SearchExpressionContext searchExpressionContext, String expression) Resolves to a single clientId or passthrough expression for the given expression.resolveClientIds
(SearchExpressionContext searchExpressionContext, String expressions) Resolves to aList
with clientIds or passthrough expressions for the given expressions.void
resolveComponent
(SearchExpressionContext searchExpressionContext, String expression, ContextCallback callback) Resolves a singleUIComponent
s for the given expression.void
resolveComponents
(SearchExpressionContext searchExpressionContext, String expressions, ContextCallback callback) Resolves multipleUIComponent
s for the given expression(s).String[]
splitExpressions
(FacesContext context, String expressions) Splits an string, based onSearchExpressionHandler.getExpressionSeperatorChars(jakarta.faces.context.FacesContext)
with possible multiple expressions into an array.Methods inherited from class jakarta.faces.component.search.SearchExpressionHandler
getExpressionSeperatorChars, invokeOnComponent
-
Constructor Details
-
SearchExpressionHandlerImpl
public SearchExpressionHandlerImpl()
-
-
Method Details
-
addHint
-
resolveClientId
Description copied from class:SearchExpressionHandler
Resolves to a single clientId or passthrough expression for the given expression.
- Specified by:
resolveClientId
in classSearchExpressionHandler
- Parameters:
searchExpressionContext
- theSearchExpressionContext
expression
- the search expression- Returns:
- The resolved clientId or passtrough expression. If the expression can not be resolved and if
SearchExpressionHint.IGNORE_NO_RESULT
was passed,null
will be returned.
-
resolveClientIds
public List<String> resolveClientIds(SearchExpressionContext searchExpressionContext, String expressions) Description copied from class:SearchExpressionHandler
Resolves to a
List
with clientIds or passthrough expressions for the given expressions. The expressions will be splitted bySearchExpressionHandler.splitExpressions(jakarta.faces.context.FacesContext, java.lang.String)
and resolved one by one.- Specified by:
resolveClientIds
in classSearchExpressionHandler
- Parameters:
searchExpressionContext
- theSearchExpressionContext
expressions
- the search expressions- Returns:
- The resolved clientIds and passtrough expressions.
-
resolveComponent
public void resolveComponent(SearchExpressionContext searchExpressionContext, String expression, ContextCallback callback) Description copied from class:SearchExpressionHandler
Resolves a single
UIComponent
s for the given expression. If the component is resolved, theContextCallback
will be invoked.- Specified by:
resolveComponent
in classSearchExpressionHandler
- Parameters:
searchExpressionContext
- theSearchExpressionContext
expression
- the search expressioncallback
- the callback for the resolved component
-
resolveComponents
public void resolveComponents(SearchExpressionContext searchExpressionContext, String expressions, ContextCallback callback) Description copied from class:SearchExpressionHandler
Resolves multiple
UIComponent
s for the given expression(s). The expressions will be splitted bySearchExpressionHandler.splitExpressions(jakarta.faces.context.FacesContext, java.lang.String)
and resolved one by one. For each resolved component, theContextCallback
will be invoked.- Specified by:
resolveComponents
in classSearchExpressionHandler
- Parameters:
searchExpressionContext
- theSearchExpressionContext
expressions
- the search expression(s)callback
- the callback for each resolved component
-
invokeOnComponent
public void invokeOnComponent(SearchExpressionContext searchExpressionContext, UIComponent previous, String expression, ContextCallback callback) Description copied from class:SearchExpressionHandler
Resolves multiple
UIComponent
s for the given expression. For each resolved component, theContextCallback
will be invoked. This method is the most essential method in the API. It implements the algorithm which handles the recursion of the keywords and id's.- Specified by:
invokeOnComponent
in classSearchExpressionHandler
- Parameters:
searchExpressionContext
- theSearchExpressionContext
previous
- The previous resolved component, that will be the base for searchingexpression
- the search expressioncallback
- the callback for the resolved component
-
invokeKeywordResolvers
protected void invokeKeywordResolvers(SearchExpressionContext searchExpressionContext, UIComponent previous, String keyword, String remainingExpression, ContextCallback callback) -
splitExpressions
Description copied from class:SearchExpressionHandler
Splits an string, based on
SearchExpressionHandler.getExpressionSeperatorChars(jakarta.faces.context.FacesContext)
with possible multiple expressions into an array.- Specified by:
splitExpressions
in classSearchExpressionHandler
- Parameters:
context
- theFacesContext
for the current requestexpressions
- The expressions as string- Returns:
- the expression(s) as array
-
isPassthroughExpression
public boolean isPassthroughExpression(SearchExpressionContext searchExpressionContext, String expression) Description copied from class:SearchExpressionHandler
Checks if the given expression is a "passtrough expression". A passthrough expression must only be a keyword. This keyword will not be resolved by the
SearchKeywordResolver
and will be returned untouched. The client is responsible to resolve it later.- Specified by:
isPassthroughExpression
in classSearchExpressionHandler
- Parameters:
searchExpressionContext
- theSearchExpressionContext
expression
- the expression- Returns:
- If the given expression is a passtrough expression
-
isValidExpression
public boolean isValidExpression(SearchExpressionContext searchExpressionContext, String expression) Description copied from class:SearchExpressionHandler
Checks if the given expression is a valid expression.
A expression is invalid if:- No
SearchKeywordResolver
matches the requested keyword - A keyword or id is placed after a leaf keyword (@none:@form)
- Specified by:
isValidExpression
in classSearchExpressionHandler
- Parameters:
searchExpressionContext
- theSearchExpressionContext
expression
- the expression- Returns:
- If the given expression is a valid expression
- No
-
isHintSet
protected boolean isHintSet(SearchExpressionContext searchExpressionContext, SearchExpressionHint hint) -
extractFirstCommand
Extract the first command from the expression.@child(1):myId => @child(1) myId:@parent => myId
- Parameters:
facesContext
- the faces contextexpression
- the expression- Returns:
- the first command from the expression
-