Class ComponentUtils
java.lang.Object
org.apache.myfaces.tobago.util.ComponentUtils
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptionstatic jakarta.faces.component.UIComponentcreateComponent(jakarta.faces.context.FacesContext facesContext, String componentType, RendererTypes rendererType, String clientId) static voidevaluateAutoFor(jakarta.faces.component.UIComponent component, Class<? extends jakarta.faces.component.UIComponent> clazz) Looks for the attribute "for" of the component.static StringevaluateClientId(jakarta.faces.context.FacesContext context, jakarta.faces.component.UIComponent component, String componentId) Resolves the real clientId.static StringevaluateClientIds(jakarta.faces.context.FacesContext context, jakarta.faces.component.UIComponent component, String[] componentIds) Resolves the real clientIds.static <T> TfindAncestor(jakarta.faces.component.UIComponent component, Class<T> type) static <T extends jakarta.faces.component.UIComponent>
 TSearches the children beneath the component and return the first component matching the type.static StringfindClientIdFor(jakarta.faces.component.UIComponent component, jakarta.faces.context.FacesContext facesContext) Looks for the attribute "for" in the component.static jakarta.faces.component.UIComponentfindComponent(jakarta.faces.component.UIComponent from, String relativeId) The search depends on the number of prefixed colons in the relativeId:static jakarta.faces.component.UIComponentfindComponent(jakarta.faces.context.FacesContext facesContext, jakarta.faces.component.UIComponent from, String relativeId) The search depends on the number of prefixed colons in the relativeId:static <T extends jakarta.faces.component.UIComponent>
 TfindDescendant(jakarta.faces.component.UIComponent component, Class<T> type) Searches the component tree beneath the component and return the first component matching the type.static <T extends jakarta.faces.component.UIComponent>
 List<T> findDescendantList(jakarta.faces.component.UIComponent component, Class<T> type) Searches the component tree beneath the component and return all component matching the type.static <T extends jakarta.faces.component.UIComponent>
 TfindFacetDescendant(jakarta.faces.component.UIComponent component, Facets facet, Class<T> type) Searches the component tree beneath the component and return the first component matching the type.static jakarta.faces.component.UIComponentfindFor(jakarta.faces.component.UIComponent component) static AbstractUIFormBasefindForm(jakarta.faces.component.UIComponent component) static List<jakarta.faces.component.UIComponent> findLayoutChildren(jakarta.faces.component.UIComponent container) static AbstractUIPagefindPage(jakarta.faces.component.UIComponent component) static AbstractUIPagefindPage(jakarta.faces.context.FacesContext facesContext) static AbstractUIPagefindPage(jakarta.faces.context.FacesContext context, jakarta.faces.component.UIComponent component) static ObjectfindParameter(jakarta.faces.component.UIComponent component, String name) static List<AbstractUIForm> findSubForms(jakarta.faces.component.UIComponent component) Find all sub forms of a component, and collects it.static jakarta.faces.component.UIViewRootfindViewRoot(jakarta.faces.view.facelets.FaceletContext faceletContext, jakarta.faces.component.UIComponent component) Tries to walk up the parents to find the UIViewRoot, if not found, then go to FaceletContext's FacesContext for the view root.static ObjectgetAttribute(jakarta.faces.component.UIComponent component, Attributes name) static booleangetBooleanAttribute(jakarta.faces.component.UIComponent component, Attributes name) static booleangetBooleanAttribute(jakarta.faces.component.UIComponent component, Attributes name, boolean defaultValue) static CharactergetCharacterAttribute(jakarta.faces.component.UIComponent component, Attributes name) static StringgetConfirmation(jakarta.faces.component.UIComponent component) returns the "confirmation" attribute or the value of the "confirmation" facet of a component.static ObjectgetConvertedValue(jakarta.faces.context.FacesContext facesContext, jakarta.faces.component.UIComponent component, String stringValue) static jakarta.faces.convert.ConvertergetConverter(jakarta.faces.context.FacesContext facesContext, jakarta.faces.component.UIComponent component, Object value) Deprecated, for removal: This API element is subject to removal in a future version.static ObjectgetDataAttribute(jakarta.faces.component.UIComponent component, String name) getDataAttributes(jakarta.faces.component.UIComponent component) static StringgetFacesMessageAsString(jakarta.faces.context.FacesContext facesContext, jakarta.faces.component.UIComponent component) static jakarta.faces.component.UIComponentstatic StringgetFormattedValue(jakarta.faces.context.FacesContext facesContext, jakarta.faces.component.UIComponent component, Object currentValue) Deprecated, for removal: This API element is subject to removal in a future version.static intgetIntAttribute(jakarta.faces.component.UIComponent component, Attributes name) static intgetIntAttribute(jakarta.faces.component.UIComponent component, Attributes name, int defaultValue) static jakarta.faces.application.FacesMessage.SeveritygetMaximumSeverity(jakarta.faces.component.UIComponent component) static jakarta.faces.application.FacesMessage.SeveritygetMaximumSeverity(List<jakarta.faces.application.FacesMessage> messages) static jakarta.faces.application.FacesMessage.SeveritygetMaximumSeverityOfChildrenMessages(jakarta.faces.context.FacesContext facesContext, jakarta.faces.component.NamingContainer container) static AbstractUIReloadgetReloadFacet(jakarta.faces.component.UIComponent component) static RendererBasegetRenderer(jakarta.faces.context.FacesContext facesContext, jakarta.faces.component.UIComponent component) static RendererBasegetRenderer(jakarta.faces.context.FacesContext facesContext, String family, String rendererType) static StringgetStringAttribute(jakarta.faces.component.UIComponent component, Attributes name) static StringgetStringAttribute(jakarta.faces.component.UIComponent component, Attributes name, String defaultValue) static booleanhasErrorMessages(jakarta.faces.context.FacesContext context) Deprecated, for removal: This API element is subject to removal in a future version.static booleanisError(jakarta.faces.component.UIComponent component) Deprecated, for removal: This API element is subject to removal in a future version.static booleanisError(jakarta.faces.component.UIInput uiInput) Deprecated, for removal: This API element is subject to removal in a future version.static booleanisFacetOf(jakarta.faces.component.UIComponent component, jakarta.faces.component.UIComponent parent) Deprecated, for removal: This API element is subject to removal in a future version.static booleanisInActiveForm(jakarta.faces.component.UIComponent component) Deprecated, for removal: This API element is subject to removal in a future version.static booleanisInPopup(jakarta.faces.component.UIComponent component) Deprecated, for removal: This API element is subject to removal in a future version.static booleanisOutputOnly(jakarta.faces.component.UIComponent component) Deprecated, for removal: This API element is subject to removal in a future version.static booleanisStandardHtmlRendererType(jakarta.faces.component.UIComponent component) static MarkupmarkupOfSeverity(jakarta.faces.application.FacesMessage.Severity maximumSeverity) static voidputDataAttribute(jakarta.faces.component.UIComponent component, Object name, Object value) Adding a data attribute to the component.static voidputDataAttributeWithPrefix(jakarta.faces.component.UIComponent component, DataAttributes name, Object value) Adding a data attribute to the component.static voidremoveAttribute(jakarta.faces.component.UIComponent component, Attributes name) static voidremoveFacet(jakarta.faces.component.UIComponent component, Facets facet) static voidresetPage(jakarta.faces.context.FacesContext context) Deprecated, for removal: This API element is subject to removal in a future version.static voidsetAttribute(jakarta.faces.component.UIComponent component, Attributes name, Object value) static voidsetFacet(jakarta.faces.component.UIComponent component, Facets facet, jakarta.faces.component.UIComponent child) static String[]
