|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.faces.component.UIComponent
org.apache.myfaces.trinidad.component.UIXComponent
org.apache.myfaces.trinidad.component.UIXComponentBase
public abstract class UIXComponentBase
Base implementation of components for all of Trinidad. UIXComponentBase offers a number of features not supplied by the standard UIComponentBase class:
UIXComponentBase differs from UIXComponent most particularly in its use of FacesBeans to store all state. This offers a number of advantages:
| Field Summary | |
|---|---|
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
|
| Fields inherited from class javax.faces.component.UIComponent |
|---|
bindings |
| Constructor Summary | |
|---|---|
UIXComponentBase()
|
|
UIXComponentBase(String rendererType)
|
|
| Method Summary | |
|---|---|
static MethodExpression |
adaptMethodBinding(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(FacesListener listener)
|
void |
broadcast(FacesEvent event)
|
protected void |
broadcastToMethodBinding(FacesEvent event,
MethodBinding method)
Deprecated. |
protected void |
broadcastToMethodExpression(FacesEvent event,
MethodExpression method)
Broadcast an event to a MethodExpression. |
protected FacesBean |
createFacesBean(String rendererType)
|
void |
decode(FacesContext context)
|
protected void |
decodeChildren(FacesContext context)
Delegates to LifecycleRenderer, if present, otherwise calls decodeChildrenImpl. |
protected void |
decodeChildrenImpl(FacesContext context)
Calls processDecodes on all facets and children of this component. |
void |
encodeBegin(FacesContext context)
|
void |
encodeChildren(FacesContext context)
|
void |
encodeEnd(FacesContext context)
|
UIComponent |
findComponent(String id)
|
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<UIComponent> |
getChildren()
Create (if necessary) and return a List of the children associated with this component. |
String |
getClientId(FacesContext context)
|
String |
getContainerClientId(FacesContext context,
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 FacesContext |
getFacesContext()
Return the FacesContext instance for the current request. |
protected FacesListener[] |
getFacesListeners(Class clazz)
|
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,UIComponent> |
getFacets()
Create (if necessary) and return a Map of the facets associated with this component. |
Iterator<UIComponent> |
getFacetsAndChildren()
|
abstract String |
getFamily()
|
String |
getId()
Gets the identifier for the component. |
protected int |
getIntProperty(PropertyKey key,
int defaultValue)
|
protected LifecycleRenderer |
getLifecycleRenderer(FacesContext context)
|
UIComponent |
getParent()
|
protected Object |
getProperty(PropertyKey key)
|
protected PropertyKey |
getPropertyKey(String name)
|
protected Renderer |
getRenderer(FacesContext context)
|
String |
getRendererType()
|
boolean |
getRendersChildren()
|
ValueBinding |
getValueBinding(String name)
|
ValueExpression |
getValueExpression(String name)
|
protected boolean |
invokeOnChildrenComponents(FacesContext context,
String clientId,
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(FacesContext context,
String clientId,
ContextCallback callback)
Override to calls the hooks for setting up and tearing down the context before the children are visited. |
protected boolean |
invokeOnNamingContainerComponent(FacesContext context,
String clientId,
ContextCallback callback)
Optimized implementation of invokeOnComponent for NamingContainers. |
boolean |
isRendered()
|
boolean |
isTransient()
|
void |
markInitialState()
|
void |
processDecodes(FacesContext context)
|
void |
processRestoreState(FacesContext context,
Object state)
|
Object |
processSaveState(FacesContext context)
|
void |
processUpdates(FacesContext context)
|
void |
processValidators(FacesContext context)
|
void |
queueEvent(FacesEvent event)
|
void |
removeAttributeChangeListener(AttributeChangeListener acl)
Removes an AttributeChangeListener. |
protected void |
removeFacesListener(FacesListener listener)
|
void |
restoreState(FacesContext facesContext,
Object stateObj)
|
protected boolean |
satisfiesPartialTrigger(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(FacesContext context)
|
void |
setAttributeChangeListener(MethodBinding mb)
Deprecated. |
void |
setAttributeChangeListener(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(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,
ValueBinding binding)
|
void |
setValueExpression(String name,
ValueExpression expression)
|
String |
toString()
|
protected void |
updateChildren(FacesContext context)
Delegates to LifecycleRenderer, if present, otherwise calls upateChildrenImpl. |
protected void |
updateChildrenImpl(FacesContext context)
|
protected void |
validateChildren(FacesContext context)
Delegates to LifecycleRenderer, if present, otherwise calls validateChildrenImpl. |
protected void |
validateChildrenImpl(FacesContext context)
Calls processValidators on all facets and children of this component. |
| Methods inherited from class javax.faces.component.UIComponent |
|---|
encodeAll, getContainerClientId |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
public UIXComponentBase()
public UIXComponentBase(String rendererType)
| Method Detail |
|---|
protected FacesBean createFacesBean(String rendererType)
protected PropertyKey getPropertyKey(String name)
protected FacesBean.Type getBeanType()
public FacesBean getFacesBean()
UIXComponent
getFacesBean in class UIXComponent
public String getContainerClientId(FacesContext context,
UIComponent child)
UIXComponent
getContainerClientId in class UIXComponentgetClientId(FacesContext context)public void addAttributeChangeListener(AttributeChangeListener acl)
UIXComponent
addAttributeChangeListener in class UIXComponentpublic void removeAttributeChangeListener(AttributeChangeListener acl)
UIXComponent
removeAttributeChangeListener in class UIXComponentpublic AttributeChangeListener[] getAttributeChangeListeners()
UIXComponent
getAttributeChangeListeners in class UIXComponentpublic void setAttributeChangeListener(MethodExpression mb)
UIXComponent
setAttributeChangeListener in class UIXComponent@Deprecated public void setAttributeChangeListener(MethodBinding mb)
public MethodExpression getAttributeChangeListener()
UIXComponent
getAttributeChangeListener in class UIXComponentpublic ValueExpression getValueExpression(String name)
getValueExpression in class UIComponent
public void setValueExpression(String name,
ValueExpression expression)
setValueExpression in class UIComponentpublic ValueBinding getValueBinding(String name)
getValueBinding in class UIComponent
public void setValueBinding(String name,
ValueBinding binding)
setValueBinding in class UIComponentpublic Map<String,Object> getAttributes()
getAttributes in class UIComponentpublic String getClientId(FacesContext context)
getClientId in class UIComponentpublic String getId()
getId in class UIComponentpublic void setId(String id)
setId in class UIComponentpublic abstract String getFamily()
getFamily in class UIComponentpublic UIComponent getParent()
getParent in class UIComponentpublic void setParent(UIComponent parent)
Set the parent UIComponent of this
UIComponent.
setParent in class UIComponentparent - The new parent, or null for the root node
of a component treepublic boolean isRendered()
isRendered in class UIComponentpublic void setRendered(boolean rendered)
setRendered in class UIComponentpublic boolean isTransient()
public void setTransient(boolean newTransient)
public String getRendererType()
getRendererType in class UIComponentpublic void setRendererType(String rendererType)
setRendererType in class UIComponentpublic boolean getRendersChildren()
getRendersChildren in class UIComponentpublic UIComponent findComponent(String id)
findComponent in class UIComponentpublic List<UIComponent> getChildren()
Create (if necessary) and return a List of the children associated with this component.
getChildren in class UIComponentpublic int getChildCount()
getChildCount in class UIComponentpublic Map<String,UIComponent> getFacets()
Create (if necessary) and return a Map of the facets associated with this component.
getFacets in class UIComponentpublic UIComponent getFacet(String facetName)
getFacet in class UIComponentpublic Iterator<String> getFacetNames()
public Iterator<UIComponent> getFacetsAndChildren()
getFacetsAndChildren in class UIComponent
public void broadcast(FacesEvent event)
throws AbortProcessingException
broadcast in class UIComponentAbortProcessingExceptionprotected boolean satisfiesPartialTrigger(FacesEvent event)
event - The event to check
public void decode(FacesContext context)
decode in class UIComponent
public void encodeBegin(FacesContext context)
throws IOException
encodeBegin in class UIComponentIOException
public void encodeChildren(FacesContext context)
throws IOException
encodeChildren in class UIComponentIOException
public void encodeEnd(FacesContext context)
throws IOException
encodeEnd in class UIComponentIOExceptionpublic void queueEvent(FacesEvent event)
queueEvent in class UIComponentpublic void processDecodes(FacesContext context)
processDecodes in class UIComponentpublic void processValidators(FacesContext context)
processValidators in class UIComponentpublic void processUpdates(FacesContext context)
processUpdates in class UIComponentpublic Object processSaveState(FacesContext context)
processSaveState in class UIComponent
public void processRestoreState(FacesContext context,
Object state)
processRestoreState in class UIComponentpublic void markInitialState()
markInitialState in class UIXComponentpublic Object saveState(FacesContext context)
public void restoreState(FacesContext facesContext,
Object stateObj)
public String toString()
toString in class Objectprotected FacesContext getFacesContext()
Return the FacesContext instance for the current request.
getFacesContext in class UIComponentprotected final void decodeChildren(FacesContext context)
context - the current FacesContextprotected void decodeChildrenImpl(FacesContext context)
context - the current FacesContextprotected final void validateChildren(FacesContext context)
context - the current FacesContextprotected void validateChildrenImpl(FacesContext context)
context - the current FacesContextprotected final void updateChildren(FacesContext context)
context - the current FacesContextprotected void updateChildrenImpl(FacesContext context)
protected void addFacesListener(FacesListener listener)
addFacesListener in class UIComponentprotected void removeFacesListener(FacesListener listener)
removeFacesListener in class UIComponentprotected FacesListener[] getFacesListeners(Class clazz)
getFacesListeners in class UIComponent
protected void addAttributeChange(String attributeName,
Object attributeValue)
protected Renderer getRenderer(FacesContext context)
getRenderer in class UIComponentprotected LifecycleRenderer getLifecycleRenderer(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 UIComponent
protected final void broadcastToMethodBinding(FacesEvent event,
MethodBinding method)
throws AbortProcessingException
AbortProcessingExceptionpublic static MethodExpression adaptMethodBinding(MethodBinding binding)
protected final void broadcastToMethodExpression(FacesEvent event,
MethodExpression method)
throws AbortProcessingException
AbortProcessingException
protected final boolean invokeOnChildrenComponents(FacesContext context,
String clientId,
ContextCallback callback)
throws 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.
FacesExceptionUIXComponent.setupChildrenVisitingContext(javax.faces.context.FacesContext),
UIXComponent.tearDownChildrenVisitingContext(javax.faces.context.FacesContext)
protected final boolean invokeOnNamingContainerComponent(FacesContext context,
String clientId,
ContextCallback callback)
throws 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.
FacesException
public boolean invokeOnComponent(FacesContext context,
String clientId,
ContextCallback callback)
throws FacesException
invokeOnComponent in class UIComponentFacesExceptionUIXComponent.setupVisitingContext(javax.faces.context.FacesContext),
UIXComponent.tearDownVisitingContext(javax.faces.context.FacesContext)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||