Class UIComponent

    • Constructor Detail

      • UIComponent

        public UIComponent()
    • Method Detail

      • getPassThroughAttributes

        public Map<String,​Object> getPassThroughAttributes()
        Returns:
        Since:
        2.2
      • getPassThroughAttributes

        public Map<String,​Object> getPassThroughAttributes​(boolean create)
        Parameters:
        create -
        Returns:
        A Map instance, or null.
        Since:
        2.2
      • invokeOnComponent

        public boolean invokeOnComponent​(FacesContext context,
                                         String clientId,
                                         ContextCallback callback)
                                  throws FacesException
        Invokes the invokeContextCallback method with the component, specified by clientId.
        Parameters:
        context - FacesContext for the current request
        clientId - the id of the desired UIComponent clazz
        callback - Implementation of the ContextCallback to be called
        Returns:
        has component been found ?
        Throws:
        FacesException
      • isCompositeComponent

        public static boolean isCompositeComponent​(UIComponent component)
        Parameters:
        component -
        Returns:
        true if the component is a composite component otherwise false is returned
        Throws:
        NullPointerException - if the component is null
        Since:
        2.0
      • isInView

        public boolean isInView()
        Indicate if this component is inside a view, or in other words is contained by an UIViewRoot instance (which represents the view). If this component is a UIViewRoot instance, the components "always" is on the view. By default it is false but for UIViewRoot instances is true.
        Returns:
        Since:
        2.0
      • isRendered

        public abstract boolean isRendered()
      • isVisitable

        protected boolean isVisitable​(VisitContext context)
        This method indicates if a component is visitable according to the hints passed by the VisitContext parameter! This method internally is used by visitTree and if it returns false it short circuits the visitTree execution.
        Parameters:
        context -
        Returns:
        Since:
        2.0
      • setValueExpression

        public void setValueExpression​(String name,
                                       jakarta.el.ValueExpression expression)
      • getClientId

        public String getClientId()
      • getCompositeComponentParent

        public static UIComponent getCompositeComponentParent​(UIComponent component)
        search for the nearest parent composite component, if no parent is found it has to return null! if the component itself is null we have to return null as well!
        Parameters:
        component - the component to start from
        Returns:
        the parent composite component if found otherwise null
        Since:
        2.0
      • getContainerClientId

        public String getContainerClientId​(FacesContext ctx)
        Since:
        1.2
      • getCurrentComponent

        public static UIComponent getCurrentComponent​(FacesContext context)
        Parameters:
        context -
        Returns:
        Since:
        2.0
      • getCurrentCompositeComponent

        public static UIComponent getCurrentCompositeComponent​(FacesContext context)
        Parameters:
        context -
        Returns:
        Since:
        2.0
      • getFamily

        public abstract String getFamily()
      • getId

        public abstract String getId()
      • getNamingContainer

        public UIComponent getNamingContainer()
        Returns:
        Since:
        2.0
      • setId

        public abstract void setId​(String id)
      • setInView

        public void setInView​(boolean isInView)
        Define if the component is on the view or not.

        This value is set in the following conditions:

        • Component / Facet added: if the parent isInView = true, set it to true and all their children or facets, otherwise take no action
        • Component / Facet removed: if the parent isInView = false, set it to false and all their children or facets, otherwise take no action
        Parameters:
        isInView -
        Since:
        2.0
      • setParent

        public abstract void setParent​(UIComponent parent)
        For Faces-framework internal use only. Don't call this method to add components to the component tree. Use parent.getChildren().add(child) instead.
      • getParent

        public abstract UIComponent getParent()
        Returns the parent of the component. Children can be added to or removed from a component even if this method returns null for the child.
      • setRendered

        public abstract void setRendered​(boolean rendered)
      • getRendererType

        public abstract String getRendererType()
      • setRendererType

        public abstract void setRendererType​(String rendererType)
      • getRendersChildren

        public abstract boolean getRendersChildren()
      • getResourceBundleMap

        public Map<String,​String> getResourceBundleMap()
      • getValueExpression

        public jakarta.el.ValueExpression getValueExpression​(String name)
      • getChildCount

        public abstract int getChildCount()
      • decode

        public abstract void decode​(FacesContext context)
      • addFacesListener

        protected abstract void addFacesListener​(FacesListener listener)
      • getFacesListeners

        protected abstract FacesListener[] getFacesListeners​(Class clazz)
      • removeFacesListener

        protected abstract void removeFacesListener​(FacesListener listener)
      • queueEvent

        public abstract void queueEvent​(FacesEvent event)
      • processRestoreState

        public abstract void processRestoreState​(FacesContext context,
                                                 Object state)
      • processDecodes

        public abstract void processDecodes​(FacesContext context)
      • processValidators

        public abstract void processValidators​(FacesContext context)
      • processUpdates

        public abstract void processUpdates​(FacesContext context)
      • visitTree

        public boolean visitTree​(VisitContext context,
                                 VisitCallback callback)
        The visit tree method, visit tree walks over a subtree and processes the callback object to perform some operation on the subtree

        there are some details in the implementation which according to the spec have to be in place: a) before calling the callback and traversing into the subtree pushComponentToEL has to be called b) after the processing popComponentFromEL has to be performed to remove the component from the el

        The tree traversal optimizations are located in the visit context and can be replaced via the VisitContextFactory in the faces-config factory section

        Parameters:
        context - the visit context which handles the processing details
        callback - the callback to be performed
        Returns:
        false if the processing is not done true if we can shortcut the visiting because we are done with everything
        Since:
        2.0
      • getFacesContext

        protected abstract FacesContext getFacesContext()
      • getStateHelper

        protected StateHelper getStateHelper()
      • getStateHelper

        protected StateHelper getStateHelper​(boolean create)
        returns a delta state saving enabled state helper for the current component
        Parameters:
        create - if true a state helper is created if not already existing
        Returns:
        an implementation of the StateHelper interface or null if none exists and create is set to false
      • restoreTransientState

        public void restoreTransientState​(FacesContext context,
                                          Object state)
        Description copied from interface: TransientStateHolder

        Restore the "transient state" using the object passed as state.

        If the state argument is null clear any previous transient state if any and return.

        Specified by:
        restoreTransientState in interface TransientStateHolder
        state - the object containing transient values
      • popComponentFromEL

        public void popComponentFromEL​(FacesContext context)
      • getFacetCount

        public int getFacetCount()
        Since:
        1.2