Top Inners Fields Constructors Methods
com.sun.faces.component.search

public Class SearchExpressionHandlerImpl

extends SearchExpressionHandler
Class Inheritance
Imports
java.util.ArrayList, .Collections, .List, jakarta.faces.FacesException, jakarta.faces.component.ContextCallback, .UIComponent, jakarta.faces.component.search.ComponentNotFoundException, .SearchExpressionContext, .SearchExpressionHandler, .SearchExpressionHint, .SearchKeywordContext, .SearchKeywordResolver, jakarta.faces.context.FacesContext

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static class
private static class

Field Summary

Inherited from jakarta.faces.component.search.SearchExpressionHandler:
EXPRESSION_SEPARATOR_CHARSKEYWORD_PREFIX

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
addHint(SearchExpressionContext searchExpressionContext, SearchExpressionHint hint)

protected String

Returns:

the first command from the expression
extractFirstCommand
(FacesContext
the faces context
facesContext
,
String
the expression
expression
)

Extract the first command from the expression.

protected void
invokeKeywordResolvers(SearchExpressionContext searchExpressionContext, UIComponent previous, String keyword, String remainingExpression, ContextCallback callback)

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

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

Resolves multiple UIComponents for the given expression.

protected boolean
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.

Inherited from jakarta.faces.component.search.SearchExpressionHandler:
getExpressionSeperatorCharsinvokeOnComponent

Constructor Detail

SearchExpressionHandlerImplback to summary
public SearchExpressionHandlerImpl()

Method Detail

addHintback to summary
protected void addHint(SearchExpressionContext searchExpressionContext, SearchExpressionHint hint)
extractFirstCommandback to summary
protected String extractFirstCommand(FacesContext facesContext, String expression)

Extract the first command from the expression. @child(1):myId => @child(1) myId:@parent => myId

Parameters
facesContext:FacesContext

the faces context

expression:String

the expression

Returns:String

the first command from the expression

