public final class ComponentUtils extends Object
Modifier and Type | Field and Description |
---|---|
static Class[] |
ACTION_ARGS |
static Class[] |
ACTION_LISTENER_ARGS |
static String |
DATA_ATTRIBUTES_KEY
Name of the map for data attributes in components.
|
static String |
LIST_SEPARATOR_CHARS |
static String |
SUB_SEPARATOR |
static Class[] |
VALIDATOR_ARGS |
static Class[] |
VALUE_CHANGE_LISTENER_ARGS |
Modifier and Type | Method and Description |
---|---|
static javax.faces.component.UIComponent |
createComponent(javax.faces.context.FacesContext facesContext,
String componentType,
RendererTypes rendererType,
String clientId) |
static void |
evaluateAutoFor(javax.faces.component.UIComponent component,
Class<? extends javax.faces.component.UIComponent> clazz)
Looks for the attribute "for" of the component.
|
static String |
evaluateClientId(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String componentId)
Resolves the real clientId.
|
static String |
evaluateClientIds(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String[] componentIds)
Resolves the real clientIds.
|
static <T> T |
findAncestor(javax.faces.component.UIComponent component,
Class<T> type) |
static <T extends javax.faces.component.UIComponent> |
findChild(javax.faces.component.UIComponent component,
Class<T> type)
Searches the children beneath the component and return the first component matching the type.
|
static String |
findClientIdFor(javax.faces.component.UIComponent component,
javax.faces.context.FacesContext facesContext)
Looks for the attribute "for" in the component.
|
static javax.faces.component.UIComponent |
findComponent(javax.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.
|
static <T extends javax.faces.component.UIComponent> |
findDescendant(javax.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 javax.faces.component.UIComponent> |
findDescendantList(javax.faces.component.UIComponent component,
Class<T> type)
Searches the component tree beneath the component and return all component matching the type.
|
static <T extends javax.faces.component.UIComponent> |
findFacetDescendant(javax.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 javax.faces.component.UIComponent |
findFor(javax.faces.component.UIComponent component) |
static AbstractUIFormBase |
findForm(javax.faces.component.UIComponent component) |
static List<javax.faces.component.UIComponent> |
findLayoutChildren(javax.faces.component.UIComponent container) |
static AbstractUIPage |
findPage(javax.faces.context.FacesContext facesContext) |
static AbstractUIPage |
findPage(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component) |
static AbstractUIPage |
findPage(javax.faces.component.UIComponent component) |
static Object |
findParameter(javax.faces.component.UIComponent component,
String name) |
static List<AbstractUIForm> |
findSubForms(javax.faces.component.UIComponent component)
Find all sub forms of a component, and collects it.
|
static javax.faces.component.UIViewRoot |
findViewRoot(javax.faces.view.facelets.FaceletContext faceletContext,
javax.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 Object |
getAttribute(javax.faces.component.UIComponent component,
Attributes name) |
static boolean |
getBooleanAttribute(javax.faces.component.UIComponent component,
Attributes name) |
static boolean |
getBooleanAttribute(javax.faces.component.UIComponent component,
Attributes name,
boolean defaultValue) |
static Character |
getCharacterAttribute(javax.faces.component.UIComponent component,
Attributes name) |
static Object |
getConvertedValue(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component,
String stringValue) |
static javax.faces.convert.Converter |
getConverter(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component,
Object value)
May return null, if no converter can be find.
|
static Object |
getDataAttribute(javax.faces.component.UIComponent component,
String name) |
static Map<Object,Object> |
getDataAttributes(javax.faces.component.UIComponent component) |
static String |
getFacesMessageAsString(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component) |
static javax.faces.component.UIComponent |
getFacet(javax.faces.component.UIComponent component,
Facets facet) |
static String |
getFormattedValue(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component,
Object currentValue) |
static int |
getIntAttribute(javax.faces.component.UIComponent component,
Attributes name) |
static int |
getIntAttribute(javax.faces.component.UIComponent component,
Attributes name,
int defaultValue) |
static javax.faces.application.FacesMessage.Severity |
getMaximumSeverity(List<javax.faces.application.FacesMessage> messages) |
static javax.faces.application.FacesMessage.Severity |
getMaximumSeverity(javax.faces.component.UIComponent component) |
static javax.faces.application.FacesMessage.Severity |
getMaximumSeverityOfChildrenMessages(javax.faces.context.FacesContext facesContext,
javax.faces.component.NamingContainer container) |
static RendererBase |
getRenderer(javax.faces.context.FacesContext facesContext,
String family,
String rendererType) |
static RendererBase |
getRenderer(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component) |
static String |
getStringAttribute(javax.faces.component.UIComponent component,
Attributes name) |
static String |
getStringAttribute(javax.faces.component.UIComponent component,
Attributes name,
String defaultValue) |
static boolean |
hasErrorMessages(javax.faces.context.FacesContext context)
Deprecated.
since 3.0.1
|
static boolean |
isError(javax.faces.component.UIComponent component) |
static boolean |
isError(javax.faces.component.UIInput uiInput) |
static boolean |
isFacetOf(javax.faces.component.UIComponent component,
javax.faces.component.UIComponent parent) |
static boolean |
isInActiveForm(javax.faces.component.UIComponent component)
Deprecated.
since 4.0.0
|
static boolean |
isInPopup(javax.faces.component.UIComponent component)
Deprecated.
since 3.0.1
|
static boolean |
isOutputOnly(javax.faces.component.UIComponent component) |
static Markup |
markupOfSeverity(javax.faces.application.FacesMessage.Severity maximumSeverity) |
static void |
putDataAttribute(javax.faces.component.UIComponent component,
Object name,
Object value)
Adding a data attribute to the component.
|
static void |
putDataAttributeWithPrefix(javax.faces.component.UIComponent component,
DataAttributes name,
Object value)
Adding a data attribute to the component.
|
static void |
removeAttribute(javax.faces.component.UIComponent component,
Attributes name) |
static void |
removeFacet(javax.faces.component.UIComponent component,
Facets facet) |
static void |
resetPage(javax.faces.context.FacesContext context)
Deprecated.
since 3.0.1
|
static void |
setAttribute(javax.faces.component.UIComponent component,
Attributes name,
Object value) |
static void |
setFacet(javax.faces.component.UIComponent component,
Facets facet,
javax.faces.component.UIComponent child) |
static String[] |
splitList(String renderers) |
public static final String SUB_SEPARATOR
public static final Class[] ACTION_ARGS
public static final Class[] ACTION_LISTENER_ARGS
public static final Class[] VALUE_CHANGE_LISTENER_ARGS
public static final Class[] VALIDATOR_ARGS
public static final String LIST_SEPARATOR_CHARS
public static final String DATA_ATTRIBUTES_KEY
@Deprecated public static boolean hasErrorMessages(javax.faces.context.FacesContext context)
public static String getFacesMessageAsString(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component)
@Deprecated public static boolean isInPopup(javax.faces.component.UIComponent component)
@Deprecated public static void resetPage(javax.faces.context.FacesContext context)
public static javax.faces.component.UIViewRoot findViewRoot(javax.faces.view.facelets.FaceletContext faceletContext, javax.faces.component.UIComponent component)
public static AbstractUIPage findPage(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
public static AbstractUIPage findPage(javax.faces.component.UIComponent component)
public static AbstractUIPage findPage(javax.faces.context.FacesContext facesContext)
public static AbstractUIFormBase findForm(javax.faces.component.UIComponent component)
public static <T> T findAncestor(javax.faces.component.UIComponent component, Class<T> type)
public static List<AbstractUIForm> findSubForms(javax.faces.component.UIComponent component)
public static <T extends javax.faces.component.UIComponent> T findDescendant(javax.faces.component.UIComponent component, Class<T> type)
public static <T extends javax.faces.component.UIComponent> T findFacetDescendant(javax.faces.component.UIComponent component, Facets facet, Class<T> type)
public static <T extends javax.faces.component.UIComponent> T findChild(javax.faces.component.UIComponent component, Class<T> type)
public static <T extends javax.faces.component.UIComponent> List<T> findDescendantList(javax.faces.component.UIComponent component, Class<T> type)
public static String findClientIdFor(javax.faces.component.UIComponent component, javax.faces.context.FacesContext facesContext)
public static javax.faces.component.UIComponent findFor(javax.faces.component.UIComponent component)
public static void evaluateAutoFor(javax.faces.component.UIComponent component, Class<? extends javax.faces.component.UIComponent> clazz)
@Deprecated public static boolean isInActiveForm(javax.faces.component.UIComponent component)
public static javax.faces.application.FacesMessage.Severity getMaximumSeverity(javax.faces.component.UIComponent component)
public static javax.faces.application.FacesMessage.Severity getMaximumSeverity(List<javax.faces.application.FacesMessage> messages)
public static boolean isError(javax.faces.component.UIInput uiInput)
public static boolean isError(javax.faces.component.UIComponent component)
public static boolean isOutputOnly(javax.faces.component.UIComponent component)
public static Object getAttribute(javax.faces.component.UIComponent component, Attributes name)
public static boolean getBooleanAttribute(javax.faces.component.UIComponent component, Attributes name)
public static boolean getBooleanAttribute(javax.faces.component.UIComponent component, Attributes name, boolean defaultValue)
public static String getStringAttribute(javax.faces.component.UIComponent component, Attributes name)
public static String getStringAttribute(javax.faces.component.UIComponent component, Attributes name, String defaultValue)
public static int getIntAttribute(javax.faces.component.UIComponent component, Attributes name)
public static int getIntAttribute(javax.faces.component.UIComponent component, Attributes name, int defaultValue)
public static Character getCharacterAttribute(javax.faces.component.UIComponent component, Attributes name)
public static void setAttribute(javax.faces.component.UIComponent component, Attributes name, Object value)
public static void removeAttribute(javax.faces.component.UIComponent component, Attributes name)
public static javax.faces.component.UIComponent getFacet(javax.faces.component.UIComponent component, Facets facet)
public static void setFacet(javax.faces.component.UIComponent component, Facets facet, javax.faces.component.UIComponent child)
public static void removeFacet(javax.faces.component.UIComponent component, Facets facet)
public static boolean isFacetOf(javax.faces.component.UIComponent component, javax.faces.component.UIComponent parent)
public static RendererBase getRenderer(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component)
public static RendererBase getRenderer(javax.faces.context.FacesContext facesContext, String family, String rendererType)
public static Object findParameter(javax.faces.component.UIComponent component, String name)
public static javax.faces.component.UIComponent findComponent(javax.faces.component.UIComponent from, String relativeId)
The search depends on the number of prefixed colons in the relativeId:
If a literal is specified: to use more than one identifier the identifiers must be space delimited.
public static String evaluateClientIds(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, String[] componentIds)
public static String evaluateClientId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, String componentId)
public static Object getConvertedValue(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, String stringValue)
public static Markup markupOfSeverity(javax.faces.application.FacesMessage.Severity maximumSeverity)
public static javax.faces.application.FacesMessage.Severity getMaximumSeverityOfChildrenMessages(javax.faces.context.FacesContext facesContext, javax.faces.component.NamingContainer container)
public static void putDataAttributeWithPrefix(javax.faces.component.UIComponent component, DataAttributes name, Object value)
public static void putDataAttribute(javax.faces.component.UIComponent component, Object name, Object value)
public static Map<Object,Object> getDataAttributes(javax.faces.component.UIComponent component)
public static Object getDataAttribute(javax.faces.component.UIComponent component, String name)
public static javax.faces.convert.Converter getConverter(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, Object value)
public static String getFormattedValue(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, Object currentValue) throws javax.faces.convert.ConverterException
javax.faces.convert.ConverterException
public static javax.faces.component.UIComponent createComponent(javax.faces.context.FacesContext facesContext, String componentType, RendererTypes rendererType, String clientId)
public static List<javax.faces.component.UIComponent> findLayoutChildren(javax.faces.component.UIComponent container)
Copyright © 2002–2018 The Apache Software Foundation. All rights reserved.