Class SearchExpressionFacade

java.lang.Object
org.primefaces.expression.SearchExpressionFacade

public class SearchExpressionFacade extends Object
Simple facade for the whole Search Expression module.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final char[]
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected static void
    cannotFindComponent(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression)
     
    protected static boolean
    isNestable(String expression)
    Checks if the given expression can be nested.
    protected static boolean
    Checks if the given expression must not be resolved by a SearchExpressionResolver, before rendering it to the client.
    static String
    resolveClientId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression)
    Resolves a UIComponent clientId and/or passtrough expression for the given expression.
    static String
    resolveClientId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression, Set<SearchExpressionHint> hints)
    Resolves a UIComponent clientId and/or passtrough expression for the given expression.
    static String
    resolveClientIds(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expressions)
    Resolves a list of UIComponent clientIds and/or passtrough expressions for the given expression or expressions.
    static String
    resolveClientIds(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expressions, Set<SearchExpressionHint> hints)
    Resolves a list of UIComponent clientIds and/or passtrough expressions for the given expression or expressions.
    static javax.faces.component.UIComponent
    resolveComponent(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression)
    Resolves a UIComponent for the given expression.
    static javax.faces.component.UIComponent
    resolveComponent(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression, Set<SearchExpressionHint> hints)
    Resolves a UIComponent for the given expression.
    static List<javax.faces.component.UIComponent>
    resolveComponents(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expressions)
    Resolves a list of UIComponents for the given expression or expressions.
    static List<javax.faces.component.UIComponent>
    resolveComponents(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expressions, Set<SearchExpressionHint> hints)
    Resolves a list of UIComponents for the given expression or expressions.
    static String[]
    split(javax.faces.context.FacesContext context, String value, char... separators)
    Splits the given string by the given separator, but ignoring separators inside parentheses.
    protected static String[]
    splitExpressions(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expressions)
     
    protected static void
    validateExpression(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression, char separatorChar)
    Validates the given search expression.
    protected static void
    validateExpressions(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expressions, String[] splittedExpressions)
    Validates the given search expressions.
    protected static void
    validateRenderer(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, javax.faces.component.UIComponent component, String expression, Set<SearchExpressionHint> hints)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • EXPRESSION_SEPARATORS

      public static final char[] EXPRESSION_SEPARATORS
  • Method Details

    • resolveComponents

      public static List<javax.faces.component.UIComponent> resolveComponents(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expressions)
      Resolves a list of UIComponents for the given expression or expressions.
      Parameters:
      context - The FacesContext.
      source - The source component. E.g. a button.
      expressions - The search expressions.
      Returns:
      A List with resolved UIComponents.
    • resolveComponents

      public static List<javax.faces.component.UIComponent> resolveComponents(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expressions, Set<SearchExpressionHint> hints)
      Resolves a list of UIComponents for the given expression or expressions.
      Parameters:
      context - The FacesContext.
      source - The source component. E.g. a button.
      expressions - The search expressions.
      hints - The hints.
      Returns:
      A List with resolved UIComponents.
    • resolveClientIds

      public static String resolveClientIds(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expressions)
      Resolves a list of UIComponent clientIds and/or passtrough expressions for the given expression or expressions.
      Parameters:
      context - The FacesContext.
      source - The source component. E.g. a button.
      expressions - The search expressions.
      Returns:
      A List with resolved clientIds and/or passtrough expression (like PFS, widgetVar).
    • resolveClientIds

      public static String resolveClientIds(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expressions, Set<SearchExpressionHint> hints)
      Resolves a list of UIComponent clientIds and/or passtrough expressions for the given expression or expressions.
      Parameters:
      context - The FacesContext.
      source - The source component. E.g. a button.
      expressions - The search expressions.
      hints - The hints.
      Returns:
      A List with resolved clientIds and/or passtrough expression (like PFS, widgetVar).
    • validateRenderer

      protected static void validateRenderer(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, javax.faces.component.UIComponent component, String expression, Set<SearchExpressionHint> hints)
    • resolveClientId

      public static String resolveClientId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression)
      Resolves a UIComponent clientId and/or passtrough expression for the given expression.
      Parameters:
      context - The FacesContext.
      source - The source component. E.g. a button.
      expression - The search expression.
      Returns:
      A resolved clientId and/or passtrough expression (like PFS, widgetVar).
    • resolveClientId

      public static String resolveClientId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression, Set<SearchExpressionHint> hints)
      Resolves a UIComponent clientId and/or passtrough expression for the given expression.
      Parameters:
      context - The FacesContext.
      source - The source component. E.g. a button.
      expression - The search expression.
      hints - The hints.
      Returns:
      A resolved clientId and/or passtrough expression (like PFS, widgetVar).
    • resolveComponent

      public static javax.faces.component.UIComponent resolveComponent(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression)
      Resolves a UIComponent for the given expression.
      Parameters:
      context - The FacesContext.
      source - The source component. E.g. a button.
      expression - The search expression.
      Returns:
      A resolved UIComponent or null.
    • resolveComponent

      public static javax.faces.component.UIComponent resolveComponent(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression, Set<SearchExpressionHint> hints)
      Resolves a UIComponent for the given expression.
      Parameters:
      context - The FacesContext.
      source - The source component. E.g. a button.
      expression - The search expression.
      hints - The hints.
      Returns:
      A resolved UIComponent or null.
    • cannotFindComponent

      protected static void cannotFindComponent(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression)
    • splitExpressions

      protected static String[] splitExpressions(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expressions)
    • validateExpression

      protected static void validateExpression(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expression, char separatorChar)
      Validates the given search expression. We only validate it, for performance reasons, if the current ProjectStage is ProjectStage.Development.
      Parameters:
      context - The FacesContext.
      source - The source component. E.g. a button.
      expression - The search expression.
      separatorChar - The separator as char.
    • validateExpressions

      protected static void validateExpressions(javax.faces.context.FacesContext context, javax.faces.component.UIComponent source, String expressions, String[] splittedExpressions)
      Validates the given search expressions. We only validate it, for performance reasons, if the current ProjectStage is ProjectStage.Development.
      Parameters:
      context - The FacesContext.
      source - The source component. E.g. a button.
      expressions - The search expression.
      splittedExpressions - The already splitted expressions.
    • split

      public static String[] split(javax.faces.context.FacesContext context, String value, char... separators)
      Splits the given string by the given separator, but ignoring separators inside parentheses.
      Parameters:
      context - The current FacesContext.
      value - The string value.
      separators - The separators.
      Returns:
      The splitted string.
    • isPassTroughExpression

      protected static boolean isPassTroughExpression(String expression)
      Checks if the given expression must not be resolved by a SearchExpressionResolver, before rendering it to the client. e.g. @all or
      Parameters:
      expression - The search expression.
      Returns:
      true if it should just be rendered without manipulation or resolving.
    • isNestable

      protected static boolean isNestable(String expression)
      Checks if the given expression can be nested. e.g. @form:@parent This should not be possible e.g. with @none or @all.
      Parameters:
      expression - The search expression.
      Returns:
      true if it's nestable.