Top Description Inners Fields Constructors Methods
com.sun.faces.renderkit.html_basic

public abstract Class HtmlBasicRenderer

extends Renderer
Class Inheritance
Known Direct Subclasses
com.sun.faces.renderkit.html_basic.ImageRenderer, com.sun.faces.renderkit.html_basic.LinkRenderer, com.sun.faces.renderkit.html_basic.MessageRenderer, com.sun.faces.renderkit.html_basic.MessagesRenderer, com.sun.faces.renderkit.html_basic.OutcomeTargetRenderer, com.sun.faces.renderkit.html_basic.PassthroughRenderer, com.sun.faces.renderkit.html_basic.WebsocketRenderer, com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer, com.sun.faces.renderkit.html_basic.BaseTableRenderer, com.sun.faces.renderkit.html_basic.BodyRenderer, com.sun.faces.renderkit.html_basic.ButtonRenderer, com.sun.faces.renderkit.html_basic.CommandScriptRenderer, com.sun.faces.renderkit.html_basic.FormRenderer, com.sun.faces.renderkit.html_basic.GroupRenderer
Static Imports
com.sun.faces.renderkit.RenderKitUtils.PredefinedPostbackParameter.BEHAVIOR_EVENT_PARAM, .RenderKitUtils.PredefinedPostbackParameter.BEHAVIOR_SOURCE_PARAM, com.sun.faces.util.MessageUtils.CANT_WRITE_ID_ATTRIBUTE_ERROR_MESSAGE_ID, .MessageUtils.getExceptionMessageString, .Util.componentIsDisabledOrReadonly, .Util.isEmpty, .Util.notNull, java.util.logging.Level.FINE, .Level.WARNING

HtmlBasicRenderer is a base class for implementing renderers for HtmlBasicRenderKit.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public 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.

public static class
HtmlBasicRenderer.Param

Simple class to encapsulate the name and value of a UIParameter.

Field Summary

Modifier and TypeField and Description
protected static final HtmlBasicRenderer.Param[]
private static final Set<SearchExpressionHint>
protected static final Logger
Inherited from javax.faces.render.Renderer:
PASSTHROUGH_RENDERER_LOCALNAME_KEY

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected String

Returns:

the (possibly augmented) forValue.
augmentIdReference
(String
- the basic id-reference value.
forValue
,
UIComponent
- the component that holds the code>forValue.
fromComponent)

Conditionally augment an id-reference value.

public String
convertClientId(FacesContext
FacesContext for the current request
context
,
String
the client identifier to be converted to client a specific format.
clientId
)

Overrides javax.faces.render.Renderer.convertClientId.

Convert the component generated client id to a form suitable for transmission to the client.

public void
decode(FacesContext
FacesContext for the request we are processing
context
,
UIComponent
UIComponent to be decoded.
component
)

Overrides javax.faces.render.Renderer.decode.

Decode any new state of the specified UIComponent from the request contained in the specified FacesContext, and store that state on the UIComponent.

protected final String
public void
encodeEnd(FacesContext
FacesContext for the response we are creating
context
,
UIComponent
UIComponent to be rendered
component
)

Overrides javax.faces.render.Renderer.encodeEnd.

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
FacesContext for the current request
context
,
UIComponent
the component to recursively encode
component
)

Render nested child components by invoking the encode methods on those components, but only when the rendered property is true.

private static UIComponent

Returns:

the component with the the idforComponent otheriwse null if no match is found.
findUIComponentBelow
(UIComponent
- the starting point in which to begin the search
startPoint
,
String
- the component to search for
forComponent
)

Recursively searches for NamingContainers from the given start point looking for the component with the id specified by forComponent.

protected Collection<ClientBehaviorContext.Parameter>

Returns:

a collection of ClientBehaviorContext.Parameter instances.
getBehaviorParameters
(UIComponent
the command which may have parameters
command
)

Collections parameters for use with Behavior script rendering.

protected Iterator<UIComponent>

Returns:

an Iterator over the children of the specified component, selecting only those that have a rendered property of true.
getChildren
(UIComponent
UIComponent for which to extract children
component
)

protected String

Returns:

the value to be rendered and formats it if required. Sets to empty string if value is null.
getCurrentValue
(FacesContext
the FacesContext for the current request
context
,
UIComponent
the UIComponent whose value we're interested in
component
)

