org.apache.commons.digester
Class BeanPropertySetterRule
public class BeanPropertySetterRule
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.
protected String | bodyText - The body text used to set the property.
|
protected String | propertyName - Set this property on the top object.
|
void | body(String namespace, String name, String text) - Process the body text of this element.
|
void | end(String namespace, String name) - Process the end of this element.
|
void | finish() - Clean up after parsing is complete.
|
String | toString() - Render a printable version of this Rule.
|
begin , begin , body , body , end , end , finish , getDigester , getNamespaceURI , setDigester , setNamespaceURI |
bodyText
protected String bodyText
The body text used to set the property.
propertyName
protected String propertyName
Set this property on the top object.
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.
BeanPropertySetterRule
public BeanPropertySetterRule(String propertyName)
Construct rule that sets the given property from the body text.
propertyName
- name of property to set
BeanPropertySetterRule
public BeanPropertySetterRule(Digester digester)
The digester instance is now set in the Digester.addRule(String,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.
digester
- associated Digester
BeanPropertySetterRule
public BeanPropertySetterRule(Digester digester,
String propertyName)
The digester instance is now set in the Digester.addRule(String,Rule)
method.
Use BeanPropertySetterRule(String propertyName)
instead.
Construct rule that sets the given property from the body text.
digester
- associated Digester
propertyName
- name of property to set
body
public void body(String namespace,
String name,
String text)
throws Exception
Process the body text of this element.
- body in interface Rule
namespace
- the namespace URI of the matching element, or an
empty string if the parser is not namespace aware or the element has
no namespacename
- the local name if the parser is namespace aware, or just
the element name otherwisetext
- The text of the body of this element
end
public void end(String namespace,
String name)
throws Exception
Process the end of this element.
- end in interface Rule
namespace
- the namespace URI of the matching element, or an
empty string if the parser is not namespace aware or the element has
no namespacename
- the local name if the parser is namespace aware, or just
the element name otherwise
finish
public void finish()
throws Exception
Clean up after parsing is complete.
- finish in interface Rule
toString
public String toString()
Render a printable version of this Rule.
Copyright 2001-2005 The Apache Software Foundation.