public final class FacesUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <T extends javax.faces.component.UIComponent> |
createComponent(String componentType,
String rendererType)
Create a component using either the JSF 2.x
createComponent( context, componentType, rendererType ) method, or the JSF 1.x
createComponent( componentType ) method. |
static String |
createUniqueId()
Custom implementation of
UIViewRoot.createUniqueId . |
static boolean |
isExpression(String value)
Return
true if the specified value conforms to the syntax requirements of a
value binding expression. |
static boolean |
isJsf2() |
static boolean |
isPartialStateSavingDisabled() |
static boolean |
isValidationFailed() |
static Matcher |
matchExpression(String value) |
static void |
render(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component) |
static void |
setStyleAndStyleClass(javax.faces.component.UIComponent component,
String style,
String styleClass)
Sets the given style and styleClass on the given Component.
|
static String |
unwrapExpression(String value) |
static String |
wrapExpression(String value) |
public static boolean isExpression(String value)
true
if the specified value conforms to the syntax requirements of a
value binding expression.
This method is a mirror of the one in UIComponentTag.isValueReference
, but that
one is deprecated so may be removed in the future.
value
- The value to evaluateNullPointerException
- if value
is null
public static String unwrapExpression(String value)
public static String wrapExpression(String value)
public static void render(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws IOException
IOException
public static boolean isJsf2()
public static boolean isValidationFailed()
public static boolean isPartialStateSavingDisabled()
public static <T extends javax.faces.component.UIComponent> T createComponent(String componentType, String rendererType)
createComponent( context, componentType, rendererType )
method, or the JSF 1.x
createComponent( componentType )
method. The former can be important for JSF 2.x
controls that need to dynamically include additional resources (such as JavaScript/CSS
files). See this forum discussion.public static void setStyleAndStyleClass(javax.faces.component.UIComponent component, String style, String styleClass)
JSF does not provide a common interface for all UIComponent
s that support
style
and styleClass
, so we must interrogate their attributes
directly.
public static String createUniqueId()
UIViewRoot.createUniqueId
. The 'proper' approach
requires traversing the component tree, which could be expensive. See
http://java.net/jira/browse/JAVASERVERFACES-2283Copyright © 2015. All Rights Reserved.