org.apache.ws.jaxme.generator.util

Class Reflect


public class Reflect
extends java.lang.Object

A set of utility methods for using Java reflection.
Author:
Jochen Wiedmann

Method Summary

static void
assignBeanValue(Object pBean, String pPropertyName, String pValue)
Assigns the value pValue to the beans pBean property pPropertyName.
static void
assignBeanValue(Object pBean, String pPropertyName, String pValue, ReflectResolver pResolver)
Assigns the value pValue to the beans pBean property pPropertyName.

Method Details

assignBeanValue

public static void assignBeanValue(Object pBean,
                                   String pPropertyName,
                                   String pValue)
            throws IllegalAccessException,
                   java.lang.reflect.InvocationTargetException
Assigns the value pValue to the beans pBean property pPropertyName. For example, if the property name is type and the String pValue is 2, calls
   pBean.setType("2");
 
or
   pBean.setType(2);
 
if the respective method exists. Does nothing, if no matching method can be found.

assignBeanValue

public static void assignBeanValue(Object pBean,
                                   String pPropertyName,
                                   String pValue,
                                   ReflectResolver pResolver)
            throws IllegalAccessException,
                   java.lang.reflect.InvocationTargetException
Assigns the value pValue to the beans pBean property pPropertyName. For example, if the property name is type and the String pValue is 2, calls
   pBean.setType("2");
 
or
   pBean.setType(2);
 
if the respective method exists. Does nothing, if no matching method can be found.