protected void
getEndTextToRender(FacesContext
the FacesContext for the current request
context
,
UIComponent
the UIComponent of interest
component
,
String
component's current value
currentValue
)

Renderers override this method to write appropriate HTML content into the buffer.

protected UIComponent

Returns:

the specified facet from the specified component, but only if its rendered property is set to true.
getFacet
(UIComponent
Component from which to return a facet
component
,
String
Name of the desired facet
name
)

protected UIComponent

Returns:

the component with the the idforComponent otheriwse null if no match is found.
getForComponent
(FacesContext
the FacesContext for the current request
context
,
String
- the component to search for
forComponent
,
UIComponent
- the starting point in which to begin the search
component
)

Locates the component identified by forComponent

protected String

Returns:

the currentValue after any associated Converter has been applied
getFormattedValue
(FacesContext
the FacesContext for the current request
context
,
UIComponent
UIComponent of interest
component
,
Object
the current value of component
currentValue
,
Converter<T>
the component's converter
converter
)

Overloads getFormattedValue to take a advantage of a previously obtained converter.

protected String

Returns:

the currentValue after any associated Converter has been applied
getFormattedValue
(FacesContext
the FacesContext for the current request
context
,
UIComponent
UIComponent of interest
component
,
Object
the current value of component
currentValue
)

protected Iterator<E>
getMessageIter(FacesContext context, String forComponent, UIComponent component)

protected HtmlBasicRenderer.Param[]

Returns:

an array of parameters
getParamList
(UIComponent
the command which may have parameters
command
)

protected static Map<String, List<ClientBehavior>>
getPassThruBehaviors(UIComponent
the component that we are rendering
component
,
String
the name of the dom-level event
domEventName
,
String
the name of the component-level event
componentEventName
)

When rendering pass thru attributes, we need to take any attached Behaviors into account.

public boolean
getRendersChildren()

Overrides javax.faces.render.Renderer.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

Returns:

true if the behavior source is for the component being decoded, otherwise false
isBehaviorSource
(FacesContext
the FacesContext for the current request
ctx
,
String
the ID of the behavior source
behaviorSourceId
,
String
the client ID of the component being decoded
componentClientId
)

protected void
protected void
setSubmittedValue(UIComponent
the target component to which the submitted value will be set
component
,
Object
the value to set
value
)

Renderers override this method to store the previous value of the associated component.

protected boolean
protected boolean
protected boolean
protected boolean

Returns:

true if this renderer should render an id attribute.
shouldWriteIdAttribute
(UIComponent
the component of interest
component
)

protected String
Inherited from javax.faces.render.Renderer:
encodeBeginencodeChildrengetConvertedValue

Field Detail

EMPTY_PARAMSback to summary
protected static final HtmlBasicRenderer.Param[] EMPTY_PARAMS
EXPRESSION_HINTSback to summary
private static final Set<SearchExpressionHint> EXPRESSION_HINTS
loggerback to summary
protected static final Logger logger

Constructor Detail

HtmlBasicRendererback to summary
public HtmlBasicRenderer()

Method Detail

augmentIdReferenceback to summary
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.

Parameters
forValue:String

- the basic id-reference value.

fromComponent:UIComponent

- the component that holds the code>forValue.

Returns:String

the (possibly augmented) forValue.

convertClientIdback to summary
public String convertClientId(FacesContext context, String clientId)

Overrides javax.faces.render.Renderer.convertClientId.

Doc from javax.faces.render.Renderer.convertClientId.

Convert the component generated client id to a form suitable for transmission to the client.

The default implementation returns the argument clientId unchanged.

Parameters
context:FacesContext

FacesContext for the current request

clientId:String

the client identifier to be converted to client a specific format.

Returns:String

the converted clientId

Annotations
@Override
decodeback to summary
public void decode(FacesContext context, UIComponent component)

Overrides javax.faces.render.Renderer.decode.

Doc from javax.faces.render.Renderer.decode.

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.

Parameters
context:FacesContext

FacesContext for the request we are processing

component:UIComponent

UIComponent to be decoded.

Annotations
@Override
decodeBehaviorsback to summary
protected final String decodeBehaviors(FacesContext context, UIComponent component)
encodeEndback to summary
public void encodeEnd(FacesContext context, UIComponent component) throws IOException

