org.apache.ws.jaxme.generator.util
Class Reflect

java.lang.Object
  extended by org.apache.ws.jaxme.generator.util.Reflect

public class Reflect
extends java.lang.Object

A set of utility methods for using Java reflection.

Author:
Jochen Wiedmann

Constructor Summary
Reflect()
           
 
Method Summary
static void assignBeanValue(java.lang.Object pBean, java.lang.String pPropertyName, java.lang.String pValue)
          Assigns the value pValue to the beans pBean property pPropertyName.
static void assignBeanValue(java.lang.Object pBean, java.lang.String pPropertyName, java.lang.String pValue, ReflectResolver pResolver)
          Assigns the value pValue to the beans pBean property pPropertyName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Reflect

public Reflect()
Method Detail

assignBeanValue

public static void assignBeanValue(java.lang.Object pBean,
                                   java.lang.String pPropertyName,
                                   java.lang.String pValue)
                            throws java.lang.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.

Throws:
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

assignBeanValue

public static void assignBeanValue(java.lang.Object pBean,
                                   java.lang.String pPropertyName,
                                   java.lang.String pValue,
                                   ReflectResolver pResolver)
                            throws java.lang.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.

Throws:
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException