public class ComponentUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
SKIP_ITERATION_HINT |
static EnumSet<javax.faces.component.visit.VisitHint> |
VISIT_HINTS_SKIP_UNRENDERED |
Constructor and Description |
---|
ComponentUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
escapeJQueryId(String id) |
static String |
escapeText(String text)
Duplicate code from json-simple project under apache license
http://code.google.com/p/json-simple/source/browse/trunk/src/org/json/simple/JSONValue.java
|
static String |
escapeXml(String string)
Replace special characters with XML escapes:
|
static String |
findComponentClientId(String id) |
static javax.faces.application.NavigationCase |
findNavigationCase(javax.faces.context.FacesContext context,
String outcome) |
static javax.faces.component.UIComponent |
findParentForm(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Deprecated.
|
static javax.faces.convert.Converter |
getConverter(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Finds appropriate converter for a given value holder
|
static String |
getResourceURL(javax.faces.context.FacesContext context,
String value) |
static Map<String,List<String>> |
getUIParams(javax.faces.component.UIComponent component) |
static String |
getValueToRender(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component) |
static String |
getValueToRender(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
Object value)
Algorithm works as follows;
- If it's an input component, submitted value is checked first since it'd be the value to be used in case validation errors
terminates jsf lifecycle
- Finally the value of the component is retrieved from backing bean and if there's a converter, converted value is returned
|
static boolean |
isRTL(javax.faces.context.FacesContext context,
RTLAware component) |
static boolean |
isSkipIteration(javax.faces.component.visit.VisitContext visitContext) |
static boolean |
isValueBlank(String value) |
static void |
processDecodesOfFacetsAndChilds(javax.faces.component.UIComponent component,
javax.faces.context.FacesContext context) |
static void |
processUpdatesOfFacetsAndChilds(javax.faces.component.UIComponent component,
javax.faces.context.FacesContext context) |
static void |
processValidatorsOfFacetsAndChilds(javax.faces.component.UIComponent component,
javax.faces.context.FacesContext context) |
static String |
replaceNewLineWithHtml(String text) |
static String |
resolveWidgetVar(javax.faces.context.FacesContext context,
Widget widget) |
static String |
resolveWidgetVar(String expression) |
static String |
resolveWidgetVar(String expression,
javax.faces.component.UIComponent component) |
static Locale |
toLocale(String str)
Implementation from Apache Commons Lang
|
public static final EnumSet<javax.faces.component.visit.VisitHint> VISIT_HINTS_SKIP_UNRENDERED
public static final String SKIP_ITERATION_HINT
public static String getValueToRender(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
public static String getValueToRender(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object value)
context
- FacesContext instancecomponent
- UIComponent instance whose value will be returnedvalue
- The value of UIComponent if already evaluated outside. E.g. in the renderer.public static javax.faces.convert.Converter getConverter(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
context
- FacesContext instancecomponent
- ValueHolder instance to look converter forpublic static String resolveWidgetVar(String expression, javax.faces.component.UIComponent component)
public static boolean isValueBlank(String value)
public static boolean isRTL(javax.faces.context.FacesContext context, RTLAware component)
public static void processDecodesOfFacetsAndChilds(javax.faces.component.UIComponent component, javax.faces.context.FacesContext context)
public static void processValidatorsOfFacetsAndChilds(javax.faces.component.UIComponent component, javax.faces.context.FacesContext context)
public static void processUpdatesOfFacetsAndChilds(javax.faces.component.UIComponent component, javax.faces.context.FacesContext context)
public static javax.faces.application.NavigationCase findNavigationCase(javax.faces.context.FacesContext context, String outcome)
public static Map<String,List<String>> getUIParams(javax.faces.component.UIComponent component)
public static String getResourceURL(javax.faces.context.FacesContext context, String value)
public static boolean isSkipIteration(javax.faces.component.visit.VisitContext visitContext)
public static String resolveWidgetVar(javax.faces.context.FacesContext context, Widget widget)
public static String escapeText(String text)
public static String escapeXml(String string)
& (ampersand) is replaced by & < (less than) is replaced by < > (greater than) is replaced by > " (double quote) is replaced by "
string
- The string to be escaped.@Deprecated public static javax.faces.component.UIComponent findParentForm(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
ComponentTraversalUtils.closestForm(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
instead.context
- component
- Copyright © 2015. All rights reserved.