public abstract class UIXComponentBase extends UIXComponent
UIXComponentBase differs from UIXComponent most particularly in its use of FacesBeans to store all state. This offers a number of advantages:
Modifier and Type | Field and Description |
---|---|
static PropertyKey |
BINDING_KEY |
static PropertyKey |
ID_KEY |
static PropertyKey |
RENDERED_KEY |
static PropertyKey |
RENDERER_TYPE_KEY |
static PropertyKey |
TRANSIENT_KEY |
static FacesBean.Type |
TYPE |
Constructor and Description |
---|
UIXComponentBase() |
UIXComponentBase(String rendererType) |
Modifier and Type | Method and Description |
---|---|
static javax.el.MethodExpression |
adaptMethodBinding(javax.faces.el.MethodBinding binding)
Given a MethodBinding, create a MethodExpression that
adapts it.
|
protected void |
addAttributeChange(String attributeName,
Object attributeValue) |
void |
addAttributeChangeListener(AttributeChangeListener acl)
Adds an AttributeChangeListener.
|
protected void |
addFacesListener(javax.faces.event.FacesListener listener) |
void |
broadcast(javax.faces.event.FacesEvent event) |
protected void |
broadcastToMethodBinding(javax.faces.event.FacesEvent event,
javax.faces.el.MethodBinding method)
Deprecated.
|
protected void |
broadcastToMethodExpression(javax.faces.event.FacesEvent event,
javax.el.MethodExpression method)
Broadcast an event to a MethodExpression.
|
protected FacesBean |
createFacesBean(String rendererType) |
void |
decode(javax.faces.context.FacesContext context) |
protected void |
decodeChildren(javax.faces.context.FacesContext context)
Delegates to LifecycleRenderer, if present,
otherwise calls decodeChildrenImpl.
|
protected void |
decodeChildrenImpl(javax.faces.context.FacesContext context)
Calls processDecodes on all facets and children of this
component.
|
void |
encodeBegin(javax.faces.context.FacesContext context) |
void |
encodeChildren(javax.faces.context.FacesContext context) |
void |
encodeEnd(javax.faces.context.FacesContext context) |
javax.faces.component.UIComponent |
findComponent(String id) |
javax.el.MethodExpression |
getAttributeChangeListener()
Gets the method binding to an AttributeChangeListener.
|
AttributeChangeListener[] |
getAttributeChangeListeners()
Gets the registered AttributeChangeListeners.
|
Map<String,Object> |
getAttributes() |
protected FacesBean.Type |
getBeanType() |
protected boolean |
getBooleanProperty(PropertyKey key,
boolean defaultValue) |
int |
getChildCount() |
List<javax.faces.component.UIComponent> |
getChildren()
Create (if necessary) and return a List of the children associated
with this component.
|
String |
getClientId(javax.faces.context.FacesContext context) |
String |
getContainerClientId(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent child)
Provides additional context (the target child component for which the container
client ID is requested) to a naming container for constructing a client ID.
|
FacesBean |
getFacesBean()
Returns the FacesBean used for storing the component's state.
|
protected javax.faces.context.FacesContext |
getFacesContext()
Return the
FacesContext instance for the current request. |
protected javax.faces.event.FacesListener[] |
getFacesListeners(Class clazz) |
javax.faces.component.UIComponent |
getFacet(String facetName) |
int |
getFacetCount()
Return the number of facets.
|
Iterator<String> |
getFacetNames()
Returns an Iterator over the names of all facets.
|
Map<String,javax.faces.component.UIComponent> |
getFacets()
Create (if necessary) and return a Map of the facets associated
with this component.
|
Iterator<javax.faces.component.UIComponent> |
getFacetsAndChildren() |
abstract String |
getFamily() |
String |
getId()
Gets the identifier for the component.
|
protected int |
getIntProperty(PropertyKey key,
int defaultValue) |
protected LifecycleRenderer |
getLifecycleRenderer(javax.faces.context.FacesContext context) |
javax.faces.component.UIComponent |
getParent() |
protected Object |
getProperty(PropertyKey key) |
protected PropertyKey |
getPropertyKey(String name) |
protected javax.faces.render.Renderer |
getRenderer(javax.faces.context.FacesContext context) |
String |
getRendererType() |
boolean |
getRendersChildren() |
javax.faces.el.ValueBinding |
getValueBinding(String name) |
javax.el.ValueExpression |
getValueExpression(String name) |
protected boolean |
invokeOnChildrenComponents(javax.faces.context.FacesContext context,
String clientId,
javax.faces.component.ContextCallback callback)
Convenience method to call
invokeOnComponent on all of the
children of a component, surrounding the invocation with calls to
setup/tearDownChildrenVisitingContext . |
boolean |
invokeOnComponent(javax.faces.context.FacesContext context,
String clientId,
javax.faces.component.ContextCallback callback)
Override to calls the hooks for setting up and tearing down the
context before the children are visited.
|
protected boolean |
invokeOnNamingContainerComponent(javax.faces.context.FacesContext context,
String clientId,
javax.faces.component.ContextCallback callback)
Optimized implementation of
invokeOnComponent for NamingContainers. |
boolean |
isRendered() |
boolean |
isTransient() |
void |
markInitialState() |
void |
processDecodes(javax.faces.context.FacesContext context) |
void |
processRestoreState(javax.faces.context.FacesContext context,
Object state) |
Object |
processSaveState(javax.faces.context.FacesContext context) |
void |
processUpdates(javax.faces.context.FacesContext context) |
void |
processValidators(javax.faces.context.FacesContext context) |
void |
queueEvent(javax.faces.event.FacesEvent event) |
void |
removeAttributeChangeListener(AttributeChangeListener acl)
Removes an AttributeChangeListener.
|
protected void |
removeFacesListener(javax.faces.event.FacesListener listener) |
void |
restoreState(javax.faces.context.FacesContext facesContext,
Object stateObj) |
protected boolean |
satisfiesPartialTrigger(javax.faces.event.FacesEvent event)
Check if a faces event broadcast to this component should trigger the partial updates of the
target listeners of this component.
|
Object |
saveState(javax.faces.context.FacesContext context) |
void |
setAttributeChangeListener(javax.faces.el.MethodBinding mb)
Deprecated.
|
void |
setAttributeChangeListener(javax.el.MethodExpression mb)
Sets a method binding to an AttributeChangeListener.
|
protected void |
setBooleanProperty(PropertyKey key,
boolean value) |
void |
setId(String id)
Sets the identifier for the component.
|
protected void |
setIntProperty(PropertyKey key,
int value) |
void |
setParent(javax.faces.component.UIComponent parent)
Set the parent
UIComponent of this
UIComponent . |
protected void |
setProperty(PropertyKey key,
Object value) |
void |
setRendered(boolean rendered) |
void |
setRendererType(String rendererType) |
void |
setTransient(boolean newTransient) |
void |
setValueBinding(String name,
javax.faces.el.ValueBinding binding) |
void |
setValueExpression(String name,
javax.el.ValueExpression expression) |
String |
toString() |
protected void |
updateChildren(javax.faces.context.FacesContext context)
Delegates to LifecycleRenderer, if present,
otherwise calls upateChildrenImpl.
|
protected void |
updateChildrenImpl(javax.faces.context.FacesContext context) |
protected void |
validateChildren(javax.faces.context.FacesContext context)
Delegates to LifecycleRenderer, if present,
otherwise calls validateChildrenImpl.
|
protected void |
validateChildrenImpl(javax.faces.context.FacesContext context)
Calls processValidators on all facets and children of this
component.
|
addPartialTarget, clearCachedClientIds, clearCachedClientIds, encodeFlattenedChild, encodeFlattenedChildren, getLogicalParent, getLogicalParent, isVisitable, partialEncodeVisit, processFlattenedChildren, processFlattenedChildren, processFlattenedChildren, processFlattenedChildren, setPartialTarget, setupChildrenVisitingContext, setupEncodingContext, setUpEncodingContext, setupVisitingContext, tearDownChildrenVisitingContext, tearDownEncodingContext, tearDownVisitingContext, visitChildren, visitTree, visitTree
public static final FacesBean.Type TYPE
public static final PropertyKey ID_KEY
public static final PropertyKey RENDERED_KEY
public static final PropertyKey BINDING_KEY
public static final PropertyKey TRANSIENT_KEY
public static final PropertyKey RENDERER_TYPE_KEY
public UIXComponentBase()
public UIXComponentBase(String rendererType)
protected PropertyKey getPropertyKey(String name)
protected FacesBean.Type getBeanType()
public FacesBean getFacesBean()
UIXComponent
getFacesBean
in class UIXComponent
public String getContainerClientId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent child)
UIXComponent
getContainerClientId
in class UIXComponent
getClientId(FacesContext context)
public void addAttributeChangeListener(AttributeChangeListener acl)
UIXComponent
addAttributeChangeListener
in class UIXComponent
public void removeAttributeChangeListener(AttributeChangeListener acl)
UIXComponent
removeAttributeChangeListener
in class UIXComponent
public AttributeChangeListener[] getAttributeChangeListeners()
UIXComponent
getAttributeChangeListeners
in class UIXComponent
public void setAttributeChangeListener(javax.el.MethodExpression mb)
UIXComponent
setAttributeChangeListener
in class UIXComponent
@Deprecated public void setAttributeChangeListener(javax.faces.el.MethodBinding mb)
public javax.el.MethodExpression getAttributeChangeListener()
UIXComponent
getAttributeChangeListener
in class UIXComponent
public javax.el.ValueExpression getValueExpression(String name)
getValueExpression
in class javax.faces.component.UIComponent
public void setValueExpression(String name, javax.el.ValueExpression expression)
setValueExpression
in class javax.faces.component.UIComponent
public javax.faces.el.ValueBinding getValueBinding(String name)
getValueBinding
in class javax.faces.component.UIComponent
public void setValueBinding(String name, javax.faces.el.ValueBinding binding)
setValueBinding
in class javax.faces.component.UIComponent
public Map<String,Object> getAttributes()
getAttributes
in class javax.faces.component.UIComponent
public String getClientId(javax.faces.context.FacesContext context)
getClientId
in class javax.faces.component.UIComponent
public String getId()
getId
in class javax.faces.component.UIComponent
public void setId(String id)
setId
in class javax.faces.component.UIComponent
public abstract String getFamily()
getFamily
in class javax.faces.component.UIComponent
public javax.faces.component.UIComponent getParent()
getParent
in class javax.faces.component.UIComponent
public void setParent(javax.faces.component.UIComponent parent)
Set the parent UIComponent
of this
UIComponent
.
setParent
in class javax.faces.component.UIComponent
parent
- The new parent, or null
for the root node
of a component treepublic boolean isRendered()
isRendered
in class javax.faces.component.UIComponent
public void setRendered(boolean rendered)
setRendered
in class javax.faces.component.UIComponent
public boolean isTransient()
public void setTransient(boolean newTransient)
public String getRendererType()
getRendererType
in class javax.faces.component.UIComponent
public void setRendererType(String rendererType)
setRendererType
in class javax.faces.component.UIComponent
public boolean getRendersChildren()
getRendersChildren
in class javax.faces.component.UIComponent
public javax.faces.component.UIComponent findComponent(String id)
findComponent
in class javax.faces.component.UIComponent
public List<javax.faces.component.UIComponent> getChildren()
Create (if necessary) and return a List of the children associated with this component.
getChildren
in class javax.faces.component.UIComponent
public int getChildCount()
getChildCount
in class javax.faces.component.UIComponent
public Map<String,javax.faces.component.UIComponent> getFacets()
Create (if necessary) and return a Map of the facets associated with this component.
getFacets
in class javax.faces.component.UIComponent
public javax.faces.component.UIComponent getFacet(String facetName)
getFacet
in class javax.faces.component.UIComponent
public Iterator<String> getFacetNames()
public Iterator<javax.faces.component.UIComponent> getFacetsAndChildren()
getFacetsAndChildren
in class javax.faces.component.UIComponent
public void broadcast(javax.faces.event.FacesEvent event) throws javax.faces.event.AbortProcessingException
broadcast
in class javax.faces.component.UIComponent
javax.faces.event.AbortProcessingException
protected boolean satisfiesPartialTrigger(javax.faces.event.FacesEvent event)
event
- The event to checkpublic void decode(javax.faces.context.FacesContext context)
decode
in class javax.faces.component.UIComponent
public void encodeBegin(javax.faces.context.FacesContext context) throws IOException
encodeBegin
in class javax.faces.component.UIComponent
IOException
public void encodeChildren(javax.faces.context.FacesContext context) throws IOException
encodeChildren
in class javax.faces.component.UIComponent
IOException
public void encodeEnd(javax.faces.context.FacesContext context) throws IOException
encodeEnd
in class javax.faces.component.UIComponent
IOException
public void queueEvent(javax.faces.event.FacesEvent event)
queueEvent
in class javax.faces.component.UIComponent
public void processDecodes(javax.faces.context.FacesContext context)
processDecodes
in class javax.faces.component.UIComponent
public void processValidators(javax.faces.context.FacesContext context)
processValidators
in class javax.faces.component.UIComponent
public void processUpdates(javax.faces.context.FacesContext context)
processUpdates
in class javax.faces.component.UIComponent
public Object processSaveState(javax.faces.context.FacesContext context)
processSaveState
in class javax.faces.component.UIComponent
public void processRestoreState(javax.faces.context.FacesContext context, Object state)
processRestoreState
in class javax.faces.component.UIComponent
public void markInitialState()
markInitialState
in class UIXComponent
public Object saveState(javax.faces.context.FacesContext context)
public void restoreState(javax.faces.context.FacesContext facesContext, Object stateObj)
protected javax.faces.context.FacesContext getFacesContext()
Return the FacesContext
instance for the current request.
getFacesContext
in class javax.faces.component.UIComponent
protected final void decodeChildren(javax.faces.context.FacesContext context)
context
- the current FacesContextprotected void decodeChildrenImpl(javax.faces.context.FacesContext context)
context
- the current FacesContextprotected final void validateChildren(javax.faces.context.FacesContext context)
context
- the current FacesContextprotected void validateChildrenImpl(javax.faces.context.FacesContext context)
context
- the current FacesContextprotected final void updateChildren(javax.faces.context.FacesContext context)
context
- the current FacesContextprotected void updateChildrenImpl(javax.faces.context.FacesContext context)
protected void addFacesListener(javax.faces.event.FacesListener listener)
addFacesListener
in class javax.faces.component.UIComponent
protected void removeFacesListener(javax.faces.event.FacesListener listener)
removeFacesListener
in class javax.faces.component.UIComponent
protected javax.faces.event.FacesListener[] getFacesListeners(Class clazz)
getFacesListeners
in class javax.faces.component.UIComponent
protected javax.faces.render.Renderer getRenderer(javax.faces.context.FacesContext context)
getRenderer
in class javax.faces.component.UIComponent
protected LifecycleRenderer getLifecycleRenderer(javax.faces.context.FacesContext context)
protected void setProperty(PropertyKey key, Object value)
protected Object getProperty(PropertyKey key)
protected void setBooleanProperty(PropertyKey key, boolean value)
protected boolean getBooleanProperty(PropertyKey key, boolean defaultValue)
protected void setIntProperty(PropertyKey key, int value)
protected int getIntProperty(PropertyKey key, int defaultValue)
public int getFacetCount()
getFacetCount
in class javax.faces.component.UIComponent
protected final void broadcastToMethodBinding(javax.faces.event.FacesEvent event, javax.faces.el.MethodBinding method) throws javax.faces.event.AbortProcessingException
javax.faces.event.AbortProcessingException
public static javax.el.MethodExpression adaptMethodBinding(javax.faces.el.MethodBinding binding)
protected final void broadcastToMethodExpression(javax.faces.event.FacesEvent event, javax.el.MethodExpression method) throws javax.faces.event.AbortProcessingException
javax.faces.event.AbortProcessingException
protected final boolean invokeOnChildrenComponents(javax.faces.context.FacesContext context, String clientId, javax.faces.component.ContextCallback callback) throws javax.faces.FacesException
invokeOnComponent
on all of the
children of a component, surrounding the invocation with calls to
setup/tearDownChildrenVisitingContext
.
This is useful when a component sometimes optimizes
away calling invokeOnComponent
on its children.javax.faces.FacesException
UIXComponent.setupChildrenVisitingContext(javax.faces.context.FacesContext)
,
UIXComponent.tearDownChildrenVisitingContext(javax.faces.context.FacesContext)
protected final boolean invokeOnNamingContainerComponent(javax.faces.context.FacesContext context, String clientId, javax.faces.component.ContextCallback callback) throws javax.faces.FacesException
Optimized implementation of invokeOnComponent
for NamingContainers.
If the clientId isn't within the NamingContainer, invocation of the
NamingContainer's children is skipped.
Subclasses implementing NamingContainer should override
invokeOnComponent
and delegate to this method.
javax.faces.FacesException
public boolean invokeOnComponent(javax.faces.context.FacesContext context, String clientId, javax.faces.component.ContextCallback callback) throws javax.faces.FacesException
invokeOnComponent
in class javax.faces.component.UIComponent
javax.faces.FacesException
UIXComponent.setupVisitingContext(javax.faces.context.FacesContext)
,
UIXComponent.tearDownVisitingContext(javax.faces.context.FacesContext)
Copyright © 2001-2016 The Apache Software Foundation. All Rights Reserved.