public abstract class

TypedUpdater

extends Object
implements Updater
java.lang.Object
   ↳ org.apache.commons.betwixt.expression.TypedUpdater
Known Direct Subclasses

Class Overview

Abstracts common features for strongly typed Updater's. Strongly type Updater's perform conversions based on this the expected type before the bean update is invoked.

Summary

Public Constructors
TypedUpdater()
Public Methods
Class getValueType()
Gets the type expected.
void setValueType(Class valueType)
Sets the type expected.
void update(Context context, Object newValue)
Updates the current bean context with the given String value
Protected Methods
abstract void executeUpdate(Context context, Object bean, Object value)
Updates the bean with the given value.
void handleException(Context context, Exception e)
Strategy method to allow derivations to handle exceptions differently.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.commons.betwixt.expression.Updater

Public Constructors

public TypedUpdater ()

Public Methods

public Class getValueType ()

Gets the type expected. The value passed into update(Context, Object) will be converted on the basis of this type before being passed to executeUpdate(Context, Object, Object).

Returns
  • Class giving expected type, not null

public void setValueType (Class valueType)

Sets the type expected. The value passed into update(Context, Object) will be converted on the basis of this type before being passed to executeUpdate(Context, Object, Object).

Parameters
valueType Class giving expected type, not null

public void update (Context context, Object newValue)

Updates the current bean context with the given String value

Parameters
context the Context to be updated
newValue the update to this new value

Protected Methods

protected abstract void executeUpdate (Context context, Object bean, Object value)

Updates the bean with the given value.

Parameters
value value after type conversion
Throws
Exception

protected void handleException (Context context, Exception e)

Strategy method to allow derivations to handle exceptions differently.

Parameters
context the Context being updated when this exception occured
e the Exception that occured during the update