org.richfaces.component

## Class UIDataAdaptor

- java.lang.Object
- - javax.faces.component.UIComponent
  - - javax.faces.component.UIComponentBase
    - - org.richfaces.component.UIDataAdaptor

- All Implemented Interfaces:
    EventListener, javax.faces.component.NamingContainer, javax.faces.component.PartialStateHolder, javax.faces.component.StateHolder, javax.faces.component.TransientStateHolder, javax.faces.component.UniqueIdVendor, javax.faces.event.ComponentSystemEventListener, javax.faces.event.FacesListener, javax.faces.event.SystemEventListener, javax.faces.event.SystemEventListenerHolder, IterationStateHolder
  Direct Known Subclasses:
    AbstractTree, UISequence

      public abstract class UIDataAdaptor
      extends javax.faces.component.UIComponentBase
      implements javax.faces.component.NamingContainer, javax.faces.component.UniqueIdVendor, IterationStateHolder, javax.faces.event.ComponentSystemEventListener, javax.faces.event.SystemEventListener

  Base class for iterable components, like dataTable, Tomahawk dataList, Facelets repeat, tree etc., with support for partial rendering on AJAX responces for one or more selected iterations.
  Author:
    shura, Lukas Fryc

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected class` | `UIDataAdaptor.ComponentVisitor` Base class for visit data model at phases decode, validation and update model

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `COMPONENT_FAMILY` The standard component family for this component.
    `static String` | `COMPONENT_TYPE` The standard component type for this component.
    `protected UIDataAdaptor.ComponentVisitor` | `decodeVisitor` Visitor for process decode on children components.
    `protected UIDataAdaptor.ComponentVisitor` | `updateVisitor` Visitor for process update model phase.
    `protected UIDataAdaptor.ComponentVisitor` | `validateVisitor` Visitor for process validation phase

    - ### Fields inherited from class javax.faces.component.UIComponent

      `ATTRS_WITH_DECLARED_DEFAULT_VALUES, BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, HONOR_CURRENT_COMPONENT_ATTRIBUTES_PARAM_NAME, VIEW_LOCATION_KEY`

    - ### Fields inherited from interface javax.faces.component.NamingContainer

      `SEPARATOR_CHAR`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UIDataAdaptor()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Iterator<javax.faces.component.UIComponent>` | `allFixedChildren()`
    `void` | `broadcast(javax.faces.event.FacesEvent event)`
    `void` | `captureOrigValue(javax.faces.context.FacesContext faces)` Save current state of data variable.
    `void` | `clearExtendedDataModel()`
    `void` | `clearInitialState()`
    `protected abstract DataComponentState` | `createComponentState()`
    `protected abstract ExtendedDataModel<?>` | `createExtendedDataModel()`
    `String` | `createUniqueId(javax.faces.context.FacesContext context, String seed)`
    `protected Iterator<javax.faces.component.UIComponent>` | `dataChildren()`
    `protected void` | `doUpdate()`
    `protected String` | `extractKeySegment(javax.faces.context.FacesContext context, String substring)`
    `protected Iterator<javax.faces.component.UIComponent>` | `fixedChildren()`
    `DataComponentState` | `getComponentState()`
    `String` | `getContainerClientId()`
    `String` | `getContainerClientId(javax.faces.context.FacesContext facesContext)`
    `protected ExtendedDataModel<?>` | `getExtendedDataModel()`
    `String` | `getFamily()`
    `Object` | `getIterationState()` Get component state for a current iteration.
    `protected DataComponentState` | `getLocalComponentState()`
    `int` | `getRowCount()`
    `Object` | `getRowData()`
    `Object` | `getRowKey()` The attribute provides access to a row key in a Request scope
    `javax.faces.convert.Converter` | `getRowKeyConverter()`
    `String` | `getRowKeyVar()`
    `String` | `getStateVar()` The attribute provides access to a component state on the client side
    `String` | `getVar()`
    `protected Map<String,Object>` | `getVariablesMap(javax.faces.context.FacesContext facesContext)`
    `boolean` | `invokeOnComponent(javax.faces.context.FacesContext context, String clientId, javax.faces.component.ContextCallback callback)`
    `boolean` | `invokeOnRow(javax.faces.context.FacesContext context, String clientId, javax.faces.component.ContextCallback callback)`
    `boolean` | `isKeepSaved()` Boolean attribute that defines whether this iteration component will reset saved children's state before rendering.
    `boolean` | `isListenerForSource(Object source)`
    `boolean` | `isRowAvailable()`
    `protected void` | `iterate(javax.faces.context.FacesContext faces, UIDataAdaptor.ComponentVisitor visitor)` Perform iteration on all children components and all data rows with given visitor.
    `protected boolean` | `keepSaved(javax.faces.context.FacesContext context)` Check for validation errors on children components.
    `void` | `markInitialState()`
    `protected boolean` | `matchesBaseId(String clientId, String baseId, char separatorChar)`
    `protected void` | `preDecode(javax.faces.context.FacesContext context)`
    `protected void` | `preEncodeBegin(javax.faces.context.FacesContext context)`
    `protected void` | `preUpdate(javax.faces.context.FacesContext context)`
    `protected void` | `preValidate(javax.faces.context.FacesContext context)`
    `void` | `processDecodes(javax.faces.context.FacesContext faces)`
    `protected void` | `processDecodesChildren(javax.faces.context.FacesContext faces)`
    `void` | `processEvent(javax.faces.event.ComponentSystemEvent event)`
    `void` | `processEvent(javax.faces.event.SystemEvent event)`
    `void` | `processUpdates(javax.faces.context.FacesContext faces)`
    `protected void` | `processUpdatesChildren(javax.faces.context.FacesContext faces)`
    `protected void` | `processValidatesChildren(javax.faces.context.FacesContext faces)`
    `void` | `processValidators(javax.faces.context.FacesContext faces)`
    `void` | `queueEvent(javax.faces.event.FacesEvent event)`
    `protected void` | `resetChildState()`
    `protected void` | `resetDataModel()`
    `protected void` | `restoreChildState(javax.faces.context.FacesContext facesContext)`
    `protected void` | `restoreChildState(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component)` Restore values of `EditableValueHolder` fields after change current row.
    `void` | `restoreOrigValue(javax.faces.context.FacesContext faces)` Restore value of data variable after processing phase.
    `void` | `restoreState(javax.faces.context.FacesContext context, Object stateObject)`
    `protected void` | `saveChildState(javax.faces.context.FacesContext facesContext)` Save values of `EditableValueHolder` fields before change current row.
    `protected void` | `saveChildState(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component)`
    `Object` | `saveState(javax.faces.context.FacesContext context)`
    `protected void` | `setExtendedDataModel(ExtendedDataModel<?> extendedDataModel)`
    `void` | `setId(String id)`
    `void` | `setIterationState(Object stateObject)` Set component state for the next iteration.
    `void` | `setKeepSaved(boolean keepSaved)`
    `void` | `setRowKey(javax.faces.context.FacesContext facesContext, Object rowKey)` Setup current row by key.
    `void` | `setRowKey(Object rowKey)`
    `void` | `setRowKeyConverter(javax.faces.convert.Converter converter)`
    `void` | `setRowKeyVar(String rowKeyVar)`
    `void` | `setStateVar(String stateVar)`
    `protected void` | `setupVariable(javax.faces.context.FacesContext faces, boolean rowSelected)` Setup EL variable for different iteration.
    `void` | `setValueExpression(String name, javax.el.ValueExpression binding)`
    `void` | `setVar(String var)`
    `protected boolean` | `visitDataChildren(javax.faces.component.visit.VisitContext visitContext, javax.faces.component.visit.VisitCallback callback, boolean visitRows)`
    `protected javax.faces.component.visit.VisitResult` | `visitDataChildrenMetaComponents(ExtendedVisitContext extendedVisitContext, javax.faces.component.visit.VisitCallback callback)`
    `protected boolean` | `visitFixedChildren(javax.faces.component.visit.VisitContext visitContext, javax.faces.component.visit.VisitCallback callback)`
    `boolean` | `visitTree(javax.faces.component.visit.VisitContext visitContext, javax.faces.component.visit.VisitCallback callback)`
    `void` | `walk(javax.faces.context.FacesContext faces, DataVisitor visitor, Object argument)` Walk ( visit ) this component on all data-aware children for each row.
    `protected javax.faces.event.FacesEvent` | `wrapEvent(javax.faces.event.FacesEvent event)`

    - ### Methods inherited from class javax.faces.component.UIComponentBase

      `addClientBehavior, addFacesListener, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getListenersForEventClass, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setParent, setRendered, setRendererType, setTransient, setValueBinding, subscribeToEvent, unsubscribeFromEvent`

    - ### Methods inherited from class javax.faces.component.UIComponent

      `encodeAll, getClientId, getCompositeComponentParent, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, pushComponentToEL, restoreTransientState, saveTransientState, setInView`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### COMPONENT_FAMILY

          public static final String COMPONENT_FAMILY

      The standard component family for this component.

      See Also:
        Constant Field Values

    - #### COMPONENT_TYPE

          public static final String COMPONENT_TYPE

      The standard component type for this component.

      See Also:
        Constant Field Values

    - #### decodeVisitor

          protected UIDataAdaptor.ComponentVisitor decodeVisitor

      Visitor for process decode on children components.

    - #### validateVisitor

          protected UIDataAdaptor.ComponentVisitor validateVisitor

      Visitor for process validation phase

    - #### updateVisitor

          protected UIDataAdaptor.ComponentVisitor updateVisitor

      Visitor for process update model phase.

  - ### Constructor Detail

    - #### UIDataAdaptor

          public UIDataAdaptor()

  - ### Method Detail

    - #### getVariablesMap

          protected Map<String,Object> getVariablesMap(javax.faces.context.FacesContext facesContext)

    - #### getFamily

          public String getFamily()

      Specified by:
        `getFamily` in class `javax.faces.component.UIComponent`

    - #### createUniqueId

          public String createUniqueId(javax.faces.context.FacesContext context,
                                       String seed)

      Specified by:
        `createUniqueId` in interface `javax.faces.component.UniqueIdVendor`

    - #### getRowKey

          public Object getRowKey()

      The attribute provides access to a row key in a Request scope

    - #### setRowKey

          public void setRowKey(javax.faces.context.FacesContext facesContext,
                                Object rowKey)

      Setup current row by key. Perform same functionality as `UIData.setRowIndex(int)`, but for key object - it may be not only row number in sequence data, but, for example - path to current node in tree.
      Parameters:
        `facesContext` - - current FacesContext
        `rowKey` - new key value.

    - #### saveChildState

          protected void saveChildState(javax.faces.context.FacesContext facesContext)

      Save values of `EditableValueHolder` fields before change current row.
      Parameters:
        `facesContext` -

    - #### saveChildState

          protected void saveChildState(javax.faces.context.FacesContext facesContext,
                                        javax.faces.component.UIComponent component)

      Parameters:
        `facesContext` -

    - #### dataChildren

          protected Iterator<javax.faces.component.UIComponent> dataChildren()

    - #### fixedChildren

          protected Iterator<javax.faces.component.UIComponent> fixedChildren()

    - #### allFixedChildren

          protected Iterator<javax.faces.component.UIComponent> allFixedChildren()

    - #### restoreChildState

          protected void restoreChildState(javax.faces.context.FacesContext facesContext)

      Parameters:
        `facesContext` -

    - #### restoreChildState

          protected void restoreChildState(javax.faces.context.FacesContext facesContext,
                                           javax.faces.component.UIComponent component)

      Restore values of `EditableValueHolder` fields after change current row.
      Parameters:
        `facesContext` -

    - #### setRowKey

          public void setRowKey(Object rowKey)

    - #### wrapEvent

          protected javax.faces.event.FacesEvent wrapEvent(javax.faces.event.FacesEvent event)

    - #### queueEvent

          public void queueEvent(javax.faces.event.FacesEvent event)

      Overrides:
        `queueEvent` in class `javax.faces.component.UIComponentBase`

    - #### broadcast

          public void broadcast(javax.faces.event.FacesEvent event)
                         throws javax.faces.event.AbortProcessingException

      Overrides:
        `broadcast` in class `javax.faces.component.UIComponentBase`
      Throws:
        `javax.faces.event.AbortProcessingException`

    - #### getExtendedDataModel

          protected ExtendedDataModel<?> getExtendedDataModel()

      Returns:
        the extendedDataModel

    - #### createExtendedDataModel

          protected abstract ExtendedDataModel<?> createExtendedDataModel()

    - #### clearExtendedDataModel

          public void clearExtendedDataModel()

    - #### setExtendedDataModel

          protected void setExtendedDataModel(ExtendedDataModel<?> extendedDataModel)

      Parameters:
        `extendedDataModel` - the extendedDataModel to set

    - #### getVar

          public String getVar()

    - #### setVar

          public void setVar(String var)

    - #### getRowKeyVar

          public String getRowKeyVar()

    - #### setRowKeyVar

          public void setRowKeyVar(String rowKeyVar)

    - #### getStateVar

          public String getStateVar()

      The attribute provides access to a component state on the client side

    - #### setStateVar

          public void setStateVar(String stateVar)

    - #### getRowCount

          public int getRowCount()

    - #### getRowData

          public Object getRowData()

    - #### isRowAvailable

          public boolean isRowAvailable()

    - #### isKeepSaved

          public boolean isKeepSaved()

      Boolean attribute that defines whether this iteration component will reset saved children's state before rendering. By default state is reset if there are no faces messages with severity error or higher.

    - #### setKeepSaved

          public void setKeepSaved(boolean keepSaved)

    - #### setupVariable

          protected void setupVariable(javax.faces.context.FacesContext faces,
                                       boolean rowSelected)

      Setup EL variable for different iteration. Value of row data and component state will be put into request scope attributes with names given by "var" and "varState" bean properties.

      Changed: does not check for row availability now
      Parameters:
        `faces` - current faces context
        `rowSelected` -

    - #### getComponentState

          public DataComponentState getComponentState()

    - #### createComponentState

          protected abstract DataComponentState createComponentState()

    - #### getRowKeyConverter

          public javax.faces.convert.Converter getRowKeyConverter()

    - #### setRowKeyConverter

          public void setRowKeyConverter(javax.faces.convert.Converter converter)

    - #### getContainerClientId

          public String getContainerClientId()

    - #### getContainerClientId

          public String getContainerClientId(javax.faces.context.FacesContext facesContext)

      Overrides:
        `getContainerClientId` in class `javax.faces.component.UIComponent`

    - #### captureOrigValue

          public void captureOrigValue(javax.faces.context.FacesContext faces)

      Save current state of data variable.
      Parameters:
        `faces` - current faces context

    - #### restoreOrigValue

          public void restoreOrigValue(javax.faces.context.FacesContext faces)

      Restore value of data variable after processing phase.
      Parameters:
        `faces` - current faces context

    - #### setValueExpression

          public void setValueExpression(String name,
                                         javax.el.ValueExpression binding)

      Overrides:
        `setValueExpression` in class `javax.faces.component.UIComponent`

    - #### keepSaved

          protected boolean keepSaved(javax.faces.context.FacesContext context)

      Check for validation errors on children components. If true, saved values must be keep on render phase

      (State is reset if there are no faces messages with severity error or higher.)

      Returns:
        true if there are faces messages with severity error or higher

    - #### iterate

          protected void iterate(javax.faces.context.FacesContext faces,
                                 UIDataAdaptor.ComponentVisitor visitor)

      Perform iteration on all children components and all data rows with given visitor.
      Parameters:
        `faces` -
        `visitor` -

    - #### walk

          public void walk(javax.faces.context.FacesContext faces,
                           DataVisitor visitor,
                           Object argument)

      Walk ( visit ) this component on all data-aware children for each row.
      Parameters:
        `faces` -
        `visitor` -

    - #### processDecodes

          public void processDecodes(javax.faces.context.FacesContext faces)

      Overrides:
        `processDecodes` in class `javax.faces.component.UIComponentBase`

    - #### processValidators

          public void processValidators(javax.faces.context.FacesContext faces)

      Overrides:
        `processValidators` in class `javax.faces.component.UIComponentBase`

    - #### processUpdates

          public void processUpdates(javax.faces.context.FacesContext faces)

      Overrides:
        `processUpdates` in class `javax.faces.component.UIComponentBase`

    - #### doUpdate

          protected void doUpdate()

    - #### processDecodesChildren

          protected void processDecodesChildren(javax.faces.context.FacesContext faces)

    - #### processValidatesChildren

          protected void processValidatesChildren(javax.faces.context.FacesContext faces)

    - #### processUpdatesChildren

          protected void processUpdatesChildren(javax.faces.context.FacesContext faces)

    - #### setId

          public void setId(String id)

      Overrides:
        `setId` in class `javax.faces.component.UIComponentBase`

    - #### getIterationState

          public Object getIterationState()

      Description copied from interface: `IterationStateHolder`
      Get component state for a current iteration.
      Specified by:
        `getIterationState` in interface `IterationStateHolder`
      Returns:
        request-scope component state. Details are subject for a component implementation

    - #### setIterationState

          public void setIterationState(Object stateObject)

      Description copied from interface: `IterationStateHolder`
      Set component state for the next iteration. State can be either previously saved iteration state or `null` value. In the second case component should reset its state to the initial.
      Specified by:
        `setIterationState` in interface `IterationStateHolder`
      Parameters:
        `stateObject` - request-scope component state or `null`. Details are subject for a component implementation

    - #### resetDataModel

          protected void resetDataModel()

    - #### resetChildState

          protected void resetChildState()

    - #### preDecode

          protected void preDecode(javax.faces.context.FacesContext context)

    - #### preValidate

          protected void preValidate(javax.faces.context.FacesContext context)

    - #### preUpdate

          protected void preUpdate(javax.faces.context.FacesContext context)

    - #### preEncodeBegin

          protected void preEncodeBegin(javax.faces.context.FacesContext context)

    - #### markInitialState

          public void markInitialState()

      Specified by:
        `markInitialState` in interface `javax.faces.component.PartialStateHolder`
      Overrides:
        `markInitialState` in class `javax.faces.component.UIComponentBase`

    - #### clearInitialState

          public void clearInitialState()

      Specified by:
        `clearInitialState` in interface `javax.faces.component.PartialStateHolder`
      Overrides:
        `clearInitialState` in class `javax.faces.component.UIComponentBase`

    - #### saveState

          public Object saveState(javax.faces.context.FacesContext context)

      Specified by:
        `saveState` in interface `javax.faces.component.StateHolder`
      Overrides:
        `saveState` in class `javax.faces.component.UIComponentBase`

    - #### restoreState

          public void restoreState(javax.faces.context.FacesContext context,
                                   Object stateObject)

      Specified by:
        `restoreState` in interface `javax.faces.component.StateHolder`
      Overrides:
        `restoreState` in class `javax.faces.component.UIComponentBase`

    - #### matchesBaseId

          protected boolean matchesBaseId(String clientId,
                                          String baseId,
                                          char separatorChar)

    - #### invokeOnComponent

          public boolean invokeOnComponent(javax.faces.context.FacesContext context,
                                           String clientId,
                                           javax.faces.component.ContextCallback callback)
                                    throws javax.faces.FacesException

      Overrides:
        `invokeOnComponent` in class `javax.faces.component.UIComponentBase`
      Throws:
        `javax.faces.FacesException`

    - #### invokeOnRow

          public boolean invokeOnRow(javax.faces.context.FacesContext context,
                                     String clientId,
                                     javax.faces.component.ContextCallback callback)

    - #### visitFixedChildren

          protected boolean visitFixedChildren(javax.faces.component.visit.VisitContext visitContext,
                                               javax.faces.component.visit.VisitCallback callback)

    - #### visitDataChildrenMetaComponents

          protected javax.faces.component.visit.VisitResult visitDataChildrenMetaComponents(ExtendedVisitContext extendedVisitContext,
                                                                                            javax.faces.component.visit.VisitCallback callback)

    - #### visitDataChildren

          protected boolean visitDataChildren(javax.faces.component.visit.VisitContext visitContext,
                                              javax.faces.component.visit.VisitCallback callback,
                                              boolean visitRows)

    - #### visitTree

          public boolean visitTree(javax.faces.component.visit.VisitContext visitContext,
                                   javax.faces.component.visit.VisitCallback callback)

      Overrides:
        `visitTree` in class `javax.faces.component.UIComponent`

    - #### extractKeySegment

          protected String extractKeySegment(javax.faces.context.FacesContext context,
                                             String substring)

      Parameters:
        `context` -
        `substring` -

    - #### processEvent

          public void processEvent(javax.faces.event.ComponentSystemEvent event)
                            throws javax.faces.event.AbortProcessingException

      Specified by:
        `processEvent` in interface `javax.faces.event.ComponentSystemEventListener`
      Overrides:
        `processEvent` in class `javax.faces.component.UIComponent`
      Throws:
        `javax.faces.event.AbortProcessingException`

    - #### processEvent

          public void processEvent(javax.faces.event.SystemEvent event)
                            throws javax.faces.event.AbortProcessingException

      Specified by:
        `processEvent` in interface `javax.faces.event.SystemEventListener`
      Throws:
        `javax.faces.event.AbortProcessingException`

    - #### isListenerForSource

          public boolean isListenerForSource(Object source)

      Specified by:
        `isListenerForSource` in interface `javax.faces.event.SystemEventListener`

    - #### getLocalComponentState

          protected DataComponentState getLocalComponentState()

Copyright © 2016 JBoss by Red Hat. All Rights Reserved.