Class Components.ForEach

  • Enclosing class:
    Components

    public static class Components.ForEach
    extends Object
    Builder class used to collect a number of query parameters for a visit (for each) of components in the Faces component tree. The chain of collecting parameters is terminated by calling one of the invoke methods.
    Since:
    2.0
    Author:
    Arjan Tijms
    • Constructor Detail

      • ForEach

        public ForEach()
    • Method Detail

      • fromRoot

        public Components.ForEach fromRoot​(UIComponent root)
        The root component where tree visiting starts
        Parameters:
        root - the root component where tree visiting starts
        Returns:
        the intermediate builder object to continue the builder chain
      • havingIds

        public Components.ForEach havingIds​(Collection<String> ids)
        The IDs of the components that are visited
        Parameters:
        ids - the IDs of the components that are visited
        Returns:
        the intermediate builder object to continue the builder chain
      • havingIds

        public Components.ForEach havingIds​(String... ids)
        The IDs of the components that are to be visited
        Parameters:
        ids - the IDs of the components that are to be visited
        Returns:
        the intermediate builder object to continue the builder chain
      • withHints

        public Components.ForEach withHints​(Set<VisitHint> hints)
        The VisitHints that are used for the visit.
        Parameters:
        hints - the VisitHints that are used for the visit.
        Returns:
        the intermediate builder object to continue the builder chain
      • withHints

        public Components.ForEach withHints​(VisitHint... hints)
        The VisitHints that are used for the visit.
        Parameters:
        hints - the VisitHints that are used for the visit.
        Returns:
        the intermediate builder object to continue the builder chain
      • ofTypes

        @SafeVarargs
        public final Components.ForEach ofTypes​(Class<?>... types)
        The types of the components that are to be visited
        Parameters:
        types - the types of the components that are to be visited
        Returns:
        the intermediate builder object to continue the builder chain
      • invoke

        public <C extends UIComponent> void invoke​(Consumer<C> operation)
        Invokes the given operation on the components as specified by the query parameters set via this builder.
        Type Parameters:
        C - The expected component type.
        Parameters:
        operation - the operation to invoke on each component
        Throws:
        ClassCastException - When C is of wrong type.
      • invoke

        public void invoke​(VisitCallback operation)
        Invokes the given operation on the components as specified by the query parameters set via this builder.
        Parameters:
        operation - the operation to invoke on each component
      • getFacesContext

        protected FacesContext getFacesContext()