| java.lang.Object org.apache.commons.digester.Rule org.apache.commons.digester.BeanPropertySetterRule
BeanPropertySetterRule | public class BeanPropertySetterRule extends Rule (Code) | | Rule implements sets a bean property on the top object
to the body text.
The property set:
- can be specified when the rule is created
- or can match the current element when the rule is called.
Using the second method and the
ExtendedBaseRules child match
pattern, all the child elements can be automatically mapped to properties
on the parent object.
|
Method Summary | |
public void | body(String namespace, String name, String text) Process the body text of this element. | public void | end(String namespace, String name) Process the end of this element. | public void | finish() Clean up after parsing is complete. | public String | toString() Render a printable version of this Rule. |
bodyText | protected String bodyText(Code) | | The body text used to set the property.
|
propertyName | protected String propertyName(Code) | | Set this property on the top object.
|
BeanPropertySetterRule | public BeanPropertySetterRule(String propertyName)(Code) | | Construct rule that sets the given property from the body text.
Parameters: propertyName - name of property to set |
BeanPropertySetterRule | public BeanPropertySetterRule()(Code) | | 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.
|
body | public void body(String namespace, String name, String text) throws Exception(Code) | | Process the body text of this element.
Parameters: namespace - the namespace URI of the matching element, or an empty string if the parser is not namespace aware or the element hasno namespace Parameters: name - the local name if the parser is namespace aware, or just the element name otherwise Parameters: text - The text of the body of this element |
end | public void end(String namespace, String name) throws Exception(Code) | | Process the end of this element.
Parameters: namespace - the namespace URI of the matching element, or an empty string if the parser is not namespace aware or the element hasno namespace Parameters: name - the local name if the parser is namespace aware, or just the element name otherwise exception: NoSuchMethodException - if the bean does nothave a writeable property of the specified name |
finish | public void finish() throws Exception(Code) | | Clean up after parsing is complete.
|
toString | public String toString()(Code) | | Render a printable version of this Rule.
|
|
|