org.hibernate.ejb.criteria
Class ValueHandlerFactory

java.lang.Object
  extended by org.hibernate.ejb.criteria.ValueHandlerFactory

public class ValueHandlerFactory
extends Object

Helper for generically dealing with literal values.


Nested Class Summary
static class ValueHandlerFactory.BaseValueHandler<T>
           
static class ValueHandlerFactory.BigDecimalValueHandler
           
static class ValueHandlerFactory.BigIntegerValueHandler
           
static class ValueHandlerFactory.ByteValueHandler
           
static class ValueHandlerFactory.DoubleValueHandler
           
static class ValueHandlerFactory.FloatValueHandler
           
static class ValueHandlerFactory.IntegerValueHandler
           
static class ValueHandlerFactory.LongValueHandler
           
static class ValueHandlerFactory.NoOpValueHandler<T>
           
static class ValueHandlerFactory.ShortValueHandler
           
static class ValueHandlerFactory.StringValueHandler
           
static interface ValueHandlerFactory.ValueHandler<T>
           
 
Method Summary
static
<T> T
convert(Object value, Class<T> targetType)
          Convert the given value into the specified target type.
static
<T> ValueHandlerFactory.ValueHandler<T>
determineAppropriateHandler(Class<T> targetType)
          Determine the appropriate ValueHandlerFactory.ValueHandler strategy for converting a value to the given target type
static boolean isCharacter(Class type)
           
static boolean isCharacter(Object value)
           
static boolean isNumeric(Class type)
           
static boolean isNumeric(Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isCharacter

public static boolean isCharacter(Class type)

isCharacter

public static boolean isCharacter(Object value)

isNumeric

public static boolean isNumeric(Class type)

isNumeric

public static boolean isNumeric(Object value)

convert

public static <T> T convert(Object value,
                            Class<T> targetType)
Convert the given value into the specified target type.

Parameters:
value - The value to convert
targetType - The type to which it should be converted
Returns:
The converted value.

determineAppropriateHandler

public static <T> ValueHandlerFactory.ValueHandler<T> determineAppropriateHandler(Class<T> targetType)
Determine the appropriate ValueHandlerFactory.ValueHandler strategy for converting a value to the given target type

Type Parameters:
T - parameterized type for the target type.
Parameters:
targetType - The target type (to which we want to convert values).
Returns:
The conversion


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.