org.apache.myfaces.trinidad.component

## Class FacesBeanWrapper

- java.lang.Object
- - org.apache.myfaces.trinidad.component.FacesBeanWrapper

- All Implemented Interfaces:
    FacesBean

      public class FacesBeanWrapper
      extends Object
      implements FacesBean

  Wrapper for `FacesBean`

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.myfaces.trinidad.bean.FacesBean

      `FacesBean.Type`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `FacesBeanWrapper(FacesBean beanToWrap)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAll(FacesBean from)` Copies all properties, bindings, and list entries from one bean to another.
    `void` | `addEntry(PropertyKey listKey, Object value)` Add an entry to a list.
    `Set<PropertyKey>` | `bindingKeySet()` Returns a Set of all PropertyKeys that have ValueBindings attached.
    `boolean` | `containsEntry(PropertyKey listKey, Class<?> clazz)` Return true if at least one element of the list identified by this key is an instance of the specified class.
    `Iterator<? extends Object>` | `entries(PropertyKey listKey)` Returns an iterator over all entries at this key.
    `Object[]` | `getEntries(PropertyKey listKey, Class<?> clazz)` Return as an array all elements of this key that are instances of the specified class.
    `Object` | `getLocalProperty(PropertyKey key)` Return a property, ignoring any value bindings.
    `Object` | `getProperty(PropertyKey key)` Returns a property.
    `Object` | `getRawProperty(PropertyKey key)` Gets the current unevaluated value for the specified property key.
    `FacesBean.Type` | `getType()` Returns the Type of this bean.
    `javax.faces.el.ValueBinding` | `getValueBinding(PropertyKey key)` Return the value binding for a key.
    `javax.el.ValueExpression` | `getValueExpression(PropertyKey key)` Return the value expression for a key.
    `FacesBean` | `getWrappedBean()`
    `Set<PropertyKey>` | `keySet()` Returns a Set of all PropertyKeys that have either lists or values attached.
    `void` | `markInitialState()`
    `void` | `removeEntry(PropertyKey listKey, Object value)` Remove an entry from a list.
    `void` | `restoreState(javax.faces.context.FacesContext context, Object state)` Restores the state of a FacesBean.
    `Object` | `saveState(javax.faces.context.FacesContext context)` Saves the state of a FacesBean.
    `void` | `setProperty(PropertyKey key, Object value)` Set a property.
    `void` | `setValueBinding(PropertyKey key, javax.faces.el.ValueBinding binding)` Set the value binding for a key.
    `void` | `setValueExpression(PropertyKey key, javax.el.ValueExpression expression)` Set the value expression for a key.

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

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

