IBM Branch Transformation Toolkit Javadoc

com.ibm.btt.server.flow.mapper
Class JavaBeanRespObjMapper

java.lang.Object
  extended bycom.ibm.btt.server.flow.mapper.JavaBeanRespObjMapper
All Implemented Interfaces:
ResponseObjectMapper

public class JavaBeanRespObjMapper
extends java.lang.Object
implements ResponseObjectMapper

This class maps a keyed collection to a java bean.

The java bean object need to meet the JavaBean specification and corresponding fields are required to be defined in the keyed collection.


Field Summary
static java.lang.String SetterHead
          SetterHead
 
Constructor Summary
JavaBeanRespObjMapper()
           
 
Method Summary
static java.lang.reflect.Method findGetterFromSetter(java.beans.MethodDescriptor[] allMethod, java.lang.reflect.Method setter)
          Finds the corresponding getter from a setter.
static boolean isSetter(java.lang.reflect.Method aMethod)
          Returns whether a method is a setter.
 java.lang.Object mapResponseObject(DataElement dataElement, java.lang.Object respObj)
          Maps the data element to the response object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SetterHead

public static final java.lang.String SetterHead
SetterHead

See Also:
Constant Field Values
Constructor Detail

JavaBeanRespObjMapper

public JavaBeanRespObjMapper()
Method Detail

mapResponseObject

public java.lang.Object mapResponseObject(DataElement dataElement,
                                          java.lang.Object respObj)
                                   throws java.lang.Exception
Maps the data element to the response object.

Exception will be thrown out if the data element is not a keyed collection.

Specified by:
mapResponseObject in interface ResponseObjectMapper
Parameters:
dataElement - The data element.
respObj - The response object.
Returns:
java.lang.Object The response object.
Throws:
java.lang.Exception

isSetter

public static boolean isSetter(java.lang.reflect.Method aMethod)
                        throws java.lang.Exception
Returns whether a method is a setter.

A setter method has following characters: a setter is a public method; the method name of a setter starts with "get"; the length of a setter's method name is more than 3; a setter has one parameter.

Parameters:
aMethod - The method.
Returns:
boolean Whether a method is a setter.
Throws:
java.lang.Exception

findGetterFromSetter

public static java.lang.reflect.Method findGetterFromSetter(java.beans.MethodDescriptor[] allMethod,
                                                            java.lang.reflect.Method setter)
                                                     throws java.lang.Exception
Finds the corresponding getter from a setter.

Parameters:
allMethod - All the methods.
setter - The setter.
Returns:
Method The getter.
Throws:
java.lang.Exception

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005