Class UIComponentELTag
- All Implemented Interfaces:
jakarta.servlet.jsp.tagext.BodyTag,jakarta.servlet.jsp.tagext.IterationTag,jakarta.servlet.jsp.tagext.JspIdConsumer,jakarta.servlet.jsp.tagext.JspTag,jakarta.servlet.jsp.tagext.Tag
- Direct Known Subclasses:
ColumnTag,CommandButtonTag,CommandLinkTag,DataTableTag,FocusTag,FormTag,GraphicImageTag,InputFileTag,InputHiddenTag,InputSecretTag,InputTextareaTag,InputTextTag,MessagesTag,MessageTag,OutputFormatTag,OutputLabelTag,OutputLinkTag,OutputTextTag,PanelGridTag,PanelGroupTag,ParameterTag,SelectBooleanCheckboxTag,SelectItemsTag,SelectItemTag,SelectManyCheckboxTag,SelectManyListboxTag,SelectManyMenuTag,SelectOneListboxTag,SelectOneMenuTag,SelectOneRadioTag,SubviewTag,VerbatimTag,ViewTag
public abstract class UIComponentELTag extends UIComponentClassicTagBase implements jakarta.servlet.jsp.tagext.Tag
UIComponentELTag specializes its superclass to allow for properties that take their values from Jakarta
Expression Language expressions.
This tag is designed for use with Faces version 1.2 and Jakarta Server Pages version 2.1 containers.
-
Field Summary
Fields inherited from class jakarta.faces.webapp.UIComponentClassicTagBase
bodyContent, pageContext, UNIQUE_ID_PREFIX -
Constructor Summary
Constructors Constructor Description UIComponentELTag() -
Method Summary
Modifier and Type Method Description protected UIComponentcreateComponent(FacesContext context, String newId)Create and return a new child component of the type returned by callinggetComponentType().protected jakarta.el.ELContextgetELContext()Return theELContextfor theFacesContextfor this request.protected booleanhasBinding()Returntrueif this component has a non-nullbinding attribute.voidrelease()Release any resources allocated during the execution of this tag handler.voidsetBinding(jakarta.el.ValueExpression binding)Set the value expression for our component.protected voidsetProperties(UIComponent component)Override properties and attributes of the specified component, if the corresponding properties of this tag handler instance were explicitly set.voidsetRendered(jakarta.el.ValueExpression rendered)Set an override for the rendered attribute.Methods inherited from class jakarta.faces.webapp.UIComponentClassicTagBase
addChild, addFacet, addVerbatimAfterComponent, addVerbatimBeforeComponent, createVerbatimComponent, createVerbatimComponentFromBodyContent, doAfterBody, doEndTag, doInitBody, doStartTag, encodeBegin, encodeChildren, encodeEnd, findComponent, getBodyContent, getComponentInstance, getCreated, getCreatedComponents, getDoAfterBodyValue, getDoEndValue, getDoStartValue, getFacesContext, getFacesJspId, getFacetName, getId, getIndexOfNextChildTag, getJspId, getParent, getParentUIComponentClassicTagBase, getPreviousOut, setBodyContent, setId, setJspId, setPageContext, setParent, setupResponseWriterMethods inherited from class jakarta.faces.webapp.UIComponentTagBase
getComponentType, getRendererType
-
Constructor Details
-
UIComponentELTag
public UIComponentELTag()
-
-
Method Details
-
setBinding
public void setBinding(jakarta.el.ValueExpression binding) throws jakarta.servlet.jsp.JspExceptionSet the value expression for our component.
- Parameters:
binding- The new value expression- Throws:
jakarta.servlet.jsp.JspException- if an error occurs
-
hasBinding
protected boolean hasBinding()Description copied from class:UIComponentClassicTagBaseReturn
trueif this component has a non-nullbinding attribute. This method is necessary to allow subclasses that expose thebindingproperty as an Faces 1.1 style Expression Language property as well as subclasses that expose it as a Jakarta Expression Language API property.- Specified by:
hasBindingin classUIComponentClassicTagBase- Returns:
- whether or not this component has a binding attribute
-
setRendered
public void setRendered(jakarta.el.ValueExpression rendered)Set an override for the rendered attribute.
- Parameters:
rendered- The new value for rendered attribute
-
getELContext
protected jakarta.el.ELContext getELContext()Return the
ELContextfor theFacesContextfor this request.This is a convenience for
getFacesContext().getELContext().- Overrides:
getELContextin classUIComponentTagBase- Returns:
- the {code ELContext} for this
FacesContext
-
release
public void release()Release any resources allocated during the execution of this tag handler.
- Specified by:
releasein interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
releasein classUIComponentClassicTagBase
-
setProperties
Override properties and attributes of the specified component, if the corresponding properties of this tag handler instance were explicitly set. This method must be called ONLY if the specified
UIComponentwas in fact created during the execution of this tag handler instance, and this call will occur BEFORE theUIComponentis added to the view.Tag subclasses that want to support additional set properties must ensure that the base class
setProperties()method is still called. A typical implementation that supports extra propertiesfooandbarwould look something like this:protected void setProperties(UIComponent component) { super.setProperties(component); if (foo != null) { component.setAttribute("foo", foo); } if (bar != null) { component.setAttribute("bar", bar); } }The default implementation overrides the following properties:
rendered- Set if a value for therenderedproperty is specified for this tag handler instance.rendererType- Set if thegetRendererType()method returns a non-null value.
- Specified by:
setPropertiesin classUIComponentClassicTagBase- Parameters:
component-UIComponentwhose properties are to be overridden
-
createComponent
protected UIComponent createComponent(FacesContext context, String newId) throws jakarta.servlet.jsp.JspExceptionCreate and return a new child component of the type returned by calling
getComponentType(). If thisUIComponentELTaghas a non-nullbindingattribute, this is done by callApplication.createComponent(java.lang.String)with theValueExpressioncreated for thebindingattribute, and theValueExpressionwill be stored on the component. Otherwise,Application.createComponent(java.lang.String)is called with only the component type. Finally, initialize the components id and other properties.- Specified by:
createComponentin classUIComponentClassicTagBase- Parameters:
context-FacesContextfor the current requestnewId- id of the component- Returns:
- the created component
- Throws:
jakarta.servlet.jsp.JspException- if the component cannot be created
-