Package org.apache.myfaces.renderkit
Class RendererUtils
- java.lang.Object
- 
- org.apache.myfaces.renderkit.RendererUtils
 
- 
 public final class RendererUtils extends Object 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringEMPTY_STRINGstatic StringRES_NOT_FOUNDstatic StringSEQUENCE_PARAM
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcheckParamValidity(FacesContext facesContext, UIComponent uiComponent, Class compClass)static ConverterfindUIOutputConverter(FacesContext facesContext, UIOutput component)Find the proper Converter for the given UIOutput component.static ConverterfindUISelectManyConverter(FacesContext facesContext, UISelectMany component, boolean considerValueType)Find proper Converter for the entries in the associated Collection or array of the given UISelectMany as specified in API Doc of UISelectMany.static BooleangetBooleanValue(UIComponent component)static booleangetBooleanValue(String attribute, Object value, boolean defaultValue)static ObjectgetConvertedUIOutputValue(FacesContext facesContext, UIOutput output, Object submittedValue)static ObjectgetConvertedUISelectManyValue(FacesContext facesContext, UISelectMany selectMany, Object submittedValue)Invokes getConvertedUISelectManyValue() with considerValueType = false, thus implementing the standard behavior of the spec (valueType comes from Tomahawk).static ObjectgetConvertedUISelectManyValue(FacesContext facesContext, UISelectMany selectMany, Object submittedValue, boolean considerValueType)Gets the converted value of a UISelectMany component.static ObjectgetConvertedUISelectOneValue(FacesContext facesContext, UISelectOne output, Object submittedValue)static StringgetIconSrc(FacesContext facesContext, UIComponent component, String attributeName)Checks for name/library attributes on component and if they are avaliable, createsResourceand returns it's path suitable for rendering.static ObjectgetObjectValue(UIComponent component)static SetgetSelectedValuesAsSet(FacesContext context, UIComponent component, Converter converter, UISelectMany uiSelectMany)Convenient utility method that returns the currently selected values of a UISelectMany component as a Set, of which the contains method can then be easily used to determine if a value is currently selected.static List<SelectItem>getSelectItemList(UIComponent uiComponent, FacesContext facesContext)static StringgetStringFromSubmittedValueOrLocalValueReturnNull(FacesContext facesContext, UIComponent component)static StringgetStringValue(FacesContext context, jakarta.el.ValueExpression ve)static StringgetStringValue(FacesContext facesContext, UIComponent component)static SetgetSubmittedValuesAsSet(FacesContext context, UIComponent component, Converter converter, UISelectMany uiSelectMany)Convenient utility method that returns the currently submitted values of a UISelectMany component as a Set, of which the contains method can then be easily used to determine if a select item is currently selected.static booleanisDefaultAttributeValue(Object value)See Faces Spec.static voidrenderChildren(FacesContext facesContext, UIComponent component)static StringtoResourceUri(FacesContext facesContext, Object o)Coerces an object into a resource URI, calling the view-handler.
 
- 
- 
- 
Field Detail- 
EMPTY_STRINGpublic static final String EMPTY_STRING - See Also:
- Constant Field Values
 
 - 
SEQUENCE_PARAMpublic static final String SEQUENCE_PARAM - See Also:
- Constant Field Values
 
 - 
RES_NOT_FOUNDpublic static final String RES_NOT_FOUND - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getBooleanValuepublic static Boolean getBooleanValue(UIComponent component) 
 - 
getObjectValuepublic static Object getObjectValue(UIComponent component) 
 - 
getStringValuepublic static String getStringValue(FacesContext context, jakarta.el.ValueExpression ve) 
 - 
getStringValuepublic static String getStringValue(FacesContext facesContext, UIComponent component) 
 - 
getStringFromSubmittedValueOrLocalValueReturnNullpublic static String getStringFromSubmittedValueOrLocalValueReturnNull(FacesContext facesContext, UIComponent component) 
 - 
isDefaultAttributeValuepublic static boolean isDefaultAttributeValue(Object value) See Faces Spec. 8.5 Table 8-1- Parameters:
- value-
- Returns:
- boolean
 
 - 
