org.apache.commons.digester
Class BeanPropertySetterRule

java.lang.Object
  |
  +--org.apache.commons.digester.Rule
        |
        +--org.apache.commons.digester.BeanPropertySetterRule

public class BeanPropertySetterRule
extends Rule

Rule implements sets a bean property on the top object to the body text.

The property set:

Using the second method and the ExtendedBaseRules child match pattern, all the child elements can be automatically mapped to properties on the parent object.

Version:
$Revision: 1.8 $ $Date: 2002/03/23 17:45:57 $
Author:
Robert Burrell Donkin

Field Summary
protected  java.lang.String bodyText
          The body text used to set the property.
protected  java.lang.String propertyName
          Set this property on the top object.
 
Fields inherited from class org.apache.commons.digester.Rule
digester, namespaceURI
 
Constructor Summary
BeanPropertySetterRule()
          Construct rule that automatically sets a property from the body text.
BeanPropertySetterRule(Digester digester)
          Deprecated. The digester instance is now set in the Digester.addRule(java.lang.String, org.apache.commons.digester.Rule) method. Use BeanPropertySetterRule() instead.
BeanPropertySetterRule(Digester digester, java.lang.String propertyName)
          Deprecated. The digester instance is now set in the Digester.addRule(java.lang.String, org.apache.commons.digester.Rule) method. Use BeanPropertySetterRule(String propertyName) instead.
BeanPropertySetterRule(java.lang.String propertyName)
          Construct rule that sets the given property from the body text.
 
Method Summary
 void body(java.lang.String bodyText)
          Process the body text of this element.
 void end()
          Process the end of this element.
 void finish()
          Clean up after parsing is complete.
 java.lang.String toString()
          Render a printable version of this Rule.
 
Methods inherited from class org.apache.commons.digester.Rule
begin, getDigester, getNamespaceURI, setDigester, setNamespaceURI
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

propertyName

protected java.lang.String propertyName
Set this property on the top object.

bodyText

protected java.lang.String bodyText
The body text used to set the property.
Constructor Detail

BeanPropertySetterRule

public BeanPropertySetterRule(Digester digester,
                              java.lang.String propertyName)
Deprecated. The digester instance is now set in the Digester.addRule(java.lang.String, org.apache.commons.digester.Rule) method. Use BeanPropertySetterRule(String propertyName) instead.

Construct rule that sets the given property from the body text.

Parameters:
digester - associated Digester
propertyName - name of property to set

BeanPropertySetterRule

public BeanPropertySetterRule(Digester digester)
Deprecated. The digester instance is now set in the Digester.addRule(java.lang.String, org.apache.commons.digester.Rule) method. Use BeanPropertySetterRule() instead.

Construct rule that automatically sets a property from the body text.

This construct creates a rule that sets the property on the top object named the same as the current element.

Parameters:
digester - associated Digester

BeanPropertySetterRule

public BeanPropertySetterRule(java.lang.String propertyName)

Construct rule that sets the given property from the body text.

Parameters:
propertyName - name of property to set

BeanPropertySetterRule

public BeanPropertySetterRule()

Construct rule that automatically sets a property from the body text.

This construct creates a rule that sets the property on the top object named the same as the current element.

Method Detail

body

public void body(java.lang.String bodyText)
          throws java.lang.Exception
Process the body text of this element.
Overrides:
body in class Rule
Parameters:
bodyText - The body text of this element

end

public void end()
         throws java.lang.Exception
Process the end of this element.
Overrides:
end in class Rule

finish

public void finish()
            throws java.lang.Exception
Clean up after parsing is complete.
Overrides:
finish in class Rule

toString

public java.lang.String toString()
Render a printable version of this Rule.
Overrides:
toString in class java.lang.Object


Copyright (c) 2001-2002 - Apache Software Foundation