UIX 2.2.16

oracle.cabo.share.expl
Class Coercions

java.lang.Object
  |
  +--oracle.cabo.share.expl.Coercions

public final class Coercions
extends java.lang.Object

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


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.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

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)

toString

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

toColor

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

UIX 2.2.16