Package com.webmethods.caf.faces.render
Class BaseRenderer
java.lang.Object
javax.faces.render.Renderer
com.webmethods.caf.faces.render.BaseRenderer
- Direct Known Subclasses:
com.webmethods.caf.faces.render.html.BaseHtmlRenderer
Base CAF JSF renderer implementation.
-
Field Summary
Fields inherited from class javax.faces.render.Renderer
PASSTHROUGH_RENDERER_LOCALNAME_KEY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
encodeChildren
(FacesContext context, UIComponent component) protected UIForm
findForm
(FacesContext context, UIComponent component) Find ancestor form of specified component.protected Object
getConvertedStringArrayValue
(FacesContext context, UIComponent component, String[] value) Converts string-array to appropriately-typed array or collection, based on component's value-binding.getConvertedValue
(FacesContext context, UIComponent component, Object submittedValue) protected List<UIParameter>
getParameters
(FacesContext context, UIComponent component) protected String
getStringValue
(FacesContext context, UIComponent component, Object value) Converts specified component value to a string.protected Object
getValue
(FacesContext context, UIComponent component) Get component's value.protected void
renderComponent
(FacesContext ctx, UIComponent component) Render the specified sub-tree.protected void
writeAttributes
(FacesContext context, UIComponent component, String[] componentAttributes) Writes the specified component property/attributes as attributes of the current element.protected void
writeAttributes
(FacesContext context, UIComponent component, String[] componentAttributes, String[] elementAttributes) Writes the specified component property/attributes as attributes of the current element.protected void
writeBooleanAttributes
(FacesContext context, UIComponent component, String[] componentAttributes) Writes the specified component property/attributes as boolean attributes of the current element (writes "elementAttribute='true'" if attribute is Boolean.TRUE or "true" or "TRUE"; writes nothing otherwise).protected void
writeBooleanAttributes
(FacesContext context, UIComponent component, String[] componentAttributes, String[] elementAttributes) Writes the specified component property/attributes as boolean attributes of the current element (writes "elementAttribute='true'" if attribute is Boolean.TRUE or "true" or "TRUE"; writes nothing otherwise).Methods inherited from class javax.faces.render.Renderer
convertClientId, decode, encodeBegin, encodeEnd, getRendersChildren
-
Constructor Details
-
BaseRenderer
public BaseRenderer()
-
-
Method Details
-
encodeChildren
- Overrides:
encodeChildren
in classRenderer
- Throws:
IOException
-
getConvertedValue
public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException - Overrides:
getConvertedValue
in classRenderer
- Throws:
ConverterException
-
getValue
Get component's value. -
getStringValue
protected String getStringValue(FacesContext context, UIComponent component, Object value) throws ConverterException Converts specified component value to a string. Nulls are converted to empty strings ("").- Parameters:
context
- Current context.component
- Component for which to conver the value.value
- Value to convert.- Returns:
- String representation of value.
- Throws:
ConverterException
-
getConvertedStringArrayValue
protected Object getConvertedStringArrayValue(FacesContext context, UIComponent component, String[] value) throws ConverterException Converts string-array to appropriately-typed array or collection, based on component's value-binding.- Throws:
ConverterException
-
writeAttributes
protected void writeAttributes(FacesContext context, UIComponent component, String[] componentAttributes) throws IOException Writes the specified component property/attributes as attributes of the current element.- Parameters:
context
- Current context.component
- Current component.componentAttributes
- Component attribute names.- Throws:
IOException
-
writeAttributes
protected void writeAttributes(FacesContext context, UIComponent component, String[] componentAttributes, String[] elementAttributes) throws IOException Writes the specified component property/attributes as attributes of the current element.- Parameters:
context
- Current context.component
- Current component.componentAttributes
- Component attribute names.elementAttributes
- Element attribute names. If null, uses componentNames for element attribute names.- Throws:
IOException
-
writeBooleanAttributes
protected void writeBooleanAttributes(FacesContext context, UIComponent component, String[] componentAttributes) throws IOException Writes the specified component property/attributes as boolean attributes of the current element (writes "elementAttribute='true'" if attribute is Boolean.TRUE or "true" or "TRUE"; writes nothing otherwise).- Parameters:
context
- Current context.component
- Current component.componentAttributes
- Component attribute names.- Throws:
IOException
-
writeBooleanAttributes
protected void writeBooleanAttributes(FacesContext context, UIComponent component, String[] componentAttributes, String[] elementAttributes) throws IOException Writes the specified component property/attributes as boolean attributes of the current element (writes "elementAttribute='true'" if attribute is Boolean.TRUE or "true" or "TRUE"; writes nothing otherwise).- Parameters:
context
- Current context.component
- Current component.componentAttributes
- Component attribute names.elementAttributes
- Element attribute names. If null, uses componentNames for element attribute names.- Throws:
IOException
-
findForm
Find ancestor form of specified component.- Parameters:
context
- Current context.component
- Component from which to start searching.- Returns:
- Form or null.
-
getParameters
- Returns:
- List of
UIParameter
children of this component. Never null.
-
renderComponent
protected void renderComponent(FacesContext ctx, UIComponent component) throws IOException, FacesException Render the specified sub-tree.- Throws:
IOException
FacesException
-