org.hardtokenmgmt.admin.common
Class BeanConverter

java.lang.Object
  extended by org.hardtokenmgmt.admin.common.BeanConverter

public class BeanConverter
extends java.lang.Object

Helper class used to transform an auto generated Bean class (usually generated by JAXWS) into another bean with the same fields. Important, in order for the convertion must each field that should be copied have property 'get' an 'set' method.

Version:
$Id$
Author:
Philip Vendil 4 apr 2009

Constructor Summary
BeanConverter()
           
 
Method Summary
static org.hardtokenmgmt.ws.gen.AdminDataVO convertAdminDataVO(AdminDataVO adminDataVO)
           
static java.lang.Object convertBean(java.lang.Object source, java.lang.Class<?> targetClass)
          Helper method used to transform an auto generated Bean class (usually generated by JAXWS) into another bean with the same fields.
static CAInfoVO convertCAInfoVO(org.hardtokenmgmt.ws.gen.CaInfoVO caInfoVOWS)
           
static void convertCAInfoVOCollection(java.util.Collection<org.hardtokenmgmt.ws.gen.CaInfoVO> sourceCollection, java.util.Collection<CAInfoVO> destCollection)
           
static void convertCollection(java.util.Collection sourceCollection, java.util.Collection destCollection, java.lang.Class<?> sourceContentClass, java.lang.Class<?> destinationContentClass)
          Help method used to convert at collection of beans.
static AdminDataVO convertWSAdminDataVO(org.hardtokenmgmt.ws.gen.AdminDataVO adminDataVOWS)
           
static HostInfoVO convertWSHostInfoVO(org.hardtokenmgmt.ws.gen.HostInfoVO hostInfoVOWS)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanConverter

public BeanConverter()
Method Detail

convertBean

public static java.lang.Object convertBean(java.lang.Object source,
                                           java.lang.Class<?> targetClass)
Helper method used to transform an auto generated Bean class (usually generated by JAXWS) into another bean with the same fields. Important, in order for the convertion must each field that should be copied have property 'get' an 'set' method. Important, beans that contains collections isn't copyied. that have to be done separately.

Parameters:
source - source object to convert
targetClass - class to convert bean into
Returns:
instance of target class with all fields from source object set.
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.SecurityException
java.lang.NoSuchMethodException
java.lang.IllegalArgumentException
java.lang.reflect.InvocationTargetException

convertCollection

public static void convertCollection(java.util.Collection sourceCollection,
                                     java.util.Collection destCollection,
                                     java.lang.Class<?> sourceContentClass,
                                     java.lang.Class<?> destinationContentClass)
Help method used to convert at collection of beans.

Parameters:
sourceCollection - sourceCollection
destCollection - destinationCollection
sourceContentClass - sourceClass used in the collection.
destinationContentClass - class used for the destination collection.

convertWSAdminDataVO

public static AdminDataVO convertWSAdminDataVO(org.hardtokenmgmt.ws.gen.AdminDataVO adminDataVOWS)

convertAdminDataVO

public static org.hardtokenmgmt.ws.gen.AdminDataVO convertAdminDataVO(AdminDataVO adminDataVO)

convertWSHostInfoVO

public static HostInfoVO convertWSHostInfoVO(org.hardtokenmgmt.ws.gen.HostInfoVO hostInfoVOWS)

convertCAInfoVO

public static CAInfoVO convertCAInfoVO(org.hardtokenmgmt.ws.gen.CaInfoVO caInfoVOWS)

convertCAInfoVOCollection

public static void convertCAInfoVOCollection(java.util.Collection<org.hardtokenmgmt.ws.gen.CaInfoVO> sourceCollection,
                                             java.util.Collection<CAInfoVO> destCollection)