Top Description Constructors Methods
jakarta.faces.component.search

public abstract Class SearchKeywordResolver

extends Object
Class Inheritance
Imports
jakarta.faces.component.UIComponent

A SearchKeywordResolver is responsible for resolving a single keyword. Implementations must support the following set of SearchKeywordResolver implementations, 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 jakarta.faces.component.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 jakarta.faces.component.UIViewRoot
@this The base component

New SearchKeywordResolvers can be registered via jakarta.faces.application.Application#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

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if it's leaf keyword.
isLeaf
(SearchExpressionContext searchExpressionContext, String
the keyword
keyword
)

A leaf keyword is a keyword that does not allow to be combined with keywords or id chains to the right.

public boolean

Returns:

true if it's passthrough keyword.
isPassthrough
(SearchExpressionContext searchExpressionContext, String
the keyword
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.

public abstract boolean

Returns:

true if it's responsible for resolving this keyword
isResolverForKeyword
(SearchExpressionContext searchExpressionContext, String
the keyword
keyword
)

Checks if the current instance of the SearchKeywordResolver is responsible for resolving the keyword.

public abstract void
resolve(SearchKeywordContext
the SearchKeywordContext
searchKeywordContext
,
UIComponent
the previous resolved component or the source component (if called for the first keyword in the chain)
current
,
String
the keyword
keyword
)

Try to resolve one or multiple UIComponents based on the keyword and calls SearchKeywordContext#invokeContextCallback(jakarta.faces.component.UIComponent) for each resolved component.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

SearchKeywordResolverback to summary
public SearchKeywordResolver()

Method Detail

isLeafback to summary
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:SearchExpressionContext

the SearchExpressionContext

keyword:String

the keyword

Returns:boolean

true if it's leaf keyword.

Since
2.3
isPassthroughback to summary
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:SearchExpressionContext

the SearchExpressionContext

keyword:String

the keyword

Returns:boolean

true if it's passthrough keyword.

Since
2.3
isResolverForKeywordback to summary
public abstract boolean isResolverForKeyword(SearchExpressionContext searchExpressionContext, String keyword)

Checks if the current instance of the SearchKeywordResolver is responsible for resolving the keyword.

Parameters
searchExpressionContext:SearchExpressionContext

the SearchExpressionContext

keyword:String

the keyword

Returns:boolean

true if it's responsible for resolving this keyword

Since
2.3
resolveback to summary
public abstract void resolve(SearchKeywordContext searchKeywordContext, UIComponent current, String keyword)

Try to resolve one or multiple UIComponents based on the keyword and calls SearchKeywordContext#invokeContextCallback(jakarta.faces.component.UIComponent) for each resolved component.

Parameters
searchKeywordContext:SearchKeywordContext

the SearchKeywordContext

current:UIComponent

the previous resolved component or the source component (if called for the first keyword in the chain)

keyword:String

the keyword

Since
2.3