|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.digester.Rule
org.apache.commons.digester.BeanPropertySetterRule
public class BeanPropertySetterRule
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.
| Field Summary | |
|---|---|
protected String |
bodyText
The body text used to set the property. |
protected 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,
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(String propertyName)
Construct rule that sets the given property from the body text. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class org.apache.commons.digester.Rule |
|---|
begin, begin, body, end, getDigester, getNamespaceURI, setDigester, setNamespaceURI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected String propertyName
protected String bodyText
| Constructor Detail |
|---|
@Deprecated
public BeanPropertySetterRule(Digester digester,
String propertyName)
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.
digester - associated DigesterpropertyName - name of property to set@Deprecated public BeanPropertySetterRule(Digester digester)
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.
digester - associated Digesterpublic BeanPropertySetterRule(String propertyName)
Construct rule that sets the given property from the body text.
propertyName - name of property to setpublic 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 |
|---|
public void body(String namespace,
String name,
String text)
throws Exception
body in class Rulenamespace - 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
Exception
public void end(String namespace,
String name)
throws Exception
end in class Rulenamespace - 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
NoSuchMethodException - if the bean does not
have a writeable property of the specified name
Exception
public void finish()
throws Exception
finish in class RuleExceptionpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||