org.apache.commons.betwixt.digester
Class MappedPropertyRule

java.lang.Object
  extended by org.apache.commons.digester.Rule
      extended by org.apache.commons.betwixt.digester.RuleSupport
          extended by org.apache.commons.betwixt.digester.MappedPropertyRule
Direct Known Subclasses:
ElementRule, TextRule

public abstract class MappedPropertyRule
extends RuleSupport

Factors out common code used by Betwixt rules that access bean properties. Maybe a lot of this should be moved into BeanUtils.

Since:
0.5
Author:
Robert Burrell Donkin

Field Summary
 
Fields inherited from class org.apache.commons.digester.Rule
digester, namespaceURI
 
Constructor Summary
MappedPropertyRule()
          Base constructor
 
Method Summary
protected  java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.Class beanClass, java.lang.String propertyName)
          Returns the property descriptor for the class and property name.
protected  java.lang.Class getPropertyType(java.lang.String propertyClassName, java.lang.Class beanClass, java.lang.String propertyName)
          Gets the type of a property
 
Methods inherited from class org.apache.commons.betwixt.digester.RuleSupport
getBeanClass, getProcessedPropertyNameSet, getXMLInfoDigester, getXMLIntrospector, loadClass
 
Methods inherited from class org.apache.commons.digester.Rule
begin, begin, body, body, end, end, finish, getDigester, getNamespaceURI, setDigester, setNamespaceURI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MappedPropertyRule

public MappedPropertyRule()
Base constructor

Method Detail

getPropertyDescriptor

protected java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.Class beanClass,
                                                              java.lang.String propertyName)
Returns the property descriptor for the class and property name. Note that some caching could be used to improve performance of this method. Or this method could be added to PropertyUtils.

Parameters:
beanClass - descriptor for property in this class
propertyName - descriptor for property with this name
Returns:
property descriptor for the named property in the given class

getPropertyType

protected java.lang.Class getPropertyType(java.lang.String propertyClassName,
                                          java.lang.Class beanClass,
                                          java.lang.String propertyName)
Gets the type of a property

Parameters:
propertyClassName - class name for property type (may be null)
beanClass - class that has property
propertyName - the name of the property whose type is to be determined
Returns:
property type


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