org.jboss.soa.esb.util
Class BeanConfigurator

java.lang.Object
  extended by org.jboss.soa.esb.util.BeanConfigurator
Direct Known Subclasses:
ActionBeanConfigurator

public class BeanConfigurator
extends java.lang.Object

The BeanConfigurator knows how to map a ConfigTree to JavaBean properties.

Author:
Rex Sheridan

Constructor Summary
BeanConfigurator()
           
BeanConfigurator(ConfigTree config, java.lang.Object bean)
           
BeanConfigurator(java.util.Map<java.lang.String,java.lang.String> properties, java.lang.Object bean)
           
 
Method Summary
 void configure()
           
 java.lang.Object getBean()
           
 java.util.Map<java.lang.String,java.lang.String> getProperties()
           
protected  java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.String name)
           
 void setBean(java.lang.Object bean)
           
 void setOptionalFields(java.util.Collection<java.lang.String> optionalFields)
          Fields that will not cause an exception to be thrown if they are missing in the bean class but exist in the configuration.
 void setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
           
protected  void setProperty(java.beans.PropertyDescriptor descriptor, java.lang.String name, java.lang.String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanConfigurator

public BeanConfigurator()

BeanConfigurator

public BeanConfigurator(ConfigTree config,
                        java.lang.Object bean)

BeanConfigurator

public BeanConfigurator(java.util.Map<java.lang.String,java.lang.String> properties,
                        java.lang.Object bean)
Method Detail

configure

public void configure()
               throws java.beans.IntrospectionException
Throws:
java.beans.IntrospectionException

setProperty

protected void setProperty(java.beans.PropertyDescriptor descriptor,
                           java.lang.String name,
                           java.lang.String value)

getPropertyDescriptor

protected java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.String name)

getBean

public java.lang.Object getBean()
Returns:
the bean

setBean

public void setBean(java.lang.Object bean)
Parameters:
bean - the bean to set

getProperties

public java.util.Map<java.lang.String,java.lang.String> getProperties()
Returns:
the properties

setProperties

public void setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Parameters:
properties - the properties to set

setOptionalFields

public void setOptionalFields(java.util.Collection<java.lang.String> optionalFields)
Fields that will not cause an exception to be thrown if they are missing in the bean class but exist in the configuration. This was added to support fields like 'service-category' which can now exist in a bean class.

Parameters:
optionalFields - List of field names that can be specified in a bean class.