Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.util.coerce
Class ClassHandler

    java.lang.Object
      org.jboss.util.coerce.CoercionHandler
          org.jboss.util.coerce.BoundCoercionHandler
              org.jboss.util.coerce.ClassHandler

public class ClassHandler
extends BoundCoercionHandler

A `java.lang.Class` coercion handler.

Version:
  `$Revision: 1.1 $`
Author:
  Jason Dillon

Constructor Summary
`ClassHandler()`

Method Summary
`Object` | `coerce(Object value, Class type)` Coerces the given value into the given type (which should be `Class`).
`Object` | `coerce(String value)` Coerces the given String into a `Class` by doing a `Class.forName()`.
`Class` | `getType()` Get the target class type for this `CoercionHandler`.

Methods inherited from class org.jboss.util.coerce.CoercionHandler
`create, install, install, isInstalled, lookup, uninstall`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ClassHandler

    public ClassHandler()

Method Detail

### getType

    public Class getType()

  Get the target class type for this `CoercionHandler`.

  Specified by:
    `getType` in class `BoundCoercionHandler`
  Returns:
    Class type.

### coerce

    public Object coerce(Object value,
                         Class type)
                  throws CoercionException

  Coerces the given value into the given type (which should be `Class`).

  This currently only support coercion from a `String`.

  Specified by:
    `coerce` in class `CoercionHandler`
  Parameters:
    `value` - Value to coerce.
    `type` - `java.lang.Class`.
  Returns:
    Value coerced into a `Class`.
  Throws:
    `CoercionException` - Failed to coerce.

### coerce

    public Object coerce(String value)

  Coerces the given String into a `Class` by doing a `Class.forName()`.

  Parameters:
    `value` - String value to convert to a `Class`.
  Returns:
    `Class` value.
  Throws:
    `NotCoercibleException` - Class not found.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002 JBoss Group, LLC. All Rights Reserved.