org.apache.myfaces.trinidadinternal.share.expl
Class Coercions

java.lang.Object
  extended by org.apache.myfaces.trinidadinternal.share.expl.Coercions

public final class Coercions
extends java.lang.Object

Coercions is a utility class to coerce values to their target type.

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/share/expl/Coercions.java#0 $) $Date: 10-nov-2005.19:00:11 $
Author:
The Oracle ADF Faces Team

Method Summary
static java.lang.Object coerce(ExpressionContext context, java.lang.String text, java.lang.Class<?> type)
          coerce a String into the specified type
static java.lang.Object coerce(java.lang.Object value, java.lang.Class<?> type)
          coerces an instance into an instance of the given type
static java.lang.Boolean toBoolean(java.lang.Object value)
           
static java.lang.Byte toByte(java.lang.Object value)
           
static java.lang.Character toCharacter(java.lang.Object value)
           
static java.awt.Color toColor(java.lang.Object value)
           
static java.lang.Double toDouble(java.lang.Object value)
           
static java.lang.Float toFloat(java.lang.Object value)
           
static java.lang.Integer toInteger(java.lang.Object value)
           
static java.lang.Long toLong(java.lang.Object value)
           
static java.lang.Number toNumber(java.lang.Object value)
           
static java.lang.Short toShort(java.lang.Object value)
           
static java.lang.String toString(java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

coerce

public static java.lang.Object coerce(ExpressionContext context,
                                      java.lang.String text,
                                      java.lang.Class<?> type)
                               throws java.lang.IllegalArgumentException
coerce a String into the specified type

Parameters:
text - the string to be coerced
type - the required type
Throws:
java.lang.IllegalArgumentException

coerce

public static java.lang.Object coerce(java.lang.Object value,
                                      java.lang.Class<?> type)
coerces an instance into an instance of the given type


toBoolean

public static java.lang.Boolean toBoolean(java.lang.Object value)

toCharacter

public static java.lang.Character toCharacter(java.lang.Object value)

toByte

public static java.lang.Byte toByte(java.lang.Object value)

toShort

public static java.lang.Short toShort(java.lang.Object value)

toInteger

public static java.lang.Integer toInteger(java.lang.Object value)

toLong

public static java.lang.Long toLong(java.lang.Object value)

toFloat

public static java.lang.Float toFloat(java.lang.Object value)

toDouble

public static java.lang.Double toDouble(java.lang.Object value)

toNumber

public static java.lang.Number toNumber(java.lang.Object value)

toString

public static java.lang.String toString(java.lang.Object value)

toColor

public static java.awt.Color toColor(java.lang.Object value)


Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.