Class AbstractRenderer
- Direct Known Subclasses:
BaseRenderer,CommandLinkRenderer,ErrorsRenderer,FormRenderer,HtmlRenderer,JavascriptValidatorRenderer,LoadMessagesRenderer,StylesheetRenderer,WriteRenderer
jakarta.faces.render.Renderer for the
Struts-Faces Integration Library.- Version:
- $Rev$ $Date$
-
Field Summary
Fields inherited from class jakarta.faces.render.Renderer
PASSTHROUGH_RENDERER_LOCALNAME_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddecode(FacesContext context, UIComponent component) Decode any new state of the specifiedUIComponentfrom the request contained in the specifiedFacesContext, and store that state on theUIComponent.voidencodeBegin(FacesContext context, UIComponent component) Render the beginning of the specifiedUIComponentto the output stream or writer associated with the response we are creating.voidencodeChildren(FacesContext context, UIComponent component) Render the children of the specifiedUIComponentto the output stream or writer associated with the response we are creating.voidencodeEnd(FacesContext context, UIComponent component) Render the ending of the specifiedUIComponentto the output stream or writer associated with the response we are creating.protected voidencodeRecursive(FacesContext context, UIComponent component) Render nested child components by invoking the encode methods on those components, but only when therenderedproperty istrue.protected StringgetAsString(FacesContext context, UIComponent component, Object value) Convert the Object representation of this component's value to the corresponding String representation.protected booleanisDisabled(UIComponent component) Returntrueif the specified component is disabled.protected booleanisReadOnly(UIComponent component) Returntrueif the specified component is read only.protected booleanisXhtml(UIComponent component) Returntrueif we should render as XHTML.protected voidrenderAttributes(FacesContext context, UIComponent component, ResponseWriter writer) Render the element attributes for the generated markup related to this component.protected voidrenderBoolean(FacesContext context, UIComponent component, ResponseWriter writer, String[] names) Render any boolean attributes on the specified list that havetruevalues on the corresponding attribute of the specifiedUIComponent.protected voidrenderEnd(FacesContext context, UIComponent component, ResponseWriter writer) Render the element end for the generated markup related to this component.protected voidrenderPassThrough(FacesContext context, UIComponent component, ResponseWriter writer, String[] names) Render any attributes on the specified list directly to the specifiedResponseWriterfor which the specifiedUIComponenthas a non-nullattribute value.protected voidrenderStart(FacesContext context, UIComponent component, ResponseWriter writer) Render the element start for the generated markup related to this component.protected <T extends UIComponent>
TsearchComponent(Class<T> clazz, UIComponent component) Search the giveUIComponentin the component-tree.protected voidsetSubmittedValue(FacesContext context, UIComponent component) If a submitted value was included on this request, store it in the component as appropriate.Methods inherited from class jakarta.faces.render.Renderer
convertClientId, getConvertedValue, getRendersChildren
-
Constructor Details
-
AbstractRenderer
public AbstractRenderer()
-
-
Method Details
-
decode
Decode any new state of the specifiedUIComponentfrom the request contained in the specifiedFacesContext, and store that state on theUIComponent.The default implementation calls
setSubmittedValue()unless this component has a booleandisabledorreadonlyattribute that is set totrue.- Overrides:
decodein classRenderer- Parameters:
context-FacesContextfor the current requestcomponent-UIComponentto be decoded- Throws:
NullPointerException- ifcontextorcomponentisnull
-
encodeBegin
Render the beginning of the specifiedUIComponentto the output stream or writer associated with the response we are creating.The default implementation calls
renderStart()andrenderAttributes().- Overrides:
encodeBeginin classRenderer- Parameters:
context-FacesContextfor the current requestcomponent-UIComponentto be decoded- Throws:
NullPointerException- ifcontextorcomponentisnullIOException- if an input/output error occurs
-
encodeChildren
Render the children of the specifiedUIComponentto the output stream or writer associated with the response we are creating.The default implementation iterates through the children of this component and renders them.
- Overrides:
encodeChildrenin classRenderer- Parameters:
context-FacesContextfor the current requestcomponent-UIComponentto be decoded- Throws:
NullPointerException- ifcontextorcomponentisnullIOException- if an input/output error occurs
-
encodeEnd
Render the ending of the specifiedUIComponentto the output stream or writer associated with the response we are creating.The default implementation calls
renderEnd().- Overrides:
encodeEndin classRenderer- Parameters:
context-FacesContextfor the current requestcomponent-UIComponentto be decoded- Throws:
NullPointerException- ifcontextorcomponentisnullIOException- if an input/output error occurs
-
encodeRecursive
Render nested child components by invoking the encode methods on those components, but only when therenderedproperty istrue.- Throws:
IOException
-
isDisabled
Returntrueif the specified component is disabled.- Parameters:
component-UIComponentto be checked
-
isReadOnly
Returntrueif the specified component is read only.- Parameters:
component-UIComponentto be checked
-
renderAttributes
protected void renderAttributes(FacesContext context, UIComponent component, ResponseWriter writer) throws IOException Render the element attributes for the generated markup related to this component. Simple renderers that create a single markup element for this component should override this method and include calls to towriteAttribute()andwriteURIAttributeon the specifiedResponseWriter.The default implementation does nothing.
- Parameters:
context-FacesContextfor the current requestcomponent-EditableValueHoldercomponent whose submitted value is to be storedwriter-ResponseWriterto which the element start should be rendered- Throws:
IOException- if an input/output error occurs
-
renderEnd
protected void renderEnd(FacesContext context, UIComponent component, ResponseWriter writer) throws IOException Render the element end for the generated markup related to this component. Simple renderers that create a single markup element for this component should override this method and include a call toendElement()on the specifiedResponseWriter.The default implementation does nothing.
- Parameters:
context-FacesContextfor the current requestcomponent-EditableValueHoldercomponent whose submitted value is to be storedwriter-ResponseWriterto which the element start should be rendered- Throws:
IOException- if an input/output error occurs
-
renderBoolean
protected void renderBoolean(FacesContext context, UIComponent component, ResponseWriter writer, String[] names) throws IOException Render any boolean attributes on the specified list that havetruevalues on the corresponding attribute of the specifiedUIComponent.- Parameters:
context-FacesContextfor the current requestcomponent-EditableValueHoldercomponent whose submitted value is to be storedwriter-ResponseWriterto which the element start should be renderednames- List of attribute names to be passed through- Throws:
IOException- if an input/output error occurs
-
renderPassThrough
protected void renderPassThrough(FacesContext context, UIComponent component, ResponseWriter writer, String[] names) throws IOException Render any attributes on the specified list directly to the specifiedResponseWriterfor which the specifiedUIComponenthas a non-nullattribute value. This method may be used to "pass through" commonly used attribute name/value pairs with a minimum of code.- Parameters:
context-FacesContextfor the current requestcomponent-EditableValueHoldercomponent whose submitted value is to be storedwriter-ResponseWriterto which the element start should be renderednames- List of attribute names to be passed through- Throws:
IOException- if an input/output error occurs
-
renderStart
protected void renderStart(FacesContext context, UIComponent component, ResponseWriter writer) throws IOException Render the element start for the generated markup related to this component. Simple renderers that create a single markup element for this component should override this method and include a call tostartElement()on the specifiedResponseWriter.The default implementation does nothing.
- Parameters:
context-FacesContextfor the current requestcomponent-EditableValueHoldercomponent whose submitted value is to be storedwriter-ResponseWriterto which the element start should be rendered- Throws:
IOException- if an input/output error occurs
-
setSubmittedValue
If a submitted value was included on this request, store it in the component as appropriate.The default implementation determines whether this component implements
EditableValueHolder. If so, it checks for a request parameter with the same name as theclientIdof thisUIComponent. If there is such a parameter, its value is passed (as a String) to thesetSubmittedValue()method on theEditableValueHoldercomponent.- Parameters:
context-FacesContextfor the current requestcomponent-EditableValueHoldercomponent whose submitted value is to be stored
-
getAsString
protected String getAsString(FacesContext context, UIComponent component, Object value) throws ConverterException Convert the Object representation of this component's value to the corresponding String representation. The default implementation utilizes the
getAsString()method of any associatedConverter.- Parameters:
context- TheFacesContextfor this requestcomponent- TheUIComponentwhose value is being convertedvalue- The Object representation to be converted- Throws:
ConverterException- if conversion fails
-
isXhtml
Returntrueif we should render as XHTML.- Parameters:
component- The component we are rendering
-
searchComponent
Search the giveUIComponentin the component-tree.- Parameters:
component- The entry-point into component-tree.- Returns:
- The
UIComponentornullif thecomponentis not found.
-