org.apache.myfaces.trinidad.util
Class ComponentUtils

java.lang.Object
  extended by org.apache.myfaces.trinidad.util.ComponentUtils

public final class ComponentUtils
extends java.lang.Object

Utility functions used by the Apache Trinidad components.

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-api/src/main/java/oracle/adf/view/faces/util/ComponentUtils.java#0 $) $Date: 10-nov-2005.19:08:37 $

Method Summary
static javax.faces.component.UIComponent findRelativeComponent(javax.faces.component.UIComponent from, java.lang.String scopedId)
          Find a component relative to another.
static boolean resolveBoolean(java.lang.Object value)
          Utility method for component code that transforms Object->boolean.
static boolean resolveBoolean(java.lang.Object value, boolean defaultValue)
          Utility method for component code that transforms Object->boolean.
static char resolveCharacter(java.lang.Character value)
          Utility method for component code that transforms Character->character.
static char resolveCharacter(java.lang.Character value, char defaultValue)
          Utility method for component code that transforms Character->character.
static java.util.Date resolveDate(java.lang.Object value)
          Utility method for code that transforms Object->Date
static java.util.Date resolveDate(java.lang.Object value, java.util.Date defaultValue)
          Utility method for code that transforms Object->Date
static double resolveDouble(java.lang.Object value)
          Utility method for component code that transforms an Object (which must be a java.lang.Number) into a double.
static double resolveDouble(java.lang.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(java.lang.Object value)
          Utility method for component code that transforms an Object (which must be a java.lang.Number) into an int.
static int resolveInteger(java.lang.Object value, int defaultValue)
          Utility method for component code that transforms an Object (which must be a java.lang.Number) into an int.
static java.util.Locale resolveLocale(java.lang.Object value)
           
static java.util.Locale resolveLocale(java.lang.Object value, java.util.Locale defaultValue)
           
static long resolveLong(java.lang.Object value)
          Utility method for component code that transforms an Object (which must be a java.lang.Number) into a long.
static long resolveLong(java.lang.Object value, long defaultValue)
          Utility method for component code that transforms an Object (which must be a java.lang.Number) into a long.
static java.lang.Number resolveNumber(java.lang.Object value)
          Utility method for component code that transforms Object->Number.
static java.lang.Number resolveNumber(java.lang.Object value, java.lang.Number defaultValue)
          Utility method for component code that transforms Object->Number.
static java.lang.Object resolveObject(java.lang.Object value, java.lang.Object defaultValue)
          Utility method for component code that resolves an Object, returning a default value if the value is null.
static java.lang.String resolveString(java.lang.Object value)
          Utility method for component code that transforms Object->String.
static java.lang.String resolveString(java.lang.Object value, java.lang.String defaultValue)
          Utility method for component code that transforms Object->String.
static java.lang.String[] resolveStringArray(java.lang.Object value)
          Utility method for code that transforms Object->String[]
static java.lang.String[] resolveStringArray(java.lang.Object value, java.lang.String[] defaultValue)
          Utility method for code that transforms Object->String[]
static java.util.TimeZone resolveTimeZone(java.lang.Object value)
           
static java.util.TimeZone resolveTimeZone(java.lang.Object value, java.util.TimeZone defaultValue)
           
static java.lang.Throwable unwrap(java.lang.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

resolveObject

public static java.lang.Object resolveObject(java.lang.Object value,
                                             java.lang.Object defaultValue)
Utility method for component code that resolves an Object, returning a default value if the value is null.


resolveBoolean

public static boolean resolveBoolean(java.lang.Object value,
                                     boolean defaultValue)
Utility method for component code that transforms Object->boolean.


resolveBoolean

public static boolean resolveBoolean(java.lang.Object value)
Utility method for component code that transforms Object->boolean.


resolveInteger

public static int resolveInteger(java.lang.Object value)
Utility method for component code that transforms an Object (which must be a java.lang.Number) into an int.


resolveInteger

public static int resolveInteger(java.lang.Object value,
                                 int defaultValue)
Utility method for component code that transforms an Object (which must be a java.lang.Number) into an int.


resolveLong

public static long resolveLong(java.lang.Object value)
Utility method for component code that transforms an Object (which must be a java.lang.Number) into a long.


resolveLong

public static long resolveLong(java.lang.Object value,
                               long defaultValue)
Utility method for component code that transforms an Object (which must be a java.lang.Number) into a long.


resolveDouble

public static double resolveDouble(java.lang.Object value)
Utility method for component code that transforms an Object (which must be a java.lang.Number) into a double.


resolveDouble

public static double resolveDouble(java.lang.Object value,
                                   double defaultValue)
Utility method for component code that transforms an Object (which must be a java.lang.Number) into a double.


resolveCharacter

public static char resolveCharacter(java.lang.Character value)
Utility method for component code that transforms Character->character.


resolveCharacter

public static char resolveCharacter(java.lang.Character value,
                                    char defaultValue)
Utility method for component code that transforms Character->character.


resolveNumber

public static java.lang.Number resolveNumber(java.lang.Object value)
Utility method for component code that transforms Object->Number.


resolveNumber

public static java.lang.Number resolveNumber(java.lang.Object value,
                                             java.lang.Number defaultValue)
Utility method for component code that transforms Object->Number.


resolveString

public static java.lang.String resolveString(java.lang.Object value)
Utility method for component code that transforms Object->String.


resolveString

public static java.lang.String resolveString(java.lang.Object value,
                                             java.lang.String defaultValue)
Utility method for component code that transforms Object->String.


resolveStringArray

public static java.lang.String[] resolveStringArray(java.lang.Object value)
Utility method for code that transforms Object->String[]


resolveStringArray

public static java.lang.String[] resolveStringArray(java.lang.Object value,
                                                    java.lang.String[] defaultValue)
Utility method for code that transforms Object->String[]


resolveDate

public static java.util.Date resolveDate(java.lang.Object value)
Utility method for code that transforms Object->Date


resolveDate

public static java.util.Date resolveDate(java.lang.Object value,
                                         java.util.Date defaultValue)
Utility method for code that transforms Object->Date


resolveTimeZone

public static java.util.TimeZone resolveTimeZone(java.lang.Object value)

resolveTimeZone

public static java.util.TimeZone resolveTimeZone(java.lang.Object value,
                                                 java.util.TimeZone defaultValue)

resolveLocale

public static java.util.Locale resolveLocale(java.lang.Object value)

resolveLocale

public static java.util.Locale resolveLocale(java.lang.Object value,
                                             java.util.Locale defaultValue)

unwrap

public static java.lang.Throwable unwrap(java.lang.Throwable t)
Gets the root cause of an exception. Keeps unwrapping the given throwable until the root cause is found.


findRelativeComponent

public static javax.faces.component.UIComponent findRelativeComponent(javax.faces.component.UIComponent from,
                                                                      java.lang.String scopedId)
Find a component relative to another.

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.

Parameters:
from - the component to search relative to
scopedId - the relative id path from the 'from' component to the component to find
Returns:
the component if found, null otherwise
See Also:
RenderUtils.getRelativeId(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String), UIComponent.findComponent(java.lang.String)


Copyright © 2001-2008 The Apache Software Foundation. All Rights Reserved.