gnu.beanfactory
Class BeanSetter

java.lang.Object
  |
  +--gnu.beanfactory.BeanSetter

public class BeanSetter
extends java.lang.Object

A class for manipulating JavaBeans using reflection APIs.

Version:
$Id: BeanSetter.java,v 1.31 2001/10/10 05:42:42 rschoening Exp $
Author:
Rob Schoening <rob@beanfactory.net>

Method Summary
static BeanSetter forClass(java.lang.Class c)
          Gets the BeanSetter for a particlar class.
 java.lang.Object getIndexedProperty(java.lang.Object target, java.lang.String name, int idx)
          Insert the method's description here.
 java.lang.Object getNestedProperty(java.lang.Object target, java.lang.String name)
           
 java.lang.Object getProperty(java.lang.Object target, java.lang.String name)
           
 void initialize(java.lang.Object obj, BeanDefinition def)
          Initializes an object given a context and a set of bean attributes.
 java.lang.Object invoke(java.lang.Object target, java.lang.String methodName)
           
 void setObjectProperty(java.lang.Object target, java.lang.String prop, java.lang.Object val)
           
 void setProperty(java.lang.Object target, java.lang.String prop, java.lang.String[] val)
           
 void setProperty(java.lang.Object target, java.lang.String prop, java.lang.String val, java.lang.String DELIM)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

invoke

public java.lang.Object invoke(java.lang.Object target,
                               java.lang.String methodName)
                        throws java.lang.NoSuchMethodException,
                               java.lang.reflect.InvocationTargetException,
                               java.lang.IllegalAccessException

forClass

public static BeanSetter forClass(java.lang.Class c)
                           throws EncapsulatedException
Gets the BeanSetter for a particlar class.
Parameters:
c - the class for which we want the BeanSetter
Returns:
instance to manipulate instances of the given type

initialize

public void initialize(java.lang.Object obj,
                       BeanDefinition def)
                throws BeanFactoryException
Initializes an object given a context and a set of bean attributes. The constructors are responsible for handling resolution of references between objects. This method is problematic in both multi-threaded environments as well as with self- and mutual-reference situations. A near-term enhancement will to be to add some kind of "Intitialization Frame" which will help solve both problems.
Parameters:
obj - the object to be initialized
ctx - BeanContext that owns the object
attrs - attributes that define the bean

getIndexedProperty

public java.lang.Object getIndexedProperty(java.lang.Object target,
                                           java.lang.String name,
                                           int idx)
                                    throws PropertyNotFoundException,
                                           EncapsulatedException
Insert the method's description here. Creation date: (2/23/2001 4:15:27 PM)
Parameters:
target - java.lang.Object
name - java.lang.String
Returns:
java.lang.Object

getProperty

public java.lang.Object getProperty(java.lang.Object target,
                                    java.lang.String name)
                             throws EncapsulatedException,
                                    PropertyNotFoundException

getNestedProperty

public java.lang.Object getNestedProperty(java.lang.Object target,
                                          java.lang.String name)
                                   throws EncapsulatedException,
                                          PropertyNotFoundException

setProperty

public void setProperty(java.lang.Object target,
                        java.lang.String prop,
                        java.lang.String val,
                        java.lang.String DELIM)
                 throws BeanFactoryException

setProperty

public void setProperty(java.lang.Object target,
                        java.lang.String prop,
                        java.lang.String[] val)
                 throws BeanFactoryException

setObjectProperty

public void setObjectProperty(java.lang.Object target,
                              java.lang.String prop,
                              java.lang.Object val)
                       throws BeanFactoryException