public abstract class HtmlBasicRenderer
extends javax.faces.render.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 |
Constructor and Description |
---|
HtmlBasicRenderer() |
Modifier and Type | Method and Description |
---|---|
protected String |
augmentIdReference(String forValue,
javax.faces.component.UIComponent fromComponent)
Conditionally augment an id-reference value.
|
String |
convertClientId(javax.faces.context.FacesContext context,
String clientId)
Convert the component generated client id to a form suitable
for transmission to the client.
|
void |
decode(javax.faces.context.FacesContext context,
javax.faces.component.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(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component) |
void |
encodeEnd(javax.faces.context.FacesContext context,
javax.faces.component.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(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Render nested child components by invoking the encode methods on those components,
but only when the
rendered property is true . |
protected Collection<javax.faces.component.behavior.ClientBehaviorContext.Parameter> |
getBehaviorParameters(javax.faces.component.UIComponent command)
Collections parameters for use with Behavior script rendering.
|
protected Iterator<javax.faces.component.UIComponent> |
getChildren(javax.faces.component.UIComponent component) |
protected String |
getCurrentValue(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component) |
protected void |
getEndTextToRender(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String currentValue)
Renderers override this method to write appropriate HTML content into the buffer.
|
protected javax.faces.component.UIComponent |
getFacet(javax.faces.component.UIComponent component,
String name) |
protected javax.faces.component.UIComponent |
getForComponent(javax.faces.context.FacesContext context,
String forComponent,
javax.faces.component.UIComponent component)
Locates the component identified by
forComponent |
protected String |
getFormattedValue(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
Object currentValue) |
protected String |
getFormattedValue(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
Object currentValue,
javax.faces.convert.Converter converter)
Overloads getFormattedValue to take a advantage of a previously obtained converter.
|
protected Iterator |
getMessageIter(javax.faces.context.FacesContext context,
String forComponent,
javax.faces.component.UIComponent component) |
protected HtmlBasicRenderer.Param[] |
getParamList(javax.faces.component.UIComponent command) |
protected static Map<String,List<javax.faces.component.behavior.ClientBehavior>> |
getPassThruBehaviors(javax.faces.component.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(javax.faces.component.UIComponent component) |
protected boolean |
isBehaviorSource(javax.faces.context.FacesContext ctx,
String behaviorSourceId,
String componentClientId) |
protected void |
rendererParamsNotNull(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component) |
protected void |
setSubmittedValue(javax.faces.component.UIComponent component,
Object value)
Renderers override this method to store the previous value of the associated
component.
|
protected boolean |
shouldDecode(javax.faces.component.UIComponent component) |
protected boolean |
shouldEncode(javax.faces.component.UIComponent component) |
protected boolean |
shouldEncodeChildren(javax.faces.component.UIComponent component) |
protected boolean |
shouldWriteIdAttribute(javax.faces.component.UIComponent component) |
protected String |
writeIdAttributeIfNecessary(javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component) |
protected static final Logger logger
protected static final HtmlBasicRenderer.Param[] EMPTY_PARAMS
public String convertClientId(javax.faces.context.FacesContext context, String clientId)
javax.faces.render.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 javax.faces.render.Renderer
context
- FacesContext
for the current requestclientId
- the client identifier to be converted to client a
specific format.clientId
public void decode(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
javax.faces.render.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 javax.faces.render.Renderer
context
- FacesContext
for the request we are processingcomponent
- UIComponent
to be decoded.public void encodeEnd(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws IOException
javax.faces.render.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 javax.faces.render.Renderer
context
- FacesContext
for the response we are creatingcomponent
- UIComponent
to be renderedIOException
- if an input/output error occurs while renderingpublic boolean getRendersChildren()
javax.faces.render.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 javax.faces.render.Renderer
protected final String decodeBehaviors(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
protected boolean isBehaviorSource(javax.faces.context.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, javax.faces.component.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(javax.faces.context.FacesContext context, javax.faces.component.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<javax.faces.component.UIComponent> getChildren(javax.faces.component.UIComponent component)
component
- UIComponent
for which to extract childrenrendered
property of true
.protected String getCurrentValue(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
context
- the FacesContext for the current requestcomponent
- the UIComponent whose value we're interested inprotected void getEndTextToRender(javax.faces.context.FacesContext context, javax.faces.component.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 javax.faces.component.UIComponent getFacet(javax.faces.component.UIComponent component, String name)
component
- Component from which to return a facetname
- Name of the desired facetrendered
property is set to true
.protected javax.faces.component.UIComponent getForComponent(javax.faces.context.FacesContext context, String forComponent, javax.faces.component.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(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object currentValue, javax.faces.convert.Converter converter) throws javax.faces.convert.ConverterException
context
- the FacesContext for the current requestcomponent
- UIComponent of interestcurrentValue
- the current value of component
converter
- the component's converterjavax.faces.convert.ConverterException
- if the value cannot be convertedprotected String getFormattedValue(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object currentValue) throws javax.faces.convert.ConverterException
context
- the FacesContext for the current requestcomponent
- UIComponent of interestcurrentValue
- the current value of component
javax.faces.convert.ConverterException
- if the value cannot be convertedprotected Iterator getMessageIter(javax.faces.context.FacesContext context, String forComponent, javax.faces.component.UIComponent component)
protected HtmlBasicRenderer.Param[] getParamList(javax.faces.component.UIComponent command)
command
- the command which may have parametersprotected Collection<javax.faces.component.behavior.ClientBehaviorContext.Parameter> getBehaviorParameters(javax.faces.component.UIComponent command)
command
- the command which may have parametersprotected Object getValue(javax.faces.component.UIComponent component)
protected void setSubmittedValue(javax.faces.component.UIComponent component, Object value)
component
- the target component to which the submitted value will be setvalue
- the value to setprotected boolean shouldWriteIdAttribute(javax.faces.component.UIComponent component)
component
- the component of interestprotected String writeIdAttributeIfNecessary(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component)
protected void rendererParamsNotNull(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
protected boolean shouldEncode(javax.faces.component.UIComponent component)
protected boolean shouldDecode(javax.faces.component.UIComponent component)
protected boolean shouldEncodeChildren(javax.faces.component.UIComponent component)
protected static Map<String,List<javax.faces.component.behavior.ClientBehavior>> getPassThruBehaviors(javax.faces.component.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 eventCopyright © 2010–2021 JBoss by Red Hat. All rights reserved.