- 
Field Details- 
SUB_SEPARATOR- See Also:
 
- 
ACTION_ARGS
- 
ACTION_LISTENER_ARGS
- 
VALUE_CHANGE_LISTENER_ARGS
- 
VALIDATOR_ARGS
- 
LIST_SEPARATOR_CHARS- See Also:
 
- 
SET_SKIP_UNRENDERED
- 
DATA_ATTRIBUTES_KEYName of the map for data attributes in components. New in JSF 2.2.- Since:
- 2.0.0
- See Also:
 
 
- 
- 
Method Details- 
isStandardHtmlRendererTypepublic static boolean isStandardHtmlRendererType(jakarta.faces.component.UIComponent component) 
- 
hasErrorMessages@Deprecated(since="3.0.1", forRemoval=true) public static boolean hasErrorMessages(jakarta.faces.context.FacesContext context) Deprecated, for removal: This API element is subject to removal in a future version.
- 
getFacesMessageAsStringpublic static String getFacesMessageAsString(jakarta.faces.context.FacesContext facesContext, jakarta.faces.component.UIComponent component) 
- 
isInPopup@Deprecated(since="3.0.1", forRemoval=true) public static boolean isInPopup(jakarta.faces.component.UIComponent component) Deprecated, for removal: This API element is subject to removal in a future version.
- 
resetPage@Deprecated(since="3.0.1", forRemoval=true) public static void resetPage(jakarta.faces.context.FacesContext context) Deprecated, for removal: This API element is subject to removal in a future version.
- 
findViewRootpublic static jakarta.faces.component.UIViewRoot findViewRoot(jakarta.faces.view.facelets.FaceletContext faceletContext, jakarta.faces.component.UIComponent component) Tries to walk up the parents to find the UIViewRoot, if not found, then go to FaceletContext's FacesContext for the view root.
- 
findPagepublic static AbstractUIPage findPage(jakarta.faces.context.FacesContext context, jakarta.faces.component.UIComponent component) 
- 
findPage
- 
findPage
- 
findForm
- 
findAncestor
- 
findSubFormsFind all sub forms of a component, and collects it. It does not find sub forms of sub forms.
- 
findDescendantpublic static <T extends jakarta.faces.component.UIComponent> T findDescendant(jakarta.faces.component.UIComponent component, Class<T> type) Searches the component tree beneath the component and return the first component matching the type.
- 
findFacetDescendant
- 
findChildpublic static <T extends jakarta.faces.component.UIComponent> T findChild(jakarta.faces.component.UIComponent component, Class<T> type) Searches the children beneath the component and return the first component matching the type.
- 
findDescendantList
- 
findClientIdForpublic static String findClientIdFor(jakarta.faces.component.UIComponent component, jakarta.faces.context.FacesContext facesContext) Looks for the attribute "for" in the component. If there is any search for the component which is referenced by the "for" attribute, and return their clientId. If there is no "for" attribute, return the "clientId" of the parent (if it has a parent). This is useful for labels.
- 
findForpublic static jakarta.faces.component.UIComponent findFor(jakarta.faces.component.UIComponent component) 
- 
evaluateAutoForpublic static void evaluateAutoFor(jakarta.faces.component.UIComponent component, Class<? extends jakarta.faces.component.UIComponent> clazz) Looks for the attribute "for" of the component. In case that the value is equals to "@auto" the children of the parent will be checked if they are of the type of the parameter clazz. The "id" of the first one will be used to reset the "for" attribute of the component.
- 
isInActiveForm@Deprecated(since="4.0.0", forRemoval=true) public static boolean isInActiveForm(jakarta.faces.component.UIComponent component) Deprecated, for removal: This API element is subject to removal in a future version.
- 
getMaximumSeveritypublic static jakarta.faces.application.FacesMessage.Severity getMaximumSeverity(jakarta.faces.component.UIComponent component) 
- 
getMaximumSeveritypublic static jakarta.faces.application.FacesMessage.Severity getMaximumSeverity(List<jakarta.faces.application.FacesMessage> messages) 
- 
isError@Deprecated(since="5.0.0", forRemoval=true) public static boolean isError(jakarta.faces.component.UIInput uiInput) Deprecated, for removal: This API element is subject to removal in a future version.
- 
isError@Deprecated(since="5.0.0", forRemoval=true) public static boolean isError(jakarta.faces.component.UIComponent component) Deprecated, for removal: This API element is subject to removal in a future version.
- 
isOutputOnly@Deprecated(since="5.0.0", forRemoval=true) public static boolean isOutputOnly(jakarta.faces.component.UIComponent component) Deprecated, for removal: This API element is subject to removal in a future version.
- 
getAttribute
- 
getBooleanAttributepublic static boolean getBooleanAttribute(jakarta.faces.component.UIComponent component, Attributes name) 
- 
getBooleanAttributepublic static boolean getBooleanAttribute(jakarta.faces.component.UIComponent component, Attributes name, boolean defaultValue) 
- 
getStringAttributepublic static String getStringAttribute(jakarta.faces.component.UIComponent component, Attributes name) 
- 
getStringAttributepublic static String getStringAttribute(jakarta.faces.component.UIComponent component, Attributes name, String defaultValue) 
- 
getIntAttribute
- 
getIntAttributepublic static int getIntAttribute(jakarta.faces.component.UIComponent component, Attributes name, int defaultValue) 
- 
getCharacterAttributepublic static Character getCharacterAttribute(jakarta.faces.component.UIComponent component, Attributes name) 
- 
setAttributepublic static void setAttribute(jakarta.faces.component.UIComponent component, Attributes name, Object value) 
- 
removeAttribute
- 
getFacetpublic static jakarta.faces.component.UIComponent getFacet(jakarta.faces.component.UIComponent component, Facets facet) 
- 
setFacetpublic static void setFacet(jakarta.faces.component.UIComponent component, Facets facet, jakarta.faces.component.UIComponent child) 
- 
removeFacet
- 
getReloadFacet
- 
isFacetOf@Deprecated(since="5.0.0", forRemoval=true) public static boolean isFacetOf(jakarta.faces.component.UIComponent component, jakarta.faces.component.UIComponent parent) Deprecated, for removal: This API element is subject to removal in a future version.
- 
getRendererpublic static RendererBase getRenderer(jakarta.faces.context.FacesContext facesContext, jakarta.faces.component.UIComponent component) 
- 
getRendererpublic static RendererBase getRenderer(jakarta.faces.context.FacesContext facesContext, String family, String rendererType) 
- 
findParameter
- 
findComponentpublic static jakarta.faces.component.UIComponent findComponent(jakarta.faces.component.UIComponent from, String relativeId) The search depends on the number of prefixed colons in the relativeId: - number of prefixed colons == 0
- fully relative
- number of prefixed colons == 1
- absolute (still normal findComponent syntax)
- number of prefixed colons == 2
- search in the current naming container (same as 0 colons)
- number of prefixed colons == 3
- search in the parent naming container of the current naming container
- number of prefixed colons > 3
- go to the next parent naming container for each additional colon
 If a literal is specified: to use more than one identifier the identifiers must be space delimited. 
