public abstract class HtmlBasicRenderer extends Renderer
Modifier and Type | Class and Description |
---|---|
static class |
HtmlBasicRenderer.OptionComponentInfo
Structure to hold common info used by Select* components to reduce the number of
times component attributes are evaluated when rendering options.
|
static class |
HtmlBasicRenderer.Param
Simple class to encapsulate the name and value of a
UIParameter . |
Modifier and Type | Field and Description |
---|---|
protected static HtmlBasicRenderer.Param[] |
EMPTY_PARAMS |
protected static Logger |
logger |
PASSTHROUGH_RENDERER_LOCALNAME_KEY
Constructor and Description |
---|
HtmlBasicRenderer() |
Modifier and Type | Method and Description |
---|---|
protected String |
augmentIdReference(String forValue,
UIComponent fromComponent)
Conditionally augment an id-reference value.
|
String |
convertClientId(FacesContext context,
String clientId)
Convert the component generated client id to a form suitable
for transmission to the client.
|
void |
decode(FacesContext context,
UIComponent component)
Decode any new state of the specified
UIComponent
from the request contained in the specified FacesContext ,
and store that state on the UIComponent . |
protected String |
decodeBehaviors(FacesContext context,
UIComponent component) |
void |
encodeEnd(FacesContext context,
UIComponent component)
Render the ending of the current state of the specified
UIComponent , following the rules described for
encodeBegin() to acquire the appropriate value
to be rendered. |
protected void |
encodeRecursive(FacesContext context,
UIComponent component)
Render nested child components by invoking the encode methods on those components,
but only when the
rendered property is true . |
protected Collection<ClientBehaviorContext.Parameter> |
getBehaviorParameters(UIComponent command)
Collections parameters for use with Behavior script rendering.
|
protected Iterator<UIComponent> |
getChildren(UIComponent component) |
protected String |
getCurrentValue(FacesContext context,
UIComponent component) |
protected void |
getEndTextToRender(FacesContext context,
UIComponent component,
String currentValue)
Renderers override this method to write appropriate HTML content into the buffer.
|
protected UIComponent |
getFacet(UIComponent component,
String name) |
protected UIComponent |
getForComponent(FacesContext context,
String forComponent,
UIComponent component)
Locates the component identified by
forComponent |
protected String |
getFormattedValue(FacesContext context,
UIComponent component,
Object currentValue) |
protected String |
getFormattedValue(FacesContext context,
UIComponent component,
Object currentValue,
Converter converter)
Overloads getFormattedValue to take a advantage of a previously obtained converter.
|
protected Iterator |
getMessageIter(FacesContext context,
String forComponent,
UIComponent component) |
protected HtmlBasicRenderer.Param[] |
getParamList(UIComponent command) |
protected static Map<String,List<ClientBehavior>> |
getPassThruBehaviors(UIComponent component,
String domEventName,
String componentEventName)
When rendering pass thru attributes, we need to take any attached Behaviors into
account.
|
boolean |
getRendersChildren()
Return a flag indicating whether this
Renderer is responsible
for rendering the children the component it is asked to render. |
protected Object |
getValue(UIComponent component) |
protected boolean |
isBehaviorSource(FacesContext ctx,
String behaviorSourceId,
String componentClientId) |
protected void |
rendererParamsNotNull(FacesContext context,
UIComponent component) |
protected void |
setSubmittedValue(UIComponent component,
Object value)
Renderers override this method to store the previous value of the associated
component.
|
protected boolean |
shouldDecode(UIComponent component) |
protected boolean |
shouldEncode(UIComponent component) |
protected boolean |
shouldEncodeChildren(UIComponent component) |
protected boolean |
shouldWriteIdAttribute(UIComponent component) |
protected String |
writeIdAttributeIfNecessary(FacesContext context,
ResponseWriter writer,
UIComponent component) |
encodeBegin, encodeChildren, getConvertedValue
protected static final Logger logger
protected static final HtmlBasicRenderer.Param[] EMPTY_PARAMS
public String convertClientId(FacesContext context, String clientId)
Renderer
Convert the component generated client id to a form suitable for transmission to the client.
The default implementation returns the argument
clientId
unchanged.
convertClientId
in class Renderer
context
- FacesContext
for the current requestclientId
- the client identifier to be converted to client a
specific format.clientId
public void decode(FacesContext context, UIComponent component)
Renderer
Decode any new state of the specified UIComponent
from the request contained in the specified FacesContext
,
and store that state on the UIComponent
.
During decoding, events may be enqueued for later processing
(by event listeners that have registered an interest), by calling
queueEvent()
on the associated UIComponent
.
decode
in class Renderer
context
- FacesContext
for the request we are processingcomponent
- UIComponent
to be decoded.public void encodeEnd(FacesContext context, UIComponent component) throws IOException
Renderer
Render the ending of the current state of the specified
UIComponent
, following the rules described for
encodeBegin()
to acquire the appropriate value
to be rendered.
encodeEnd
in class Renderer
context
- FacesContext
for the response we are creatingcomponent
- UIComponent
to be renderedIOException
- if an input/output error occurs while renderingpublic boolean getRendersChildren()
Renderer
Return a flag indicating whether this Renderer
is responsible
for rendering the children the component it is asked to render.
The default implementation returns false
.
getRendersChildren
in class Renderer
protected final String decodeBehaviors(FacesContext context, UIComponent component)
protected boolean isBehaviorSource(FacesContext ctx, String behaviorSourceId, String componentClientId)
ctx
- the FacesContext
for the current requestbehaviorSourceId
- the ID of the behavior sourcecomponentClientId
- the client ID of the component being decodedtrue
if the behavior source is for the component being
decoded, otherwise false
protected String augmentIdReference(String forValue, UIComponent fromComponent)
Conditionally augment an id-reference value.
If the forValue
doesn't already include a generated suffix, but the id
of the fromComponent
does include a generated suffix, then append the
suffix from the fromComponent
to the forValue
. Otherwise
just return the forValue
as is.
forValue
- - the basic id-reference value.fromComponent
- - the component that holds the code>forValue.forValue.
protected void encodeRecursive(FacesContext context, UIComponent component) throws IOException
Render nested child components by invoking the encode methods on those components,
but only when the rendered
property is true
.
context
- FacesContext for the current requestcomponent
- the component to recursively encodeIOException
- if an error occurrs during the encode processprotected Iterator<UIComponent> getChildren(UIComponent component)
component
- UIComponent
for which to extract childrenrendered
property of true
.protected String getCurrentValue(FacesContext context, UIComponent component)
context
- the FacesContext for the current requestcomponent
- the UIComponent whose value we're interested inprotected void getEndTextToRender(FacesContext context, UIComponent component, String currentValue) throws IOException
context
- the FacesContext for the current requestcomponent
- the UIComponent of interestcurrentValue
- component
's current valueIOException
- if an error occurs rendering the textprotected UIComponent getFacet(UIComponent component, String name)
component
- Component from which to return a facetname
- Name of the desired facetrendered
property is set to true
.protected UIComponent getForComponent(FacesContext context, String forComponent, UIComponent component)
forComponent
context
- the FacesContext for the current requestforComponent
- - the component to search forcomponent
- - the starting point in which to begin the searchid
forComponent otheriwse null if no match is found.protected String getFormattedValue(FacesContext context, UIComponent component, Object currentValue, Converter converter) throws ConverterException
context
- the FacesContext for the current requestcomponent
- UIComponent of interestcurrentValue
- the current value of component
converter
- the component's converterConverterException
- if the value cannot be convertedprotected String getFormattedValue(FacesContext context, UIComponent component, Object currentValue) throws ConverterException
context
- the FacesContext for the current requestcomponent
- UIComponent of interestcurrentValue
- the current value of component
ConverterException
- if the value cannot be convertedprotected Iterator getMessageIter(FacesContext context, String forComponent, UIComponent component)
protected HtmlBasicRenderer.Param[] getParamList(UIComponent command)
command
- the command which may have parametersprotected Collection<ClientBehaviorContext.Parameter> getBehaviorParameters(UIComponent command)
command
- the command which may have parametersprotected Object getValue(UIComponent component)
protected void setSubmittedValue(UIComponent component, Object value)
component
- the target component to which the submitted value will be setvalue
- the value to setprotected boolean shouldWriteIdAttribute(UIComponent component)
component
- the component of interestprotected String writeIdAttributeIfNecessary(FacesContext context, ResponseWriter writer, UIComponent component)
protected void rendererParamsNotNull(FacesContext context, UIComponent component)
protected boolean shouldEncode(UIComponent component)
protected boolean shouldDecode(UIComponent component)
protected boolean shouldEncodeChildren(UIComponent component)
protected static Map<String,List<ClientBehavior>> getPassThruBehaviors(UIComponent component, String domEventName, String componentEventName)
component
- the component that we are renderingdomEventName
- the name of the dom-level eventcomponentEventName
- the name of the component-level eventComments to: faces-dev@eclipse.org.
Copyright © 2019 Eclipse Foundation. All rights reserved.
Use is subject to license terms.