Class SearchKeywordResolver
- java.lang.Object
-
- jakarta.faces.component.search.SearchKeywordResolver
-
public abstract class SearchKeywordResolver extends Object
A SearchKeywordResolver is responsible for resolving a single keyword. Implementations must support the following set of
SearchKeywordResolverimplementations, each with the associated behavior.List of required supported keywords and their behaviors Search Keyword Behavior @all All components in the view @child(n) The nth child of the base component @composite The composite component parent of the base component @form The closest form ancestor of the base component @id(id) Resolves to the components with the specified component id (not clientId). This is useful when the exact location of the component tree is unknown, but must be used with caution when there multiple occurrences of the given id within the view. @namingcontainer The closest NamingContainerancestor component of the base component@next The next component in the view after the base component @none No component @parent The parent of the base component @previous The previous component to the base component @root The UIViewRoot@this The base component New
SearchKeywordResolvers can be registered viaApplication.addSearchKeywordResolver(jakarta.faces.component.search.SearchKeywordResolver)or in the application configuration resources.<application> <search-keyword-resolver>...</search-keyword-resolver> </application>- Since:
- 2.3
-
-
Constructor Summary
Constructors Constructor Description SearchKeywordResolver()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanisLeaf(SearchExpressionContext searchExpressionContext, String keyword)A leaf keyword is a keyword that does not allow to be combined with keywords or id chains to the right.booleanisPassthrough(SearchExpressionContext searchExpressionContext, String keyword)A passthrough keyword is a keyword, that according to the context, does not require to be resolved on the server, and can be passed "unresolved" to the client.abstract booleanisResolverForKeyword(SearchExpressionContext searchExpressionContext, String keyword)Checks if the current instance of theSearchKeywordResolveris responsible for resolving the keyword.abstract voidresolve(SearchKeywordContext searchKeywordContext, UIComponent current, String keyword)Try to resolve one or multipleUIComponents based on the keyword and callsSearchKeywordContext.invokeContextCallback(jakarta.faces.component.UIComponent)for each resolved component.
-
-
-
Method Detail
-
resolve
public abstract void resolve(SearchKeywordContext searchKeywordContext, UIComponent current, String keyword)
Try to resolve one or multiple
UIComponents based on the keyword and callsSearchKeywordContext.invokeContextCallback(jakarta.faces.component.UIComponent)for each resolved component.- Parameters:
searchKeywordContext- theSearchKeywordContextcurrent- the previous resolved component or the source component (if called for the first keyword in the chain)keyword- the keyword- Since:
- 2.3
-
isResolverForKeyword
public abstract boolean isResolverForKeyword(SearchExpressionContext searchExpressionContext, String keyword)
Checks if the current instance of the
SearchKeywordResolveris responsible for resolving the keyword.- Parameters:
searchExpressionContext- theSearchExpressionContextkeyword- the keyword- Returns:
trueif it's responsible for resolving this keyword- Since:
- 2.3
-
isPassthrough
public boolean isPassthrough(SearchExpressionContext searchExpressionContext, String keyword)
A passthrough keyword is a keyword, that according to the context, does not require to be resolved on the server, and can be passed "unresolved" to the client.
- Parameters:
searchExpressionContext- theSearchExpressionContextkeyword- the keyword- Returns:
trueif it's passthrough keyword.- Since:
- 2.3
-
isLeaf
public boolean isLeaf(SearchExpressionContext searchExpressionContext, String keyword)
A leaf keyword is a keyword that does not allow to be combined with keywords or id chains to the right. For example: @none:@parent.
- Parameters:
searchExpressionContext- theSearchExpressionContextkeyword- the keyword- Returns:
trueif it's leaf keyword.- Since:
- 2.3
-
-