Overrides javax.faces.render.Renderer.encodeEnd.

Doc from javax.faces.render.Renderer.encodeEnd.

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.

Parameters
context:FacesContext

FacesContext for the response we are creating

component:UIComponent

UIComponent to be rendered

Annotations
@Override
Exceptions
IOException:
if an input/output error occurs while rendering
encodeRecursiveback to summary
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.

Parameters
context:FacesContext

FacesContext for the current request

component:UIComponent

the component to recursively encode

Exceptions
IOException:
if an error occurrs during the encode process
findUIComponentBelowback to summary
private static UIComponent findUIComponentBelow(UIComponent startPoint, String forComponent)

Recursively searches for NamingContainers from the given start point looking for the component with the id specified by forComponent.

Parameters
startPoint:UIComponent

- the starting point in which to begin the search

forComponent:String

- the component to search for

Returns:UIComponent

the component with the the idforComponent otheriwse null if no match is found.

getBehaviorParametersback to summary
protected Collection<ClientBehaviorContext.Parameter> getBehaviorParameters(UIComponent command)

Collections parameters for use with Behavior script rendering. Similar to getParamList(), but returns a collection of ClientBehaviorContext.Parameter instances.

Parameters
command:UIComponent

the command which may have parameters

Returns:Collection<ClientBehaviorContext.Parameter>

a collection of ClientBehaviorContext.Parameter instances.

getChildrenback to summary
protected Iterator<UIComponent> getChildren(UIComponent component)
Parameters
component:UIComponent

UIComponent for which to extract children

Returns:Iterator<UIComponent>

an Iterator over the children of the specified component, selecting only those that have a rendered property of true.

getCurrentValueback to summary
protected String getCurrentValue(FacesContext context, UIComponent component)
Parameters
context:FacesContext

the FacesContext for the current request

component:UIComponent

the UIComponent whose value we're interested in

Returns:String

the value to be rendered and formats it if required. Sets to empty string if value is null.

getEndTextToRenderback to summary
protected void getEndTextToRender(FacesContext context, UIComponent component, String currentValue) throws IOException

Renderers override this method to write appropriate HTML content into the buffer.

Parameters
context:FacesContext

the FacesContext for the current request

component:UIComponent

the UIComponent of interest

currentValue:String

component's current value

Exceptions
IOException:
if an error occurs rendering the text
getFacetback to summary
protected UIComponent getFacet(UIComponent component, String name)
Parameters
component:UIComponent

Component from which to return a facet

name:String

Name of the desired facet

Returns:UIComponent

the specified facet from the specified component, but only if its rendered property is set to true.

getForComponentback to summary
protected UIComponent getForComponent(FacesContext context, String forComponent, UIComponent component)

Locates the component identified by forComponent

Parameters
context:FacesContext

the FacesContext for the current request

forComponent:String

- the component to search for

component:UIComponent

- the starting point in which to begin the search

Returns:UIComponent

the component with the the idforComponent otheriwse null if no match is found.

getFormattedValueback to summary
protected String getFormattedValue(FacesContext context, UIComponent component, Object currentValue, Converter<T> converter) throws ConverterException

Overloads getFormattedValue to take a advantage of a previously obtained converter.

Parameters
context:FacesContext

the FacesContext for the current request

component:UIComponent

UIComponent of interest

currentValue:Object

the current value of component

converter:Converter<T>

the component's converter

Returns:String

the currentValue after any associated Converter has been applied

Exceptions
ConverterException:
if the value cannot be converted
getFormattedValueback to summary
protected String getFormattedValue(FacesContext context, UIComponent component, Object currentValue) throws ConverterException
Parameters
context:FacesContext

the FacesContext for the current request

component:UIComponent

UIComponent of interest

currentValue:Object

the current value of component

Returns:String

the currentValue after any associated Converter has been applied

Exceptions
ConverterException:
if the value cannot be converted
getMessageIterback to summary
protected Iterator<E> getMessageIter(FacesContext context, String forComponent, UIComponent component)
getParamListback to summary
protected HtmlBasicRenderer.Param[] getParamList(UIComponent command)
Parameters
command:UIComponent

the command which may have parameters

Returns:HtmlBasicRenderer.Param[]

an array of parameters