- 
findComponentpublic static jakarta.faces.component.UIComponent findComponent(jakarta.faces.context.FacesContext facesContext, jakarta.faces.component.UIComponent from, String relativeId) The search depends on the number of prefixed colons in the relativeId: - number of prefixed colons == 0
- fully relative
- number of prefixed colons == 1
- absolute (still normal findComponent syntax)
- number of prefixed colons == 2
- search in the current naming container (same as 0 colons)
- number of prefixed colons == 3
- search in the parent naming container of the current naming container
- number of prefixed colons > 3
- go to the next parent naming container for each additional colon
 If a literal is specified: to use more than one identifier the identifiers must be space delimited. 
- 
evaluateClientIds
- 
evaluateClientId
- 
splitList
- 
getConvertedValue
- 
markupOfSeveritypublic static Markup markupOfSeverity(jakarta.faces.application.FacesMessage.Severity maximumSeverity) 
- 
getMaximumSeverityOfChildrenMessagespublic static jakarta.faces.application.FacesMessage.Severity getMaximumSeverityOfChildrenMessages(jakarta.faces.context.FacesContext facesContext, jakarta.faces.component.NamingContainer container) 
- 
putDataAttributeWithPrefixpublic static void putDataAttributeWithPrefix(jakarta.faces.component.UIComponent component, DataAttributes name, Object value) Adding a data attribute to the component. The name must start with "data-", e. g. "data-tobago-foo" or "data-bar"
- 
putDataAttribute
- 
getDataAttributes
- 
getDataAttribute
- 
getConverter@Deprecated(since="5.0.0", forRemoval=true) public static jakarta.faces.convert.Converter getConverter(jakarta.faces.context.FacesContext facesContext, jakarta.faces.component.UIComponent component, Object value) Deprecated, for removal: This API element is subject to removal in a future version.May return null, if no converter can be find.
- 
getFormattedValue@Deprecated(since="5.0.0", forRemoval=true) public static String getFormattedValue(jakarta.faces.context.FacesContext facesContext, jakarta.faces.component.UIComponent component, Object currentValue) throws jakarta.faces.convert.ConverterException Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
- jakarta.faces.convert.ConverterException
 
- 
createComponentpublic static jakarta.faces.component.UIComponent createComponent(jakarta.faces.context.FacesContext facesContext, String componentType, RendererTypes rendererType, String clientId) 
- 
findLayoutChildrenpublic static List<jakarta.faces.component.UIComponent> findLayoutChildren(jakarta.faces.component.UIComponent container) 
- 
getConfirmationreturns the "confirmation" attribute or the value of the "confirmation" facet of a component.- Since:
- Tobago 4.4.0
 
 
- 
RendererBase.getConverter(jakarta.faces.context.FacesContext, T, java.lang.Object).