com.atomikos.beans
Class BeanInspector

java.lang.Object
  extended by com.atomikos.beans.BeanInspector

public class BeanInspector
extends Object

A bean inspector is capable of detecting what properties can be set in a bean, setting or getting any such values and returning useful information about the bean.


Constructor Summary
BeanInspector(Object bean)
          Creates a new instance to configure a given bean.
 
Method Summary
 Object getBean()
          Get the bean instance.
 Property[] getProperties()
          Get all recognized properties for this bean.
 Property getProperty(String name)
          Get the property with the given name.
 String getPropertyValue(String name)
          Get the value of the given property as text.
 void setPropertyValue(String name, String value)
          Set the given property to the given text value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanInspector

public BeanInspector(Object bean)
Creates a new instance to configure a given bean.

Parameters:
bean - The bean to inspect and configure.
Method Detail

getProperties

public Property[] getProperties()
                         throws PropertyException
Get all recognized properties for this bean.

Returns:
Property[] The properties found, or null if none.
Throws:
PropertyException

getProperty

public Property getProperty(String name)
                     throws PropertyException
Get the property with the given name.

Parameters:
name - The name of the property.
Returns:
Property The property, null if not found.
Throws:
PropertyException

getBean

public Object getBean()
Get the bean instance.

Returns:
Object The bean instance.

setPropertyValue

public void setPropertyValue(String name,
                             String value)
                      throws ReadOnlyException,
                             PropertyException
Set the given property to the given text value.

Parameters:
name - The name of the property
value - The value as text
Throws:
ReadOnlyException - If readonly
PropertyException - On failure

getPropertyValue

public String getPropertyValue(String name)
                        throws PropertyException
Get the value of the given property as text.

Parameters:
name - The name of the property.
Returns:
String The value as text.
Throws:
PropertyException


Copyright © 2011. All Rights Reserved.