You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by rd...@apache.org on 2003/04/08 15:42:32 UTC
cvs commit: jakarta-commons/betwixt/xdocs overview.xml tasks.xml
rdonkin 2003/04/08 06:42:32
Modified: betwixt/xdocs overview.xml tasks.xml
Log:
Added document for new updater attribute
Revision Changes Path
1.15 +32 -0 jakarta-commons/betwixt/xdocs/overview.xml
Index: overview.xml
===================================================================
RCS file: /home/cvs/jakarta-commons/betwixt/xdocs/overview.xml,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- overview.xml 19 Mar 2003 22:53:51 -0000 1.14
+++ overview.xml 8 Apr 2003 13:42:32 -0000 1.15
@@ -471,6 +471,38 @@
</p>
</subsection>
+<subsection name='Advanced Updaters'>
+ <p>
+Betwixt by default uses the property write method for standard properties
+and matched stems for composite properties (for more details, see
+<a href="#Using adder methods for composite properties">here</a>)
+to update property values when reading beans.
+These approaches should be sufficient for most cases.
+But this can be overruled on a per element basis.
+ </p>
+ <p>
+By using a .betwixt file, the method used to update the bean can be controlled on a per element basis.
+When the value of the <code>updater</code> attribute of an <code><element></code> element is set,
+Betwixt will try to find a bean method with a matching name which takes a single parameter.
+When such a matching method exists, this will be called to update the property value.
+ </p>
+ <p>
+For example, the following betwixt file fragment:
+
+<source><![CDATA[
+<?xml version="1.0" encoding="UTF-8" ?>
+<info primitiveTypes="element">
+ <element name="bean">
+ ...
+ <element name='name' property='name' updater='nameSetter'/>
+ ...
+ </element>
+</info>
+]]></source>
+
+will look for a method called 'nameSetter' and use that to update the value mapped to the 'name' element.
+ </p>
+</subsection>
</section>
<section name="Examples">
1.12 +4 -5 jakarta-commons/betwixt/xdocs/tasks.xml
Index: tasks.xml
===================================================================
RCS file: /home/cvs/jakarta-commons/betwixt/xdocs/tasks.xml,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- tasks.xml 19 Mar 2003 22:53:51 -0000 1.11
+++ tasks.xml 8 Apr 2003 13:42:32 -0000 1.12
@@ -61,11 +61,6 @@
Run test coverage tool and improve coverage of key functionality.
</li>
<li>
- <strong>Allow customization for update from .betwixt file</strong>
- Add updater attribute that allows the updater to be specified for an elements.
- This should also allow updaters to be ignored for certain properties.
- </li>
- <li>
<strong>Add dynabeans support.</strong>
Dynabeans are a feature of <code>commons-beanutils</code> that allows data in non-beans to be
wrapped into pseudo-beans. If betwixt supported dynabeans then you could do cool stuff like
@@ -204,6 +199,10 @@
body text between child elements through the .betwixt file. This text can be
static or set from a property.
</li>
+ <li>
+ <strong>Allow customization for update from .betwixt file</strong>
+ Add updater attribute that allows the updater to be specified for an elements.
+ </li>
</ul>
</subsection>
</section>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org