- Direct Known Subclasses:
ListboxRenderer
,SelectManyCheckboxListRenderer
UISelectOne
or UISelectMany
component as a list of menu options.-
Nested Class Summary
Nested classes/interfaces inherited from class com.sun.faces.renderkit.html_basic.HtmlBasicRenderer
HtmlBasicRenderer.OptionComponentInfo, HtmlBasicRenderer.Param
-
Field Summary
Fields inherited from class com.sun.faces.renderkit.html_basic.HtmlBasicRenderer
EMPTY_PARAMS, logger
Fields inherited from class jakarta.faces.render.Renderer
PASSTHROUGH_RENDERER_LOCALNAME_KEY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Collection
<Object> bestGuess
(Class<? extends Collection<Object>> type, int initialSize) protected Collection
<Object> cloneValue
(Object value) Utility method to invoke the theclone
method on the provided value.protected Object
coerceToModelType
(FacesContext ctx, Object value, Class<?> itemValueType) protected boolean
containsaValue
(Object valueArray) convertSelectManyValue
(FacesContext context, UISelectMany uiSelectMany, String[] newValues) protected Object
convertSelectManyValuesForArray
(FacesContext context, UISelectMany uiSelectMany, Class<?> elementType, String[] newValues) protected Collection
<Object> convertSelectManyValuesForCollection
(FacesContext context, UISelectMany uiSelectMany, Class<? extends Collection<Object>> collectionType, String[] newValues) protected Object
convertSelectManyValuesForModel
(FacesContext context, UISelectMany uiSelectMany, Class<?> modelType, String[] newValues) convertSelectOneValue
(FacesContext context, UISelectOne uiSelectOne, String newValue) protected Collection
<Object> createCollection
(Collection<Object> collection, Class<? extends Collection<Object>> fallBackType) protected Collection
<Object> createCollectionFromHint
(Object collectionTypeHint) Create a collection from the provided hint.void
decode
(FacesContext context, UIComponent component) Decode any new state of the specifiedUIComponent
from the request contained in the specifiedFacesContext
, and store that state on theUIComponent
.void
encodeBegin
(FacesContext context, UIComponent component) Render the beginning specifiedUIComponent
to the output stream or writer associated with the response we are creating.void
encodeEnd
(FacesContext context, UIComponent component) Render the ending of the current state of the specifiedUIComponent
, following the rules described forencodeBegin()
to acquire the appropriate value to be rendered.getConvertedValue
(FacesContext context, UIComponent component, Object submittedValue) Attempt to convert previously stored state information into an object of the type required for this component (optionally using the registeredConverter
for this component, if there is one).protected Object
getCurrentSelectedValues
(UIComponent component) protected String
getMultipleText
(UIComponent component) protected Object[]
getSubmittedSelectedValues
(UIComponent component) protected static boolean
isHideNoSelection
(UIComponent component) protected boolean
isSelected
(FacesContext context, UIComponent component, Object itemValue, Object valueArray, Converter<?> converter) protected boolean
renderOption
(FacesContext context, UIComponent component, UIComponent selectComponent, Converter<?> converter, SelectItem curItem, Object currentSelections, Object[] submittedValues, HtmlBasicRenderer.OptionComponentInfo optionInfo) protected int
renderOptions
(FacesContext context, UIComponent component, SelectItemsIterator<SelectItem> items) protected void
renderSelect
(FacesContext context, UIComponent component) protected void
writeDefaultSize
(ResponseWriter writer, int itemCount) Methods inherited from class com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer
getNonOnChangeBehaviors, getNonOnClickSelectBehaviors, getValue, setSubmittedValue
Methods inherited from class com.sun.faces.renderkit.html_basic.HtmlBasicRenderer
augmentIdReference, convertClientId, decodeBehaviors, encodeRecursive, getBehaviorParameters, getChildren, getCurrentValue, getEndTextToRender, getFacet, getForComponent, getFormattedValue, getFormattedValue, getMessageIter, getParamList, getPassThruBehaviors, getRendersChildren, isBehaviorSource, rendererParamsNotNull, shouldDecode, shouldEncode, shouldEncodeChildren, shouldWriteIdAttribute, writeIdAttributeIfNecessary
Methods inherited from class jakarta.faces.render.Renderer
encodeChildren
-
Constructor Details
-
MenuRenderer
public MenuRenderer()
-
-
Method Details
-
convertSelectManyValue
public Object convertSelectManyValue(FacesContext context, UISelectMany uiSelectMany, String[] newValues) throws ConverterException - Throws:
ConverterException
-
convertSelectOneValue
public Object convertSelectOneValue(FacesContext context, UISelectOne uiSelectOne, String newValue) throws ConverterException - Throws:
ConverterException
-
decode
Description copied from class:Renderer
Decode any new state of the specified
UIComponent
from the request contained in the specifiedFacesContext
, and store that state on theUIComponent
.During decoding, events may be enqueued for later processing (by event listeners that have registered an interest), by calling
queueEvent()
on the associatedUIComponent
.- Overrides:
decode
in classHtmlBasicRenderer
- Parameters:
context
-FacesContext
for the request we are processingcomponent
-UIComponent
to be decoded.
-
encodeBegin
Description copied from class:Renderer
Render the beginning specified
UIComponent
to the output stream or writer associated with the response we are creating. If the conversion attempted in a previous call togetConvertedValue()
for this component failed, the state information saved during execution ofdecode()
should be used to reproduce the incorrect input.- Overrides:
encodeBegin
in classRenderer
- Parameters:
context
-FacesContext
for the request we are processingcomponent
-UIComponent
to be rendered- Throws:
IOException
- if an input/output error occurs while rendering
-
encodeEnd
Description copied from class:Renderer
Render the ending of the current state of the specified
UIComponent
, following the rules described forencodeBegin()
to acquire the appropriate value to be rendered.- Overrides:
encodeEnd
in classHtmlBasicRenderer
- Parameters:
context
-FacesContext
for the response we are creatingcomponent
-UIComponent
to be rendered- Throws:
IOException
- if an input/output error occurs while rendering
-
getConvertedValue
public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException Description copied from class:Renderer
Attempt to convert previously stored state information into an object of the type required for this component (optionally using the registered
Converter
for this component, if there is one). If conversion is successful, the new value should be returned from this method; if not, aConverterException
should be thrown.- Overrides:
getConvertedValue
in classHtmlBasicInputRenderer
- Parameters:
context
-FacesContext
for the request we are processingcomponent
-UIComponent
to be decoded.submittedValue
- a value stored on the component duringdecode
.- Returns:
- the converted value
- Throws:
ConverterException
- if the submitted value cannot be converted successfully.
-
convertSelectManyValuesForModel
protected Object convertSelectManyValuesForModel(FacesContext context, UISelectMany uiSelectMany, Class<?> modelType, String[] newValues) -
convertSelectManyValuesForArray
protected Object convertSelectManyValuesForArray(FacesContext context, UISelectMany uiSelectMany, Class<?> elementType, String[] newValues) throws ConverterException - Throws:
ConverterException
-
convertSelectManyValuesForCollection
protected Collection<Object> convertSelectManyValuesForCollection(FacesContext context, UISelectMany uiSelectMany, Class<? extends Collection<Object>> collectionType, String[] newValues) -
renderOption
protected boolean renderOption(FacesContext context, UIComponent component, UIComponent selectComponent, Converter<?> converter, SelectItem curItem, Object currentSelections, Object[] submittedValues, HtmlBasicRenderer.OptionComponentInfo optionInfo) throws IOException - Throws:
IOException
-
writeDefaultSize
- Throws:
IOException
-
containsaValue
-
getCurrentSelectedValues
-
getMultipleText
-
getSubmittedSelectedValues
-
isSelected
protected boolean isSelected(FacesContext context, UIComponent component, Object itemValue, Object valueArray, Converter<?> converter) -
renderOptions
protected int renderOptions(FacesContext context, UIComponent component, SelectItemsIterator<SelectItem> items) throws IOException - Throws:
IOException
-
renderSelect
- Throws:
IOException
-
coerceToModelType
-
createCollection
protected Collection<Object> createCollection(Collection<Object> collection, Class<? extends Collection<Object>> fallBackType) - Parameters:
collection
- a Collection instance- Returns:
- a new
Collection
instance or null if the instance cannot be created
-
cloneValue
Utility method to invoke the the
clone
method on the provided value.- Parameters:
value
- the value to clone- Returns:
- the result of invoking
clone()
ornull
if the value could not be cloned or does not implement theCloneable
interface
-
bestGuess
- Parameters:
type
- the target model typeinitialSize
- the initial size of theCollection
- Returns:
- a
Collection
instance that best matchestype
-
createCollectionFromHint
Create a collection from the provided hint.
- Parameters:
collectionTypeHint
- the Collection type as either a String or Class- Returns:
- a new Collection instance
-
isHideNoSelection
-