Top Description Fields Constructors Methods
jakarta.faces.component.search

public abstract Class SearchExpressionHandlerWrapper

extends SearchExpressionHandler
implements FacesWrapper<SearchExpressionHandler>
Class Inheritance
All Implemented Interfaces
jakarta.faces.FacesWrapper
Imports
java.util.List, jakarta.faces.FacesWrapper, jakarta.faces.component.ContextCallback, .UIComponent, jakarta.faces.context.FacesContext

Provides a simple implementation of SearchExpressionHandler that can be subclassed by developers wishing to provide specialized behavior to an existing SearchExpressionHandler instance. The default implementation of all methods is to call through to the wrapped SearchExpressionHandler instance. Usage: extend this class and push the implementation being wrapped to the constructor and use getWrapped to access the instance being wrapped.

Since
2.3

Field Summary

Modifier and TypeField and Description
private final SearchExpressionHandler
Inherited from jakarta.faces.component.search.SearchExpressionHandler:
EXPRESSION_SEPARATOR_CHARSKEYWORD_PREFIX

Constructor Summary

AccessConstructor and Description
public
SearchExpressionHandlerWrapper(SearchExpressionHandler
The implementation being wrapped.
wrapped
)

If this search expression handler has been decorated, the implementation doing the decorating should push the implementation being wrapped to this constructor.

Method Summary

Modifier and TypeMethod and Description
public char[]
getExpressionSeperatorChars(FacesContext
the FacesContext for the current request
context
)

Overrides jakarta.faces.component.search.SearchExpressionHandler.getExpressionSeperatorChars.

Return the characters used to separate expressions in a series of expressions.

public SearchExpressionHandler
getWrapped()

Implements jakarta.faces.FacesWrapper.getWrapped.

A class that implements this interface uses this method to return an instance of the class being wrapped.

public void
invokeOnComponent(SearchExpressionContext searchExpressionContext, String
the search expression
expression
,
ContextCallback
the callback for the resolved component
callback
)

Overrides jakarta.faces.component.search.SearchExpressionHandler.invokeOnComponent.

Resolves multiple UIComponents for the given expression.

public void
invokeOnComponent(SearchExpressionContext searchExpressionContext, UIComponent
The previous resolved component, that will be the base for searching
previous
,
String
the search expression
expression
,
ContextCallback
the callback for the resolved component
callback
)

Implements abstract jakarta.faces.component.search.SearchExpressionHandler.invokeOnComponent.

Resolves multiple UIComponents for the given expression.

public boolean
isPassthroughExpression(SearchExpressionContext searchExpressionContext, String
the expression
expression
)

Implements abstract jakarta.faces.component.search.SearchExpressionHandler.isPassthroughExpression.

Checks if the given expression is a "passtrough expression".

public boolean
isValidExpression(SearchExpressionContext searchExpressionContext, String
the expression
expression
)

Implements abstract jakarta.faces.component.search.SearchExpressionHandler.isValidExpression.

Checks if the given expression is a valid expression.

public String
resolveClientId(SearchExpressionContext searchExpressionContext, String
the search expression
expression
)

Implements abstract jakarta.faces.component.search.SearchExpressionHandler.resolveClientId.

Resolves to a single clientId or passthrough expression for the given expression.

public List<String>
resolveClientIds(SearchExpressionContext searchExpressionContext, String
the search expressions
expressions
)

Implements abstract jakarta.faces.component.search.SearchExpressionHandler.resolveClientIds.

Resolves to a List with clientIds or passthrough expressions for the given expressions.

public void
resolveComponent(SearchExpressionContext searchExpressionContext, String
the search expression
expression
,
ContextCallback
the callback for the resolved component
callback
)

Implements abstract jakarta.faces.component.search.SearchExpressionHandler.resolveComponent.

Resolves a single UIComponents for the given expression.

public void
resolveComponents(SearchExpressionContext searchExpressionContext, String
the search expression(s)
expressions
,
ContextCallback
the callback for each resolved component
callback
)

Implements abstract jakarta.faces.component.search.SearchExpressionHandler.resolveComponents.

Resolves multiple UIComponents for the given expression(s).

public String[]
splitExpressions(FacesContext
the FacesContext for the current request
context
,
String
The expressions as string
expressions
)

Implements abstract jakarta.faces.component.search.SearchExpressionHandler.splitExpressions.

Splits an string, based on getExpressionSeperatorChars(jakarta.faces.context.FacesContext) with possible multiple expressions into an array.

Field Detail

wrappedback to summary
private final SearchExpressionHandler wrapped

Constructor Detail

SearchExpressionHandlerWrapperback to summary
public SearchExpressionHandlerWrapper(SearchExpressionHandler wrapped)

If this search expression handler has been decorated, the implementation doing the decorating should push the implementation being wrapped to this constructor. The getWrapped() will then return the implementation being wrapped.

Parameters
wrapped:SearchExpressionHandler

The implementation being wrapped.

Since
2.3

Method Detail

getExpressionSeperatorCharsback to summary
public char[] getExpressionSeperatorChars(FacesContext context)

Overrides jakarta.faces.component.search.SearchExpressionHandler.getExpressionSeperatorChars.

Doc from jakarta.faces.component.search.SearchExpressionHandler.getExpressionSeperatorChars.

Return the characters used to separate expressions in a series of expressions. The default implementation returns SearchExpressionHandler#EXPRESSION_SEPARATOR_CHARS.

Parameters
context:FacesContext

the FacesContext for the current request

Returns:char[]

the separator chars

Annotations
@Override
getWrappedback to summary
public SearchExpressionHandler getWrapped()

Implements jakarta.faces.FacesWrapper.getWrapped.

