Top Description Fields Constructors Methods
javax.faces.webapp

public abstract Class UIComponentELTag

extends UIComponentClassicTagBase
implements Tag
Class Inheritance
All Implemented Interfaces
javax.servlet.jsp.tagext.Tag, javax.servlet.jsp.tagext.JspTag
Imports
javax.el.ELException, .ELContext, .ValueExpression, javax.faces.FacesException, javax.faces.application.Application, javax.faces.component.UIComponent, javax.faces.context.FacesContext, javax.servlet.jsp.JspException, javax.servlet.jsp.tagext.Tag

UIComponentELTag specializes its superclass to allow for properties that take their values from EL API expressions.

This tag is designed for use with Faces version 1.2 and JSP version 2.1 containers.

Field Summary

Modifier and TypeField and Description
private ValueExpression
binding

The value binding expression (if any) used to wire up this component to a UIComponent property of a JavaBean class.

private ValueExpression
rendered

An override for the rendered attribute associated with our UIComponent.

Inherited from javax.faces.webapp.UIComponentClassicTagBase:
bodyContentnamingContainerChildIdspageContextUNIQUE_ID_PREFIX

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected UIComponent
createComponent(FacesContext
FacesContext for the current request
context
,
String
id of the component
newId
)

Implements abstract javax.faces.webapp.UIComponentClassicTagBase.createComponent.

Create and return a new child component of the type returned by calling getComponentType().

protected ELContext
protected boolean
hasBinding()

Implements abstract javax.faces.webapp.UIComponentClassicTagBase.hasBinding.

Return true if this component has a non-null binding attribute.

public void
release()

Overrides javax.faces.webapp.UIComponentClassicTagBase.release.

Implements javax.servlet.jsp.tagext.Tag.release.

Release any resources allocated during the execution of this tag handler.

public void
setBinding(ValueExpression
The new value expression
binding
)

Set the value expression for our component.

protected void
setProperties(UIComponent
UIComponent whose properties are to be overridden
component
)

Implements abstract javax.faces.webapp.UIComponentClassicTagBase.setProperties.

Override properties and attributes of the specified component, if the corresponding properties of this tag handler instance were explicitly set.

public void
setRendered(ValueExpression
The new value for rendered attribute
rendered
)

Set an override for the rendered attribute.

Inherited from javax.faces.webapp.UIComponentClassicTagBase:
addChildaddChildToComponentAndTagaddFacetaddVerbatimAfterComponentaddVerbatimBeforeComponentcreateVerbatimComponentcreateVerbatimComponentFromBodyContentdoAfterBodydoEndTagdoInitBodydoStartTagencodeBeginencodeChildrenencodeEndfindComponentgetBodyContentgetComponentInstancegetCreatedgetCreatedComponentsgetDoAfterBodyValuegetDoEndValuegetDoStartValuegetFacesContextgetFacesJspIdgetFacetNamegetIdgetIndexOfNextChildTaggetJspIdgetParentgetParentUIComponentClassicTagBasegetPreviousOutsetBodyContentsetIdsetJspIdsetPageContextsetParentsetupResponseWriter

Field Detail

bindingback to summary
private ValueExpression binding

The value binding expression (if any) used to wire up this component to a UIComponent property of a JavaBean class.

renderedback to summary
private ValueExpression rendered

An override for the rendered attribute associated with our UIComponent.

Constructor Detail

UIComponentELTagback to summary
public UIComponentELTag()

Method Detail

createComponentback to summary
protected UIComponent createComponent(FacesContext context, String newId) throws JspException

Implements abstract javax.faces.webapp.UIComponentClassicTagBase.createComponent.

Create and return a new child component of the type returned by calling getComponentType(). If this UIComponentELTag has a non-null binding attribute, this is done by call Application#createComponent with the ValueExpression created for the binding attribute, and the ValueExpression will be stored on the component. Otherwise, Application#createComponent is called with only the component type. Finally, initialize the components id and other properties.

Parameters
context:FacesContext

FacesContext for the current request

newId:String

id of the component

Returns:UIComponent

Doc from javax.faces.webapp.UIComponentClassicTagBase.createComponent.

the created component

Annotations
@Override
Exceptions
JspException:

Doc from javax.faces.webapp.UIComponentClassicTagBase.createComponent.

if the component cannot be created

getELContextback to summary
protected ELContext getELContext()

Overrides javax.faces.webapp.UIComponentTagBase.getELContext.

Return the ELContext for the FacesContext for this request.

This is a convenience for getFacesContext().getELContext().

Returns:ELContext

Doc from javax.faces.webapp.UIComponentTagBase.getELContext.

the {code ELContext} for this FacesContext

Annotations
@Override
hasBindingback to summary
protected boolean hasBinding()

Implements abstract javax.faces.webapp.UIComponentClassicTagBase.hasBinding.

Doc from javax.faces.webapp.UIComponentClassicTagBase.hasBinding.

Return true if this component has a non-null binding attribute. This method is necessary to allow subclasses that expose the binding property as an Faces 1.1 style EL property as well as subclasses that expose it as an EL API property.

Returns:boolean

whether or not this component has a binding attribute

Annotations
@Override
releaseback to summary
public void release()

Overrides javax.faces.webapp.UIComponentClassicTagBase.release.

Implements javax.servlet.jsp.tagext.Tag.release.

Release any resources allocated during the execution of this tag handler.

Annotations
@Override
setBindingback to summary
public void setBinding(ValueExpression binding) throws JspException

Set the value expression for our component.

Parameters
binding:ValueExpression

The new value expression

Exceptions
JspException:
if an error occurs
setPropertiesback to summary
protected void setProperties(UIComponent component)

Implements abstract javax.faces.webapp.UIComponentClassicTagBase.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 UIComponent was in fact created during the execution of this tag handler instance, and this call will occur BEFORE the UIComponent is 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 properties foo and bar would 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 the rendered property is specified for this tag handler instance.
  • rendererType - Set if the getRendererType() method returns a non-null value.
Parameters
component:UIComponent

UIComponent whose properties are to be overridden

Annotations
@Override
setRenderedback to summary
public void setRendered(ValueExpression rendered)

Set an override for the rendered attribute.

Parameters
rendered:ValueExpression

The new value for rendered attribute