public abstract class SearchKeywordResolver
extends java.lang.Object
A SearchKeywordResolver is responsible for resolving a single keyword. Implementations must support
the following set of SearchKeywordResolver
implementations, each with the associated behavior.
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 NamingContainer ancestor 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 SearchKeywordResolver
s can be registered via
Application.addSearchKeywordResolver(jakarta.faces.component.search.SearchKeywordResolver)
or in the application configuration resources.
<application>
<search-keyword-resolver>...</search-keyword-resolver>
</application>
Constructor and Description |
---|
SearchKeywordResolver() |
Modifier and Type | Method and Description |
---|---|
boolean |
isLeaf(SearchExpressionContext searchExpressionContext,
java.lang.String keyword)
A leaf keyword is a keyword that does not allow to be combined with keywords or id chains to the right. |
boolean |
isPassthrough(SearchExpressionContext searchExpressionContext,
java.lang.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 boolean |
isResolverForKeyword(SearchExpressionContext searchExpressionContext,
java.lang.String keyword)
Checks if the current instance of the |
abstract void |
resolve(SearchKeywordContext searchKeywordContext,
UIComponent current,
java.lang.String keyword)
Try to resolve one or multiple |
public abstract void resolve(SearchKeywordContext searchKeywordContext, UIComponent current, java.lang.String keyword)
Try to resolve one or multiple UIComponent
s based on the keyword and calls
SearchKeywordContext.invokeContextCallback(jakarta.faces.component.UIComponent)
for each resolved component.
searchKeywordContext
- the SearchKeywordContext
current
- the previous resolved component or the source component (if called for the first keyword in the chain)keyword
- the keywordpublic abstract boolean isResolverForKeyword(SearchExpressionContext searchExpressionContext, java.lang.String keyword)
Checks if the current instance of the SearchKeywordResolver
is responsible for resolving the keyword.
searchExpressionContext
- the SearchExpressionContext
keyword
- the keywordtrue
if it's responsible for resolving this keywordpublic boolean isPassthrough(SearchExpressionContext searchExpressionContext, java.lang.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.
searchExpressionContext
- the SearchExpressionContext
keyword
- the keywordtrue
if it's passthrough keyword.public boolean isLeaf(SearchExpressionContext searchExpressionContext, java.lang.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.
searchExpressionContext
- the SearchExpressionContext
keyword
- the keywordtrue
if it's leaf keyword.