|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.util.coerce.CoercionHandler
An abstract class to allow extending the default behavior of
Objects.coerce(Object,Class)
when it is
not possible to implement Coercible
(src)
directly in the target class or where coercion is desired from
an unrelated class. Also provides a registry for all of the
currently installed handlers.
Constructor Summary | |
CoercionHandler()
|
Method Summary | |
abstract java.lang.Object |
coerce(java.lang.Object value,
java.lang.Class type)
Coerce the given value into the specified type. |
static CoercionHandler (src) |
create(java.lang.Class type)
Create a CoercionHandler for the given class type. |
java.lang.Class |
getType()
Get the target class type for this CoercionHandler. |
static void |
install(BoundCoercionHandler (src) handler)
Install a BoundCoercionHandler. |
static void |
install(java.lang.Class type,
CoercionHandler (src) handler)
Install a CoercionHandler for a given class type. |
static boolean |
isInstalled(java.lang.Class type)
Check if there is a CoercionHandler installed for the given class. |
static CoercionHandler (src) |
lookup(java.lang.Class type)
Lookup the CoercionHandler for a given class. |
static void |
uninstall(java.lang.Class type)
Uninstall a CoercionHandler for a given class type. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CoercionHandler()
Method Detail |
public abstract java.lang.Object coerce(java.lang.Object value, java.lang.Class type) throws CoercionException (src)
value
- Value to coercetype
- Object type to coerce into
CoercionException (src)
- Failed to coercepublic java.lang.Class getType()
NotImplementedException (src)
- Handler is not boundpublic static void install(java.lang.Class type, CoercionHandler (src) handler)
handler
- Coercion handler
NullArgumentException (src)
- type or handlerpublic static void install(BoundCoercionHandler (src) handler)
handler
- Bound coercion handler
NullArgumentException (src)
- handlerpublic static void uninstall(java.lang.Class type)
type
- Class type
NullArgumentException (src)
- typepublic static boolean isInstalled(java.lang.Class type)
type
- Class type
public static CoercionHandler (src) lookup(java.lang.Class type)
type
- Class type
NullArgumentException (src)
- typepublic static CoercionHandler (src) create(java.lang.Class type)
type
- Class type
CoercionException (src)
- No installed handler for type
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |