org.apache.commons.betwixt.expression
Class MethodUpdater

java.lang.Object
  extended by org.apache.commons.betwixt.expression.TypedUpdater
      extended by org.apache.commons.betwixt.expression.MethodUpdater
All Implemented Interfaces:
Updater

public class MethodUpdater
extends TypedUpdater

MethodUpdater updates the current bean context by calling a WriteMethod with the String value from the XML attribute or element.

Version:
$Revision: 438373 $
Author:
James Strachan

Constructor Summary
MethodUpdater()
          Base constructor
MethodUpdater(java.lang.reflect.Method method)
          Convenience constructor sets method property
 
Method Summary
protected  void executeUpdate(Context context, java.lang.Object bean, java.lang.Object newValue)
          Updates the bean by method invocation.
 java.lang.reflect.Method getMethod()
          Gets the method which will be invoked by the update
static void setLog(org.apache.commons.logging.Log aLog)
          Programmatically set log
 void setMethod(java.lang.reflect.Method method)
          Sets the constant value of this expression
 java.lang.String toString()
          Returns something useful for logging.
 
Methods inherited from class org.apache.commons.betwixt.expression.TypedUpdater
getValueType, handleException, setValueType, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MethodUpdater

public MethodUpdater()
Base constructor


MethodUpdater

public MethodUpdater(java.lang.reflect.Method method)
Convenience constructor sets method property

Parameters:
method - the Method to be invoked on the context's bean in the update
Method Detail

setLog

public static void setLog(org.apache.commons.logging.Log aLog)
Programmatically set log

Parameters:
aLog - the implementation to which this class should log

getMethod

public java.lang.reflect.Method getMethod()
Gets the method which will be invoked by the update

Returns:
the Method to be invoked by the update

setMethod

public void setMethod(java.lang.reflect.Method method)
Sets the constant value of this expression

Parameters:
method - the Method to be invoked by the update

toString

public java.lang.String toString()
Returns something useful for logging.

Overrides:
toString in class java.lang.Object
Returns:
something useful for logging

executeUpdate

protected void executeUpdate(Context context,
                             java.lang.Object bean,
                             java.lang.Object newValue)
                      throws java.lang.Exception
Updates the bean by method invocation.

Specified by:
executeUpdate in class TypedUpdater
newValue - value after type conversion
Throws:
java.lang.Exception
Since:
0.7


Copyright 2002-2008 The Apache Software Foundation. All Rights Reserved.