org.apache.commons.betwixt
Class BeanProperty

java.lang.Object
  extended by org.apache.commons.betwixt.BeanProperty

public class BeanProperty
extends java.lang.Object

Betwixt-centric view of a bean (or pseudo-bean) property. This object decouples the way that the (possibly pseudo) property introspection is performed from the results of that introspection.

Since:
0.5
Author:
Robert Burrell Donkin

Constructor Summary
BeanProperty(org.apache.commons.beanutils.DynaProperty dynaProperty)
          Constructs a BeanProperty from a DynaProperty
BeanProperty(java.beans.PropertyDescriptor descriptor)
          Constructs a BeanProperty from a PropertyDescriptor.
BeanProperty(java.lang.String propertyName, java.lang.Class propertyType, Expression propertyExpression, Updater propertyUpdater)
          Construct a BeanProperty.
 
Method Summary
 Descriptor createXMLDescriptor(IntrospectionConfiguration configuration)
          Create a XML descriptor from a bean one.
 Expression getPropertyExpression()
          Gets the expression used to read this property.
 java.lang.String getPropertyName()
          Gets the bean name for this property.
 java.lang.Class getPropertyType()
          Gets the type of this property.
 Updater getPropertyUpdater()
          Gets the updater used to write to this properyty.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanProperty

public BeanProperty(java.lang.String propertyName,
                    java.lang.Class propertyType,
                    Expression propertyExpression,
                    Updater propertyUpdater)
Construct a BeanProperty.

Parameters:
propertyName - not null
propertyType - not null
propertyExpression - the Expression used to read the property, null if the property is not readable
propertyUpdater - the Updater used to write the property, null if the property is not writable

BeanProperty

public BeanProperty(java.beans.PropertyDescriptor descriptor)
Constructs a BeanProperty from a PropertyDescriptor.

Parameters:
descriptor - not null

BeanProperty

public BeanProperty(org.apache.commons.beanutils.DynaProperty dynaProperty)
Constructs a BeanProperty from a DynaProperty

Parameters:
dynaProperty - not null
Method Detail

getPropertyName

public java.lang.String getPropertyName()
Gets the bean name for this property. Betwixt will map this to an xml name.

Returns:
the bean name for this property, not null

getPropertyType

public java.lang.Class getPropertyType()
Gets the type of this property.

Returns:
the property type, not null

getPropertyExpression

public Expression getPropertyExpression()
Gets the expression used to read this property.

Returns:
the expression to be used to read this property or null if this property is not readable.

getPropertyUpdater

public Updater getPropertyUpdater()
Gets the updater used to write to this properyty.

Returns:
the Updater to the used to write to this property or null if this property is not writable.

createXMLDescriptor

public Descriptor createXMLDescriptor(IntrospectionConfiguration configuration)
Create a XML descriptor from a bean one. Go through and work out whether it's a loop property, a primitive or a standard. The class property is ignored.

Parameters:
configuration - IntrospectionConfiguration, not null
Returns:
a correctly configured NodeDescriptor for the property


Copyright © 2002-2008 The Apache Software Foundation. All Rights Reserved.