findUIOutputConverterpublic static Converter findUIOutputConverter(FacesContext facesContext, UIOutput component) throws FacesException Find the proper Converter for the given UIOutput component.- Returns:
- the Converter or null if no Converter specified or needed
- Throws:
- FacesException- if the Converter could not be created
 
 - 
findUISelectManyConverterpublic static Converter findUISelectManyConverter(FacesContext facesContext, UISelectMany component, boolean considerValueType) Find proper Converter for the entries in the associated Collection or array of the given UISelectMany as specified in API Doc of UISelectMany. If considerValueType is true, the valueType attribute will be used in addition to the standard algorithm to get a valid converter.- Returns:
- the Converter or null if no Converter specified or needed
- Throws:
- FacesException- if the Converter could not be created
 
 - 
checkParamValiditypublic static void checkParamValidity(FacesContext facesContext, UIComponent uiComponent, Class compClass) 
 - 
renderChildrenpublic static void renderChildren(FacesContext facesContext, UIComponent component) throws IOException - Throws:
- IOException
 
 - 
getSelectItemListpublic static List<SelectItem> getSelectItemList(UIComponent uiComponent, FacesContext facesContext) 
 - 
getSubmittedValuesAsSetpublic static Set getSubmittedValuesAsSet(FacesContext context, UIComponent component, Converter converter, UISelectMany uiSelectMany) Convenient utility method that returns the currently submitted values of a UISelectMany component as a Set, of which the contains method can then be easily used to determine if a select item is currently selected. Calling the contains method of this Set with the renderable (String converted) item value as argument returns true if this item is selected.- Parameters:
- uiSelectMany-
- Returns:
- Set containing all currently selected values
 
 - 
getSelectedValuesAsSetpublic static Set getSelectedValuesAsSet(FacesContext context, UIComponent component, Converter converter, UISelectMany uiSelectMany) Convenient utility method that returns the currently selected values of a UISelectMany component as a Set, of which the contains method can then be easily used to determine if a value is currently selected. Calling the contains method of this Set with the item value as argument returns true if this item is selected.- Parameters:
- uiSelectMany-
- Returns:
- Set containing all currently selected values
 
 - 
getConvertedUISelectOneValuepublic static Object getConvertedUISelectOneValue(FacesContext facesContext, UISelectOne output, Object submittedValue) 
 - 
getConvertedUIOutputValuepublic static Object getConvertedUIOutputValue(FacesContext facesContext, UIOutput output, Object submittedValue) throws ConverterException - Throws:
- ConverterException
 
 - 
getConvertedUISelectManyValuepublic static Object getConvertedUISelectManyValue(FacesContext facesContext, UISelectMany selectMany, Object submittedValue) throws ConverterException Invokes getConvertedUISelectManyValue() with considerValueType = false, thus implementing the standard behavior of the spec (valueType comes from Tomahawk).- Parameters:
- facesContext-
- selectMany-
- submittedValue-
- Returns:
- Throws:
- ConverterException
 
 - 
getConvertedUISelectManyValuepublic static Object getConvertedUISelectManyValue(FacesContext facesContext, UISelectMany selectMany, Object submittedValue, boolean considerValueType) throws ConverterException Gets the converted value of a UISelectMany component.- Parameters:
- facesContext-
- selectMany-
- submittedValue-
- considerValueType- if true, the valueType attribute of the component will also be used (applies for Tomahawk UISelectMany components)
- Returns:
- Throws:
- ConverterException
 
 - 
getBooleanValuepublic static boolean getBooleanValue(String attribute, Object value, boolean defaultValue) 
 - 
getIconSrcpublic static String getIconSrc(FacesContext facesContext, UIComponent component, String attributeName) Checks for name/library attributes on component and if they are avaliable, createsResourceand returns it's path suitable for rendering. If component doesn't have name/library gets value for attribute namedattributeNamereturns it processed withtoResourceUri(jakarta.faces.context.FacesContext, java.lang.Object)- Parameters:
- facesContext- a- FacesContext
- component- a- UIComponent
- attributeName- name of attribute that represents "image", "icon", "source", ...
 
 - 
toResourceUripublic static String toResourceUri(FacesContext facesContext, Object o) Coerces an object into a resource URI, calling the view-handler.
 
- 
 
-