- - ### Constructor Detail

    - #### FacesBeanWrapper

          protected FacesBeanWrapper(FacesBean beanToWrap)

  - ### Method Detail

    - #### getWrappedBean

          public FacesBean getWrappedBean()

    - #### getType

          public FacesBean.Type getType()

      Description copied from interface: `FacesBean`
      Returns the Type of this bean.
      Specified by:
        `getType` in interface `FacesBean`

    - #### getProperty

          public Object getProperty(PropertyKey key)

      Description copied from interface: `FacesBean`
      Returns a property. If the property has not been explicitly set, and the key supports bindings, and a ValueBinding has been set for this key, that ValueBinding will be evaluated.
      Specified by:
        `getProperty` in interface `FacesBean`
      Parameters:
        `key` - the property key

    - #### setProperty

          public void setProperty(PropertyKey key,
                         Object value)

      Description copied from interface: `FacesBean`
      Set a property.
      Specified by:
        `setProperty` in interface `FacesBean`

    - #### getLocalProperty

          public Object getLocalProperty(PropertyKey key)

      Description copied from interface: `FacesBean`
      Return a property, ignoring any value bindings.
      Specified by:
        `getLocalProperty` in interface `FacesBean`

    - #### getValueExpression

          public javax.el.ValueExpression getValueExpression(PropertyKey key)

      Description copied from interface: `FacesBean`
      Return the value expression for a key.
      Specified by:
        `getValueExpression` in interface `FacesBean`

    - #### getValueBinding

          public javax.faces.el.ValueBinding getValueBinding(PropertyKey key)

      Description copied from interface: `FacesBean`
      Return the value binding for a key.
      Specified by:
        `getValueBinding` in interface `FacesBean`

    - #### getRawProperty

          public Object getRawProperty(PropertyKey key)

      Description copied from interface: `FacesBean`
      Gets the current unevaluated value for the specified property key.

      The method will first look for a local value. If it exists, it will be returned. If it does not and the bean supports value expressions, the method will look for an expression with the specified key and return it directly if it exists without evaluatig its value.

      This method is mainly used when:

      - The caller cannot ensure that FacesContext exists at the time of the call
      - The FacesContext does not yet contains the managed bean referenced by the value binding
      - The managed bean referenced by the value binding is not yet in a coherent state to evaluate the expression

      The most common use case of this method is for message attributes set on converters and validators using a value binding referencing a managed bean created by `<f:loadBundle/>`. Since loadBundle only creates its bean during the render response phase while converter and validators take action during process validation phase, the message property's value binding must be stored in a special `FacesMessage` implementation that will evaluate the binding only during render response.``

      Specified by:
        `getRawProperty` in interface `FacesBean`
      Parameters:
        `key` - the parameter key of the raw property value to get.
      Returns:
        the local value of the specified key if it exists, a `ValueExpression` object if the specified key supports expressions and an expression was specified for that property, `null` otherwise.
      See Also:
        `FacesBean.getLocalProperty(PropertyKey)`, `FacesBean.getValueBinding(PropertyKey)`, `FacesBean.getValueExpression(PropertyKey)`

    - #### setValueExpression

          public void setValueExpression(PropertyKey key,
                                javax.el.ValueExpression expression)

      Description copied from interface: `FacesBean`
      Set the value expression for a key.
      Specified by:
        `setValueExpression` in interface `FacesBean`

    - #### setValueBinding

          public void setValueBinding(PropertyKey key,
                             javax.faces.el.ValueBinding binding)

      Description copied from interface: `FacesBean`
      Set the value binding for a key.
      Specified by:
        `setValueBinding` in interface `FacesBean`

    - #### addEntry

          public void addEntry(PropertyKey listKey,
                      Object value)

      Description copied from interface: `FacesBean`
      Add an entry to a list. The same value may be added repeatedly; null is also a legal value. (Consumers of this API can apply more stringent rules to specific keys in cover functions.)
      Specified by:
        `addEntry` in interface `FacesBean`

    - #### removeEntry

          public void removeEntry(PropertyKey listKey,
                         Object value)

      Description copied from interface: `FacesBean`
      Remove an entry from a list.
      Specified by:
        `removeEntry` in interface `FacesBean`

    - #### getEntries

          public Object[] getEntries(PropertyKey listKey,
                            Class<?> clazz)

      Description copied from interface: `FacesBean`
      Return as an array all elements of this key that are instances of the specified class.
      Specified by:
        `getEntries` in interface `FacesBean`
      Returns:
        an array whose instance type is the class

    - #### containsEntry

          public boolean containsEntry(PropertyKey listKey,
                              Class<?> clazz)

      Description copied from interface: `FacesBean`
      Return true if at least one element of the list identified by this key is an instance of the specified class.
      Specified by:
        `containsEntry` in interface `FacesBean`

    - #### entries

          public Iterator<? extends Object> entries(PropertyKey listKey)

      Description copied from interface: `FacesBean`
      Returns an iterator over all entries at this key.
      Specified by:
        `entries` in interface `FacesBean`

    - #### addAll

          public void addAll(FacesBean from)

      Description copied from interface: `FacesBean`
      Copies all properties, bindings, and list entries from one bean to another. If the beans are of different types, properties will be copied by name. Incompatible properties will be ignored; specifically, properties that are lists on only one of the beans or ValueBindings on the original bean that are not allowed on the target bean.
      Specified by:
        `addAll` in interface `FacesBean`

    - #### keySet

          public Set<PropertyKey> keySet()

      Description copied from interface: `FacesBean`
      Returns a Set of all PropertyKeys that have either lists or values attached.
      Specified by:
        `keySet` in interface `FacesBean`

    - #### bindingKeySet

          public Set<PropertyKey> bindingKeySet()

      Description copied from interface: `FacesBean`
      Returns a Set of all PropertyKeys that have ValueBindings attached.
      Specified by:
        `bindingKeySet` in interface `FacesBean`

    - #### markInitialState

          public void markInitialState()

      Specified by:
        `markInitialState` in interface `FacesBean`

    - #### saveState

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

      Description copied from interface: `FacesBean`
      Saves the state of a FacesBean.
      Specified by:
        `saveState` in interface `FacesBean`

    - #### restoreState

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

      Description copied from interface: `FacesBean`
      Restores the state of a FacesBean.
      Specified by:
        `restoreState` in interface `FacesBean`

Copyright © 2001-2016 The Apache Software Foundation. All Rights Reserved.