public interface FacesBean
Modifier and Type | Interface and Description |
---|---|
static class |
FacesBean.Type
Type of a FacesBean, encapsulating the set of registered
PropertyKeys.
|
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.
|
void |
clearInitialState()
Reset to a non-delta tracking state.
|
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)
Deprecated.
|
javax.el.ValueExpression |
getValueExpression(PropertyKey key)
Return the value expression for a key.
|
boolean |
initialStateMarked() |
Set<PropertyKey> |
keySet()
Returns a Set of all PropertyKeys that have either lists
or values attached.
|
void |
markInitialState()
use a delta tracking state going forward
|
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)
Deprecated.
|
void |
setValueExpression(PropertyKey key,
javax.el.ValueExpression expression)
Set the value expression for a key.
|
FacesBean.Type getType()
Object getProperty(PropertyKey key)
key
- the property keyIllegalArgumentException
- if key is a list keyvoid setProperty(PropertyKey key, Object value)
IllegalArgumentException
- if key is a list keyObject getLocalProperty(PropertyKey key)
IllegalArgumentException
- if key is a list keyjavax.el.ValueExpression getValueExpression(PropertyKey key)
IllegalArgumentException
- if the property does
not support value bindings.javax.faces.el.ValueBinding getValueBinding(PropertyKey key)
IllegalArgumentException
- if the property does
not support value bindings.Object getRawProperty(PropertyKey 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 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.
key
- the parameter key of the raw property value to get.ValueExpression
object if the specified key
supports expressions and an expression was specified for that
property, null
otherwise.IllegalArgumentException
- if the specified key is a list key.getLocalProperty(PropertyKey)
,
getValueBinding(PropertyKey)
,
getValueExpression(PropertyKey)
void setValueExpression(PropertyKey key, javax.el.ValueExpression expression)
IllegalArgumentException
- if the property does
not support value expressions.void setValueBinding(PropertyKey key, javax.faces.el.ValueBinding binding)
IllegalArgumentException
- if the property does
not support value bindings.void addEntry(PropertyKey listKey, Object value)
IllegalArgumentException
- if the key is not a list key.void removeEntry(PropertyKey listKey, Object value)
IllegalArgumentException
- if the key is not a list key.Object[] getEntries(PropertyKey listKey, Class<?> clazz)
IllegalArgumentException
- if the key is not a list key.boolean containsEntry(PropertyKey listKey, Class<?> clazz)
IllegalArgumentException
- if the key is not a list key.Iterator<? extends Object> entries(PropertyKey listKey)
IllegalArgumentException
- if the key is not a list key.void addAll(FacesBean from)
Set<PropertyKey> keySet()
Set<PropertyKey> bindingKeySet()
void markInitialState()
boolean initialStateMarked()
void clearInitialState()
Object saveState(javax.faces.context.FacesContext context)
void restoreState(javax.faces.context.FacesContext context, Object state)
Copyright © 2001-2017 The Apache Software Foundation. All Rights Reserved.