-
Field Summary
Fields inherited from class jakarta.faces.component.search.SearchExpressionHandler
EXPRESSION_SEPARATOR_CHARS, KEYWORD_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddHint(SearchExpressionContext searchExpressionContext, SearchExpressionHint hint) protected StringextractFirstCommand(FacesContext facesContext, String expression) Extract the first command from the expression.protected voidinvokeKeywordResolvers(SearchExpressionContext searchExpressionContext, UIComponent previous, String keyword, String remainingExpression, ContextCallback callback) voidinvokeOnComponent(SearchExpressionContext searchExpressionContext, UIComponent previous, String expression, ContextCallback callback) Resolves multipleUIComponents for the given expression.protected booleanisHintSet(SearchExpressionContext searchExpressionContext, SearchExpressionHint hint) booleanisPassthroughExpression(SearchExpressionContext searchExpressionContext, String expression) Checks if the given expression is a "passtrough expression".booleanisValidExpression(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 aListwith clientIds or passthrough expressions for the given expressions.voidresolveComponent(SearchExpressionContext searchExpressionContext, String expression, ContextCallback callback) Resolves a singleUIComponents for the given expression.voidresolveComponents(SearchExpressionContext searchExpressionContext, String expressions, ContextCallback callback) Resolves multipleUIComponents 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:SearchExpressionHandlerResolves to a single clientId or passthrough expression for the given expression.
- Specified by:
resolveClientIdin classSearchExpressionHandler- Parameters:
searchExpressionContext- theSearchExpressionContextexpression- the search expression- Returns:
- The resolved clientId or passtrough expression. If the expression can not be resolved and if
SearchExpressionHint.IGNORE_NO_RESULTwas passed,nullwill be returned.
-
resolveClientIds
public List<String> resolveClientIds(SearchExpressionContext searchExpressionContext, String expressions) Description copied from class:SearchExpressionHandlerResolves to a
Listwith 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:
resolveClientIdsin classSearchExpressionHandler- Parameters:
searchExpressionContext- theSearchExpressionContextexpressions- the search expressions- Returns:
- The resolved clientIds and passtrough expressions.
-
resolveComponent
public void resolveComponent(SearchExpressionContext searchExpressionContext, String expression, ContextCallback callback) Description copied from class:SearchExpressionHandlerResolves a single
UIComponents for the given expression. If the component is resolved, theContextCallbackwill be invoked.- Specified by:
resolveComponentin classSearchExpressionHandler- Parameters:
searchExpressionContext- theSearchExpressionContextexpression- the search expressioncallback- the callback for the resolved component
-
resolveComponents
public void resolveComponents(SearchExpressionContext searchExpressionContext, String expressions, ContextCallback callback) Description copied from class:SearchExpressionHandlerResolves multiple
UIComponents 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, theContextCallbackwill be invoked.- Specified by:
resolveComponentsin classSearchExpressionHandler- Parameters:
searchExpressionContext- theSearchExpressionContextexpressions- 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:SearchExpressionHandlerResolves multiple
UIComponents for the given expression. For each resolved component, theContextCallbackwill 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:
invokeOnComponentin classSearchExpressionHandler- Parameters:
searchExpressionContext- theSearchExpressionContextprevious- 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:SearchExpressionHandlerSplits an string, based on
SearchExpressionHandler.getExpressionSeperatorChars(jakarta.faces.context.FacesContext)with possible multiple expressions into an array.- Specified by:
splitExpressionsin classSearchExpressionHandler- Parameters:
context- theFacesContextfor 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:SearchExpressionHandlerChecks if the given expression is a "passtrough expression". A passthrough expression must only be a keyword. This keyword will not be resolved by the
SearchKeywordResolverand will be returned untouched. The client is responsible to resolve it later.- Specified by:
isPassthroughExpressionin classSearchExpressionHandler- Parameters:
searchExpressionContext- theSearchExpressionContextexpression- the expression- Returns:
- If the given expression is a passtrough expression
-
isValidExpression
public boolean isValidExpression(SearchExpressionContext searchExpressionContext, String expression) Description copied from class:SearchExpressionHandlerChecks if the given expression is a valid expression.
A expression is invalid if:- No
SearchKeywordResolvermatches the requested keyword - A keyword or id is placed after a leaf keyword (@none:@form)
- Specified by:
isValidExpressionin classSearchExpressionHandler- Parameters:
searchExpressionContext- theSearchExpressionContextexpression- 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
-