@JSFComponent(type="javax.faces.Component", family="javax.faces.Component", desc="abstract base component", configExcluded=true) public abstract class UIComponent extends Object implements PartialStateHolder, TransientStateHolder, SystemEventListenerHolder, ComponentSystemEventListener
Modifier and Type | Field and Description |
---|---|
static String |
ATTRS_WITH_DECLARED_DEFAULT_VALUES |
static String |
BEANINFO_KEY
Constant used in component attribute map to retrieve the BeanInfo of a composite
component.
|
protected Map<String,javax.el.ValueExpression> |
bindings
Deprecated.
|
static String |
COMPOSITE_COMPONENT_TYPE_KEY
Constant used in BeanInfo descriptor as a key for retrieve an alternate component type
for create the composite base component.
|
static String |
COMPOSITE_FACET_NAME
Constant used to define the facet inside this component that store the component hierarchy
generated by a composite component implementation, and then rendered.
|
static String |
CURRENT_COMPONENT
Constant used to store the current component that is being processed.
|
static String |
CURRENT_COMPOSITE_COMPONENT
Constant used to store the current composite component that is being processed.
|
static String |
FACETS_KEY
This constant has two usages.
|
static String |
HONOR_CURRENT_COMPONENT_ATTRIBUTES_PARAM_NAME
Indicate if the facesContext attribute values under the keys javax.faces.component.CURRENT_COMPONENT and
javax.faces.component.CURRENT_COMPOSITE_COMPONENT should be valid or not.
|
static String |
VIEW_LOCATION_KEY
Constant used in component attribute map to store the
Location object
where the definition of this component is. |
Constructor and Description |
---|
UIComponent() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
addFacesListener(FacesListener listener) |
abstract void |
broadcast(FacesEvent event) |
void |
clearInitialState() |
abstract void |
decode(FacesContext context) |
void |
encodeAll(FacesContext context) |
abstract void |
encodeBegin(FacesContext context) |
abstract void |
encodeChildren(FacesContext context) |
abstract void |
encodeEnd(FacesContext context) |
abstract UIComponent |
findComponent(String expr) |
abstract Map<String,Object> |
getAttributes() |
abstract int |
getChildCount() |
abstract List<UIComponent> |
getChildren() |
String |
getClientId() |
abstract String |
getClientId(FacesContext context) |
static UIComponent |
getCompositeComponentParent(UIComponent component)
search for the nearest parent composite component, if no parent is found
it has to return null!
if the component itself is null we have to return null as well!
|
String |
getContainerClientId(FacesContext ctx) |
static UIComponent |
getCurrentComponent(FacesContext context) |
static UIComponent |
getCurrentCompositeComponent(FacesContext context) |
protected abstract FacesContext |
getFacesContext() |
protected abstract FacesListener[] |
getFacesListeners(Class clazz) |
abstract UIComponent |
getFacet(String name) |
int |
getFacetCount() |
abstract Map<String,UIComponent> |
getFacets() |
abstract Iterator<UIComponent> |
getFacetsAndChildren() |
abstract String |
getFamily() |
abstract String |
getId() |
List<SystemEventListener> |
getListenersForEventClass(Class<? extends SystemEvent> eventClass) |
UIComponent |
getNamingContainer() |
abstract UIComponent |
getParent()
Returns the parent of the component.
|
Map<String,Object> |
getPassThroughAttributes() |
Map<String,Object> |
getPassThroughAttributes(boolean create) |
protected abstract Renderer |
getRenderer(FacesContext context) |
abstract String |
getRendererType() |
abstract boolean |
getRendersChildren() |
Map<String,String> |
getResourceBundleMap() |
protected StateHelper |
getStateHelper() |
protected StateHelper |
getStateHelper(boolean create)
returns a delta state saving enabled state helper
for the current component
|
TransientStateHelper |
getTransientStateHelper() |
TransientStateHelper |
getTransientStateHelper(boolean create) |
abstract ValueBinding |
getValueBinding(String name)
Deprecated.
Replaced by getValueExpression
|
javax.el.ValueExpression |
getValueExpression(String name) |
boolean |
initialStateMarked() |
boolean |
invokeOnComponent(FacesContext context,
String clientId,
ContextCallback callback)
Invokes the
invokeContextCallback method with the component, specified by clientId . |
static boolean |
isCompositeComponent(UIComponent component) |
boolean |
isInView()
Indicate if this component is inside a view,
or in other words is contained by an UIViewRoot
instance (which represents the view).
|
abstract boolean |
isRendered() |
protected boolean |
isVisitable(VisitContext context)
This method indicates if a component is visitable
according to the hints passed by the VisitContext parameter!
This method internally is used by visitTree and if it returns false
it short circuits the visitTree execution.
|
void |
markInitialState() |
void |
popComponentFromEL(FacesContext context) |
abstract void |
processDecodes(FacesContext context) |
void |
processEvent(ComponentSystemEvent event) |
abstract void |
processRestoreState(FacesContext context,
Object state) |
abstract Object |
processSaveState(FacesContext context) |
abstract void |
processUpdates(FacesContext context) |
abstract void |
processValidators(FacesContext context) |
void |
pushComponentToEL(FacesContext context,
UIComponent component) |
abstract void |
queueEvent(FacesEvent event) |
protected abstract void |
removeFacesListener(FacesListener listener) |
void |
restoreTransientState(FacesContext context,
Object state)
Restore the "transient state" using the object passed as
state.
|
Object |
saveTransientState(FacesContext context)
Return the object containing related "transient states".
|
abstract void |
setId(String id) |
void |
setInView(boolean isInView)
Define if the component is on the view or not.
|
abstract void |
setParent(UIComponent parent)
For JSF-framework internal use only.
|
abstract void |
setRendered(boolean rendered) |
abstract void |
setRendererType(String rendererType) |
abstract void |
setValueBinding(String name,
ValueBinding binding)
Deprecated.
Replaced by setValueExpression
|
void |
setValueExpression(String name,
javax.el.ValueExpression expression) |
void |
subscribeToEvent(Class<? extends SystemEvent> eventClass,
ComponentSystemEventListener componentListener) |
void |
unsubscribeFromEvent(Class<? extends SystemEvent> eventClass,
ComponentSystemEventListener componentListener) |
boolean |
visitTree(VisitContext context,
VisitCallback callback)
The visit tree method, visit tree walks over a subtree and processes
the callback object to perform some operation on the subtree
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isTransient, restoreState, saveState, setTransient
public static final String BEANINFO_KEY
ViewDeclarationLanguage.getComponentMetadata(FacesContext, Resource)
,
ViewDeclarationLanguage.retargetAttachedObjects(FacesContext, UIComponent, List)
,
ViewDeclarationLanguage.retargetMethodExpressions(FacesContext, UIComponent)
,
Application.createComponent(FacesContext, Resource)
,
Constant Field Valuespublic static final String COMPOSITE_COMPONENT_TYPE_KEY
public static final String COMPOSITE_FACET_NAME
public static final String CURRENT_COMPONENT
public static final String CURRENT_COMPOSITE_COMPONENT
public static final String FACETS_KEY
public static final String VIEW_LOCATION_KEY
Location
object
where the definition of this component is.public static final String ATTRS_WITH_DECLARED_DEFAULT_VALUES
@JSFWebConfigParam(since="2.1.0", expectedValues="true, false", defaultValue="false") public static final String HONOR_CURRENT_COMPONENT_ATTRIBUTES_PARAM_NAME
@Deprecated protected Map<String,javax.el.ValueExpression> bindings
public final Map<String,Object> getPassThroughAttributes()
public Map<String,Object> getPassThroughAttributes(boolean create)
create
- Map
instance, or null
.public boolean initialStateMarked()
initialStateMarked
in interface PartialStateHolder
public boolean invokeOnComponent(FacesContext context, String clientId, ContextCallback callback) throws FacesException
invokeContextCallback
method with the component, specified by clientId
.context
- FacesContext
for the current requestclientId
- the id of the desired UIComponent
clazzcallback
- Implementation of the ContextCallback
to be calledFacesException
public static boolean isCompositeComponent(UIComponent component)
component
- NullPointerException
- if the component is nullpublic boolean isInView()
public abstract boolean isRendered()
public void markInitialState()
markInitialState
in interface PartialStateHolder
protected boolean isVisitable(VisitContext context)
context
- public abstract void setValueBinding(String name, ValueBinding binding)
public void setValueExpression(String name, javax.el.ValueExpression expression)
public String getClientId()
public abstract String getClientId(FacesContext context)
public static UIComponent getCompositeComponentParent(UIComponent component)
component
- the component to start frompublic String getContainerClientId(FacesContext ctx)
public static UIComponent getCurrentComponent(FacesContext context)
context
- public static UIComponent getCurrentCompositeComponent(FacesContext context)
context
- public abstract String getFamily()
public abstract String getId()
public List<SystemEventListener> getListenersForEventClass(Class<? extends SystemEvent> eventClass)
getListenersForEventClass
in interface SystemEventListenerHolder
public UIComponent getNamingContainer()
public abstract void setId(String id)
public void setInView(boolean isInView)
This value is set in the following conditions:
isInView
- public abstract void setParent(UIComponent parent)
parent.getChildren().add(child)
instead.public abstract UIComponent getParent()
public abstract void setRendered(boolean rendered)
public abstract String getRendererType()
public abstract void setRendererType(String rendererType)
public abstract boolean getRendersChildren()
public abstract ValueBinding getValueBinding(String name)
public javax.el.ValueExpression getValueExpression(String name)
public abstract List<UIComponent> getChildren()
public abstract int getChildCount()
public abstract UIComponent findComponent(String expr)
public abstract Map<String,UIComponent> getFacets()
public abstract UIComponent getFacet(String name)
public abstract Iterator<UIComponent> getFacetsAndChildren()
public abstract void broadcast(FacesEvent event) throws AbortProcessingException
AbortProcessingException
public void clearInitialState()
clearInitialState
in interface PartialStateHolder
public abstract void decode(FacesContext context)
public abstract void encodeBegin(FacesContext context) throws IOException
IOException
public abstract void encodeChildren(FacesContext context) throws IOException
IOException
public abstract void encodeEnd(FacesContext context) throws IOException
IOException
public void encodeAll(FacesContext context) throws IOException
IOException
protected abstract void addFacesListener(FacesListener listener)
protected abstract FacesListener[] getFacesListeners(Class clazz)
protected abstract void removeFacesListener(FacesListener listener)
public abstract void queueEvent(FacesEvent event)
public abstract void processRestoreState(FacesContext context, Object state)
public abstract void processDecodes(FacesContext context)
public void processEvent(ComponentSystemEvent event) throws AbortProcessingException
processEvent
in interface ComponentSystemEventListener
AbortProcessingException
public abstract void processValidators(FacesContext context)
public abstract void processUpdates(FacesContext context)
public abstract Object processSaveState(FacesContext context)
public void subscribeToEvent(Class<? extends SystemEvent> eventClass, ComponentSystemEventListener componentListener)
public void unsubscribeFromEvent(Class<? extends SystemEvent> eventClass, ComponentSystemEventListener componentListener)
public boolean visitTree(VisitContext context, VisitCallback callback)
there are some details in the implementation which according to the spec have to be in place: a) before calling the callback and traversing into the subtree pushComponentToEL has to be called b) after the processing popComponentFromEL has to be performed to remove the component from the el
The tree traversal optimizations are located in the visit context and can be replaced via the VisitContextFactory in the faces-config factory section
context
- the visit context which handles the processing detailscallback
- the callback to be performedprotected abstract FacesContext getFacesContext()
protected abstract Renderer getRenderer(FacesContext context)
protected StateHelper getStateHelper()
protected StateHelper getStateHelper(boolean create)
create
- if true a state helper is created if not already existingpublic final TransientStateHelper getTransientStateHelper()
public TransientStateHelper getTransientStateHelper(boolean create)
public void restoreTransientState(FacesContext context, Object state)
TransientStateHolder
Restore the "transient state" using the object passed as state.
If the state
argument is null
clear any previous transient
state if any and return.
restoreTransientState
in interface TransientStateHolder
state
- the object containing transient valuespublic Object saveTransientState(FacesContext context)
TransientStateHolder
Return the object containing related "transient states". that could be used later to restore the "transient state".
saveTransientState
in interface TransientStateHolder
public final void popComponentFromEL(FacesContext context)
public final void pushComponentToEL(FacesContext context, UIComponent component)
public int getFacetCount()
Copyright © 2016 The Apache Software Foundation. All rights reserved.