invokeKeywordResolversback to summary
protected void invokeKeywordResolvers(SearchExpressionContext searchExpressionContext, UIComponent previous, String keyword, String remainingExpression, ContextCallback callback)
invokeOnComponentback to summary
public void invokeOnComponent(SearchExpressionContext searchExpressionContext, UIComponent previous, String expression, final 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
isHintSetback to summary
protected boolean isHintSet(SearchExpressionContext searchExpressionContext, SearchExpressionHint hint)
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
com.sun.faces.component.search back to summary

private Class SearchExpressionHandlerImpl.ResolveClientIdCallback

extends Object
implements ContextCallback
Class Inheritance
  • java.lang.Object
  • com.sun.faces.component.search.SearchExpressionHandlerImpl.ResolveClientIdCallback
All Implemented Interfaces
jakarta.faces.component.ContextCallback

Field Summary

Modifier and TypeField and Description
private String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
public void
invokeContextCallback(FacesContext
the FacesContext for this request.
context
,
UIComponent
the UIComponent that was located by clientId by a call to UIComponent#invokeOnComponent.
target
)

Implements jakarta.faces.component.ContextCallback.invokeContextCallback.

This method will be called by an implementation of UIComponent#invokeOnComponent and must be passed the component with the clientId given as an argument to invokeOnComponent.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

clientIdback to summary
private String clientId

Constructor Detail

ResolveClientIdCallbackback to summary
private ResolveClientIdCallback()

Method Detail

getClientIdback to summary
public String getClientId()
invokeContextCallbackback to summary
public void invokeContextCallback(FacesContext context, UIComponent target)

Implements jakarta.faces.component.ContextCallback.invokeContextCallback.

Doc from jakarta.faces.component.ContextCallback.invokeContextCallback.

This method will be called by an implementation of UIComponent#invokeOnComponent and must be passed the component with the clientId given as an argument to invokeOnComponent. At the point in time when this method is called, the argument target is guaranteed to be in the proper state with respect to its ancestors in the View.

Parameters
context:FacesContext

the FacesContext for this request.

target:UIComponent

the UIComponent that was located by clientId by a call to UIComponent#invokeOnComponent.

Annotations
@Override
com.sun.faces.component.search back to summary

private Class SearchExpressionHandlerImpl.ResolveClientIdsCallback

extends Object
implements ContextCallback
Class Inheritance
  • java.lang.Object
  • com.sun.faces.component.search.SearchExpressionHandlerImpl.ResolveClientIdsCallback
All Implemented Interfaces
jakarta.faces.component.ContextCallback

Field Summary

Modifier and TypeField and Description
private List<String>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
addClientId(String clientId)

public List<String>
public void
invokeContextCallback(FacesContext
the FacesContext for this request.
context
,
UIComponent
the UIComponent that was located by clientId by a call to UIComponent#invokeOnComponent.
target
)

Implements jakarta.faces.component.ContextCallback.invokeContextCallback.

This method will be called by an implementation of UIComponent#invokeOnComponent and must be passed the component with the clientId given as an argument to invokeOnComponent.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

clientIdsback to summary
private List<String> clientIds

Constructor Detail

ResolveClientIdsCallbackback to summary
private ResolveClientIdsCallback()

Method Detail

addClientIdback to summary
public void addClientId(String clientId)
getClientIdsback to summary
public List<String> getClientIds()
invokeContextCallbackback to summary
public void invokeContextCallback(FacesContext context, UIComponent target)

Implements jakarta.faces.component.ContextCallback.invokeContextCallback.

Doc from jakarta.faces.component.ContextCallback.invokeContextCallback.

This method will be called by an implementation of UIComponent#invokeOnComponent and must be passed the component with the clientId given as an argument to invokeOnComponent. At the point in time when this method is called, the argument target is guaranteed to be in the proper state with respect to its ancestors in the View.

Parameters
context:FacesContext

the FacesContext for this request.

target:UIComponent

the UIComponent that was located by clientId by a call to UIComponent#invokeOnComponent.

Annotations
@Override
com.sun.faces.component.search back to summary

private Class SearchExpressionHandlerImpl.ResolveComponentCallback

extends Object
implements ContextCallback
Class Inheritance
  • java.lang.Object
  • com.sun.faces.component.search.SearchExpressionHandlerImpl.ResolveComponentCallback
All Implemented Interfaces
jakarta.faces.component.ContextCallback

Field Summary

Modifier and TypeField and Description
private final ContextCallback
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
invokeContextCallback(FacesContext
the FacesContext for this request.
context
,
UIComponent
the UIComponent that was located by clientId by a call to UIComponent#invokeOnComponent.
target
)

Implements jakarta.faces.component.ContextCallback.invokeContextCallback.

This method will be called by an implementation of UIComponent#invokeOnComponent and must be passed the component with the clientId given as an argument to invokeOnComponent.

public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

callbackback to summary
private final ContextCallback callback
invokedback to summary
private boolean invoked

Constructor Detail

ResolveComponentCallbackback to summary
public ResolveComponentCallback(ContextCallback callback)

Method Detail

invokeContextCallbackback to summary
public void invokeContextCallback(FacesContext context, UIComponent target)

Implements jakarta.faces.component.ContextCallback.invokeContextCallback.

Doc from jakarta.faces.component.ContextCallback.invokeContextCallback.

This method will be called by an implementation of UIComponent#invokeOnComponent and must be passed the component with the clientId given as an argument to invokeOnComponent. At the point in time when this method is called, the argument target is guaranteed to be in the proper state with respect to its ancestors in the View.

Parameters
context:FacesContext

the FacesContext for this request.

target:UIComponent

the UIComponent that was located by clientId by a call to UIComponent#invokeOnComponent.

Annotations
@Override
isInvokedback to summary
public boolean isInvoked()
com.sun.faces.component.search back to summary

private Class SearchExpressionHandlerImpl.ResolveComponentsCallback

extends Object
implements ContextCallback
Class Inheritance
  • java.lang.Object
  • com.sun.faces.component.search.SearchExpressionHandlerImpl.ResolveComponentsCallback
All Implemented Interfaces
jakarta.faces.component.ContextCallback

Field Summary

Modifier and TypeField and Description
private final ContextCallback
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
invokeContextCallback(FacesContext
the FacesContext for this request.
context
,
UIComponent
the UIComponent that was located by clientId by a call to UIComponent#invokeOnComponent.
target
)

Implements jakarta.faces.component.ContextCallback.invokeContextCallback.

This method will be called by an implementation of UIComponent#invokeOnComponent and must be passed the component with the clientId given as an argument to invokeOnComponent.

public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

callbackback to summary
private final ContextCallback callback
invokedback to summary
private boolean invoked

Constructor Detail

ResolveComponentsCallbackback to summary
public ResolveComponentsCallback(ContextCallback callback)

Method Detail

invokeContextCallbackback to summary
public void invokeContextCallback(FacesContext context, UIComponent target)

Implements jakarta.faces.component.ContextCallback.invokeContextCallback.

Doc from jakarta.faces.component.ContextCallback.invokeContextCallback.

This method will be called by an implementation of UIComponent#invokeOnComponent and must be passed the component with the clientId given as an argument to invokeOnComponent. At the point in time when this method is called, the argument target is guaranteed to be in the proper state with respect to its ancestors in the View.

Parameters
context:FacesContext

the FacesContext for this request.

target:UIComponent

the UIComponent that was located by clientId by a call to UIComponent#invokeOnComponent.

Annotations
@Override
isInvokedback to summary
public boolean isInvoked()