Doc from jakarta.faces.FacesWrapper.getWrapped.

A class that implements this interface uses this method to return an instance of the class being wrapped.

Returns:SearchExpressionHandler

the wrapped instance.

Annotations
@Override
invokeOnComponentback to summary
public void invokeOnComponent(SearchExpressionContext searchExpressionContext, String expression, ContextCallback callback)

Overrides jakarta.faces.component.search.SearchExpressionHandler.invokeOnComponent.

Doc from jakarta.faces.component.search.SearchExpressionHandler.invokeOnComponent.

Resolves multiple UIComponents for the given expression. For each resolved component, the ContextCallback 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.

Parameters
searchExpressionContext:SearchExpressionContext

the SearchExpressionContext

expression:String

the search expression

callback:ContextCallback

the callback for the resolved component

Annotations
@Override
invokeOnComponentback to summary
public void invokeOnComponent(SearchExpressionContext searchExpressionContext, UIComponent previous, String expression, ContextCallback callback)

Implements abstract jakarta.faces.component.search.SearchExpressionHandler.invokeOnComponent.

Doc from jakarta.faces.component.search.SearchExpressionHandler.invokeOnComponent.

Resolves multiple UIComponents for the given expression. For each resolved component, the ContextCallback 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.

Parameters
searchExpressionContext:SearchExpressionContext

the SearchExpressionContext

previous:UIComponent

The previous resolved component, that will be the base for searching

expression:String

the search expression

callback:ContextCallback

the callback for the resolved component

Annotations
@Override
isPassthroughExpressionback to summary
public boolean isPassthroughExpression(SearchExpressionContext searchExpressionContext, String expression)

Implements abstract jakarta.faces.component.search.SearchExpressionHandler.isPassthroughExpression.

Doc from jakarta.faces.component.search.SearchExpressionHandler.isPassthroughExpression.

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.

Parameters
searchExpressionContext:SearchExpressionContext

the SearchExpressionContext

expression:String

the expression

Returns:boolean

If the given expression is a passtrough expression

Annotations
@Override
isValidExpressionback to summary
public boolean isValidExpression(SearchExpressionContext searchExpressionContext, String expression)

Implements abstract jakarta.faces.component.search.SearchExpressionHandler.isValidExpression.

Doc from jakarta.faces.component.search.SearchExpressionHandler.isValidExpression.

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)
Parameters
searchExpressionContext:SearchExpressionContext

the SearchExpressionContext

expression:String

the expression

Returns:boolean

If the given expression is a valid expression

Annotations
@Override
resolveClientIdback to summary
public String resolveClientId(SearchExpressionContext searchExpressionContext, String expression)

Implements abstract jakarta.faces.component.search.SearchExpressionHandler.resolveClientId.

Doc from jakarta.faces.component.search.SearchExpressionHandler.resolveClientId.

Resolves to a single clientId or passthrough expression for the given expression.

Parameters
searchExpressionContext:SearchExpressionContext

the SearchExpressionContext

expression:String

the search expression

Returns:String

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.

Annotations
@Override
resolveClientIdsback to summary
public List<String> resolveClientIds(SearchExpressionContext searchExpressionContext, String expressions)

Implements abstract jakarta.faces.component.search.SearchExpressionHandler.resolveClientIds.

Doc from jakarta.faces.component.search.SearchExpressionHandler.resolveClientIds.

Resolves to a List with clientIds or passthrough expressions for the given expressions. The expressions will be splitted by splitExpressions(jakarta.faces.context.FacesContext, java.lang.String) and resolved one by one.

Parameters
searchExpressionContext:SearchExpressionContext

the SearchExpressionContext

expressions:String

the search expressions

Returns:List<String>

The resolved clientIds and passtrough expressions.

Annotations
@Override
resolveComponentback to summary
public void resolveComponent(SearchExpressionContext searchExpressionContext, String expression, ContextCallback callback)

Implements abstract jakarta.faces.component.search.SearchExpressionHandler.resolveComponent.

Doc from jakarta.faces.component.search.SearchExpressionHandler.resolveComponent.

Resolves a single UIComponents for the given expression. If the component is resolved, the ContextCallback will be invoked.

Parameters
searchExpressionContext:SearchExpressionContext

the SearchExpressionContext

expression:String

the search expression

callback:ContextCallback

the callback for the resolved component

Annotations
@Override
resolveComponentsback to summary
public void resolveComponents(SearchExpressionContext searchExpressionContext, String expressions, ContextCallback callback)

Implements abstract jakarta.faces.component.search.SearchExpressionHandler.resolveComponents.

Doc from jakarta.faces.component.search.SearchExpressionHandler.resolveComponents.

Resolves multiple UIComponents for the given expression(s). The expressions will be splitted by splitExpressions(jakarta.faces.context.FacesContext, java.lang.String) and resolved one by one. For each resolved component, the ContextCallback will be invoked.

Parameters
searchExpressionContext:SearchExpressionContext

the SearchExpressionContext

expressions:String

the search expression(s)

callback:ContextCallback

the callback for each resolved component

Annotations
@Override
splitExpressionsback to summary
public String[] splitExpressions(FacesContext context, String expressions)

Implements abstract jakarta.faces.component.search.SearchExpressionHandler.splitExpressions.

Doc from jakarta.faces.component.search.SearchExpressionHandler.splitExpressions.

Splits an string, based on getExpressionSeperatorChars(jakarta.faces.context.FacesContext) with possible multiple expressions into an array.

Parameters
context:FacesContext

the FacesContext for the current request

expressions:String

The expressions as string

Returns:String[]

the expression(s) as array

Annotations
@Override