getPassThruBehaviorsback to summary
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. The presence of a non-empty Behaviors map can cause us to switch from optimized pass thru attribute rendering to the unoptimized code path. However, in two very common cases - attaching action behaviors to commands and attaching value change behaviors to editable value holders - the behaviors map is populated with behaviors that are not handled by the pass thru attribute code - ie. the behaviors are handled locally by the renderer. In order to optimize such cases, we check to see whether the component's behaviors map actually contains behaviors only for these non-pass thru attributes. If so, we can pass a null behavior map into renderPassThruAttributes(), thus ensuring that we can take advantage of the optimized pass thru rendering logic. Note that in all cases where we use this method, we actually have two behavior events that we want to check for - a low-level/dom event (eg. "click", or "change") plus a high-level component event (eg. "action", or "valueChange").

Parameters
component:UIComponent

the component that we are rendering

domEventName:String

the name of the dom-level event

componentEventName:String

the name of the component-level event

getRendersChildrenback to summary
public boolean getRendersChildren()

Overrides javax.faces.render.Renderer.getRendersChildren.

Doc from javax.faces.render.Renderer.getRendersChildren.

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.

Returns:boolean

the current value of the flag

Annotations
@Override
getValueback to summary
protected Object getValue(UIComponent component)
isBehaviorSourceback to summary
protected boolean isBehaviorSource(FacesContext ctx, String behaviorSourceId, String componentClientId)
Parameters
ctx:FacesContext

the FacesContext for the current request

behaviorSourceId:String

the ID of the behavior source

componentClientId:String

the client ID of the component being decoded

Returns:boolean

true if the behavior source is for the component being decoded, otherwise false

rendererParamsNotNullback to summary
protected void rendererParamsNotNull(FacesContext context, UIComponent component)
setSubmittedValueback to summary
protected void setSubmittedValue(UIComponent component, Object value)

Renderers override this method to store the previous value of the associated component.

Parameters
component:UIComponent

the target component to which the submitted value will be set

value:Object

the value to set

shouldDecodeback to summary
protected boolean shouldDecode(UIComponent component)
shouldEncodeback to summary
protected boolean shouldEncode(UIComponent component)
shouldEncodeChildrenback to summary
protected boolean shouldEncodeChildren(UIComponent component)
shouldWriteIdAttributeback to summary
protected boolean shouldWriteIdAttribute(UIComponent component)
Parameters
component:UIComponent

the component of interest

Returns:boolean

true if this renderer should render an id attribute.

writeIdAttributeIfNecessaryback to summary
protected String writeIdAttributeIfNecessary(FacesContext context, ResponseWriter writer, UIComponent component)
com.sun.faces.renderkit.html_basic back to summary

public Class HtmlBasicRenderer.OptionComponentInfo

extends Object
Class Inheritance
  • java.lang.Object
  • com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.OptionComponentInfo

Structure to hold common info used by Select* components to reduce the number of times component attributes are evaluated when rendering options.

Field Summary

Modifier and TypeField and Description
pack-priv boolean
pack-priv String
pack-priv String
pack-priv boolean
pack-priv String
pack-priv String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
public String
public String
public String
public boolean
public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

disabledback to summary
pack-priv boolean disabled
disabledClassback to summary
pack-priv String disabledClass
enabledClassback to summary
pack-priv String enabledClass
hideNoSelectionback to summary
pack-priv boolean hideNoSelection
selectedClassback to summary
pack-priv String selectedClass
unselectedClassback to summary
pack-priv String unselectedClass

Constructor Detail

OptionComponentInfoback to summary
public OptionComponentInfo(UIComponent component)

Method Detail

getDisabledClassback to summary
public String getDisabledClass()
getEnabledClassback to summary
public String getEnabledClass()
getSelectedClassback to summary
public String getSelectedClass()
getUnselectedClassback to summary
public String getUnselectedClass()
isDisabledback to summary
public boolean isDisabled()
isHideNoSelectionback to summary
public boolean isHideNoSelection()
com.sun.faces.renderkit.html_basic back to summary

public Class HtmlBasicRenderer.Param

extends Object
Class Inheritance

Simple class to encapsulate the name and value of a UIParameter.

Field Summary

Modifier and TypeField and Description
public String
public String

Constructor Summary

AccessConstructor and Description
public
Param(String name, String value)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nameback to summary
public String name
valueback to summary
public String value

Constructor Detail

Paramback to summary
public Param(String name, String value)