|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.myfaces.trinidad.util.ComponentUtils
public final class ComponentUtils
Utility functions used by the Apache Trinidad components.
Method Summary | |
---|---|
static javax.faces.component.UIComponent |
findRelativeComponent(javax.faces.component.UIComponent from,
String scopedId)
Find a component relative to another. |
static String |
getLogicalScopedIdForComponent(javax.faces.component.UIComponent targetComponent,
javax.faces.component.UIComponent baseComponent)
Gets the logical scoped identifier for the target component. |
static javax.faces.component.UIComponent |
getNonFlatteningAncestor(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Returns the nearest ancestor component, skipping over any flattening components. |
static String |
getScopedIdForComponent(javax.faces.component.UIComponent targetComponent,
javax.faces.component.UIComponent baseComponent)
Gets the scoped identifier for the target component. |
static boolean |
isSkipIterationVisit(javax.faces.component.visit.VisitContext visitContext)
|
static boolean |
resolveBoolean(Object value)
Utility method for component code that transforms Object->boolean. |
static boolean |
resolveBoolean(Object value,
boolean defaultValue)
Utility method for component code that transforms Object->boolean. |
static char |
resolveCharacter(Character value)
Utility method for component code that transforms Character->character. |
static char |
resolveCharacter(Character value,
char defaultValue)
Utility method for component code that transforms Character->character. |
static Date |
resolveDate(Object value)
Utility method for code that transforms Object->Date |
static Date |
resolveDate(Object value,
Date defaultValue)
Utility method for code that transforms Object->Date |
static double |
resolveDouble(Object value)
Utility method for component code that transforms an Object (which must be a java.lang.Number) into a double. |
static double |
resolveDouble(Object value,
double defaultValue)
Utility method for component code that transforms an Object (which must be a java.lang.Number) into a double. |
static int |
resolveInteger(Object value)
Utility method for component code that transforms an Object (which must be a java.lang.Number) into an int. |
static int |
resolveInteger(Object value,
int defaultValue)
Utility method for component code that transforms an Object (which must be a java.lang.Number) into an int. |
static Locale |
resolveLocale(Object value)
|
static Locale |
resolveLocale(Object value,
Locale defaultValue)
|
static long |
resolveLong(Object value)
Utility method for component code that transforms an Object (which must be a java.lang.Number) into a long. |
static long |
resolveLong(Object value,
long defaultValue)
Utility method for component code that transforms an Object (which must be a java.lang.Number) into a long. |
static Number |
resolveNumber(Object value)
Utility method for component code that transforms Object->Number. |
static Number |
resolveNumber(Object value,
Number defaultValue)
Utility method for component code that transforms Object->Number. |
static Object |
resolveObject(Object value,
Object defaultValue)
Utility method for component code that resolves an Object, returning a default value if the value is null. |
static String |
resolveString(Object value)
Utility method for component code that transforms Object->String. |
static String |
resolveString(Object value,
boolean treatEmptyStringAsNull)
Utility method for component code that transforms Object->String. |
static String |
resolveString(Object value,
String defaultValue)
Utility method for component code that transforms Object->String. |
static String[] |
resolveStringArray(Object value)
Utility method for code that transforms Object->String[] |
static String[] |
resolveStringArray(Object value,
String[] defaultValue)
Utility method for code that transforms Object->String[] |
static TimeZone |
resolveTimeZone(Object value)
|
static TimeZone |
resolveTimeZone(Object value,
TimeZone defaultValue)
|
static Throwable |
unwrap(Throwable t)
Gets the root cause of an exception. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Object resolveObject(Object value, Object defaultValue)
public static boolean resolveBoolean(Object value, boolean defaultValue)
public static boolean resolveBoolean(Object value)
public static int resolveInteger(Object value)
public static int resolveInteger(Object value, int defaultValue)
public static long resolveLong(Object value)
public static long resolveLong(Object value, long defaultValue)
public static double resolveDouble(Object value)
public static double resolveDouble(Object value, double defaultValue)
public static char resolveCharacter(Character value)
public static char resolveCharacter(Character value, char defaultValue)
public static Number resolveNumber(Object value)
public static Number resolveNumber(Object value, Number defaultValue)
public static String resolveString(Object value)
public static String resolveString(Object value, boolean treatEmptyStringAsNull)
public static String resolveString(Object value, String defaultValue)
public static String[] resolveStringArray(Object value)
public static String[] resolveStringArray(Object value, String[] defaultValue)
public static Date resolveDate(Object value)
public static Date resolveDate(Object value, Date defaultValue)
public static TimeZone resolveTimeZone(Object value)
public static TimeZone resolveTimeZone(Object value, TimeZone defaultValue)
public static Locale resolveLocale(Object value)
public static Locale resolveLocale(Object value, Locale defaultValue)
public static boolean isSkipIterationVisit(javax.faces.component.visit.VisitContext visitContext)
visitContext
-
true
if this is a non-iterating visit.public static Throwable unwrap(Throwable t)
public static javax.faces.component.UIComponent findRelativeComponent(javax.faces.component.UIComponent from, String scopedId)
The relative ID must account for NamingContainers. If the component is already inside of a naming container, you can use a single colon to start the search from the root, or multiple colons to move up through the NamingContainers - "::" will pop out of the current naming container, ":::" will pop out of two naming containers, etc.
from
- the component to search relative toscopedId
- the relative id path from the 'from' component to the
component to find
RenderUtils.getRelativeId(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String)
,
UIComponent.findComponent(java.lang.String)
public static String getScopedIdForComponent(javax.faces.component.UIComponent targetComponent, javax.faces.component.UIComponent baseComponent)
targetComponent
- The component for which the scoped id needs to be
determined.baseComponent
- The component relative to which the scoped id for the
targetComponent needs to be determined.
public static String getLogicalScopedIdForComponent(javax.faces.component.UIComponent targetComponent, javax.faces.component.UIComponent baseComponent)
targetComponent
- The component for which the scoped id needs to be
determined.baseComponent
- The component relative to which the scoped id for the
targetComponent needs to be determined.
public static javax.faces.component.UIComponent getNonFlatteningAncestor(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
context
- the FacesContextcomponent
- the UIComponent
FlattenedComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |