You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by js...@apache.org on 2002/01/31 20:56:03 UTC

cvs commit: jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt RSSBeanWriter.java TestBeanReader.java customer.xml rss-example.xml AbstractTestCase.java SampleBeanWriter.java TestAll.java TestBeanWriter.java TestXMLIntrospector.java

jstrachan    02/01/31 11:56:03

  Modified:    betwixt  PROPOSAL.html STATUS.html build.xml
               betwixt/src/java/org/apache/commons/betwixt
                        ElementDescriptor.java NodeDescriptor.java
                        XMLIntrospector.java
               betwixt/src/java/org/apache/commons/betwixt/expression
                        ConstantExpression.java Context.java
                        EmptyExpression.java Expression.java
                        IteratorExpression.java MethodExpression.java
                        StringExpression.java VariableExpression.java
               betwixt/src/test/org/apache/commons/betwixt
                        AbstractTestCase.java SampleBeanWriter.java
                        TestAll.java TestBeanWriter.java
                        TestXMLIntrospector.java
  Added:       betwixt  OVERVIEW.html
               betwixt/src/java/org/apache/commons/betwixt/expression
                        MethodUpdater.java Updater.java
               betwixt/src/java/org/apache/commons/betwixt/io
                        BeanCreateRule.java BeanReader.java
               betwixt/src/test/org/apache/commons/betwixt
                        RSSBeanWriter.java TestBeanReader.java customer.xml
                        rss-example.xml
  Log:
  Added a much cleaner build.xml file from commons-digester so that proper linked JavaDoc is used as well as being much tidier alround. Added more examples, such as the RSSBeanWriter example that demonstrates using Digester to parse XML and betwixt to write it back out again. This will give us a good test case to customize the output to match the ordering and naming of the DTD. Added alpha coding of a BeanReader which extends Digester and defaults the rules based on the XMLBeanInfo for registered bean classes. Finally improved documentation, added Robert as a committer and started an overview guide.
  
  Revision  Changes    Path
  1.3       +25 -10    jakarta-commons-sandbox/betwixt/PROPOSAL.html
  
  Index: PROPOSAL.html
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/PROPOSAL.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PROPOSAL.html	19 Dec 2001 20:07:19 -0000	1.2
  +++ PROPOSAL.html	31 Jan 2002 19:56:02 -0000	1.3
  @@ -10,9 +10,15 @@
   
   <h3>(0) Rationale</h3>
   <p>
  -   The Betwixt library provides an XML BeanInfo mechansim
  -   for mapping beans to XML structures in a flexible way.
  -</p>
  +   The Betwixt library provides an XML introspection mechanism
  +   for mapping beans to XML  in a flexible way. It is implemented using an 
  +   XMLIntrospector and XMLBeanInfo classes which are similar to the standard 
  +   Introspector and BeanInfo from the Java Beans specification.</p>
  +<p>
  +   Betwixt provides a way of turning beans into XML as well as automatically 
  +   generating digester rules in a way that can be customized on a per type 
  +   manner in the same way that the BeanInfo mechanism can be used to customize 
  +   the default introspection on a java object.</p>
   <p>
     The Betwixt library could be shared across various projects such
     as JXPath, Jaxen, domify and dom4j.
  @@ -26,12 +32,20 @@
   
   <h3>(1.5) Interaction With Other Packages</h3>
   
  -<p><em>Betwixt</em> relies only on standard JDK 1.2 (or later) APIs for
  -production deployment.  It utilizes the JUnit unit testing framework for
  -developing and executing unit tests, but this is of interest only to
  -developers of the component.  Betwixt also currently uses
  -the Jakarta Commons Collections subproject. 
  -Logging is provided by the Jakarta Commons Logging subproject.
  +<p><em>Betwixt</em> relies only on standard JDK 1.2 (or later) APIs for 
  +production deployment.
  +
  +<p><i>Betwixt</i> also currently uses the following packages from Jakarta 
  +Commons<ul>
  +  <li>Collections (1.1 or greater)</li>
  +  <li>Logging (1.0 or greater)</li>
  +  <li>BeanUtils (1.1 or greater)</li>
  +  <li>Digester (1.1 or greater)</li>
  +  </ul>
  +
  +<p><i>Betwixt</i> utilizes the JUnit unit testing framework for developing and 
  +executing unit tests, but this is of interest only to developers of the 
  +component.
   
   <p> No external configuration files are utilized. </p>
   
  @@ -69,6 +83,7 @@
   <h3>(4) Initial Committers</h3>
   <ul>
      <li>James Strachan</li>
  +   <li>Robert Burrell Donkin</li>
   </ul>
   </body>
  -</html>
  +</html>
  \ No newline at end of file
  
  
  
  1.2       +41 -2     jakarta-commons-sandbox/betwixt/STATUS.html
  
  Index: STATUS.html
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/STATUS.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- STATUS.html	22 Aug 2001 12:25:01 -0000	1.1
  +++ STATUS.html	31 Jan 2002 19:56:02 -0000	1.2
  @@ -7,7 +7,7 @@
   
   <div align="center">
   <h1>The Jakarta Commons <em>Betwixt</em> Package</h1>
  -$Id: STATUS.html,v 1.1 2001/08/22 12:25:01 jstrachan Exp $<br>
  +$Id: STATUS.html,v 1.2 2002/01/31 19:56:02 jstrachan Exp $<br>
   <a href="#Introduction">[Introduction]</a>
   <a href="#Dependencies">[Dependencies]</a>
   <a href="#Release Info">[Release Info]</a>
  @@ -41,6 +41,11 @@
       (Version 1.2 or later)</li>
   <li><a href="http://jakarta.apache.org/commons/collections.html">Jakarta Commons Collections</a>
       (Version 1.1 or later)</li>
  +<li><a href="http://jakarta.apache.org/commons/beanutils.html">Jakarta Commons BeanUtils</a> (Version 1.1 or later)</li>
  +<li><a href="http://jakarta.apache.org/commons/digester.html">Jakarta Commons Digester</a>
  +    (Version 1.1 or later)</li>
  +<li><a href="http://jakarta.apache.org/commons/logger.html">Jakarta Commons Logger</a>
  +    (Version 1.0 or later)</li>
   <li><a href="http://www.junit.org">JUnit Testing Framework</a>
       (Version 3.7 or later) - for unit tests only, not required
       for deployment</li>
  @@ -66,6 +71,7 @@
   component to ensure that it continues to meet a variety of needs.</p>
   <ul>
      <li><a href="mailto:jstrachan@apache.org">James Strachan</a></li>
  +   <li>Robert Burrell Donkin</li>
   </ul>
   
   <a name="Action Items"></a>
  @@ -85,6 +91,39 @@
     </tr>
   
     <tr>
  +    <td><b>Custom XMLBeanInfo classes</b>. We need a way for developers to write 
  +    their own XMLBeanInfo classes in the same way that BeanInfo classes can be 
  +    written for beans. We need to change the XMLIntrospector code to be able to 
  +    search for custom XMLBeanInfo classes just like the standard beans 
  +    Introspector.</td>
  +    <td align="center">&nbsp;</td>
  +  </tr>
  +
  +  <tr>
  +    <td><b>Maybe have XML document for customizing mapping</b>? Rather than 
  +    hand-code numberous XMLBeanInfo classes it could be useful to have another 
  +    mechanism, such as a package-level XML document where all the beans in a 
  +    package may be configured using a simple XML document.<p>e.g. consider that 
  +    there is a package called &quot;com.acme&quot; with the following beans...</p>
  +    <pre>com.acme.Customer</pre>
  +    <pre>com.acme.Address</pre>
  +    <pre>com.acme.Order</pre>
  +    <p>Then some XML document could be searched for in the same package, say 
  +    called com.acme.betwixt.xml which could have the following form...</p>
  +    <pre>&lt;betwixt&gt;</pre>
  +    <pre>  &lt;!-- this document overides the defaults --&gt;	</pre>
  +    <pre>  &lt;!-- that the introspector will choose --&gt;	</pre>
  +    <pre>  &lt;bean class=&quot;com.acme.Customer&quot;&gt;</pre>
  +    <pre>    &lt;element name=&quot;Address&quot; expression=&quot;address&quot;/&gt;</pre>
  +    <pre>    &lt;attribute name=&quot;fullname&quot; expression=&quot;fullname&quot;/&gt;</pre>
  +    <pre>    &lt;hide properties=&quot;id description&quot;/&gt;	</pre>
  +    <pre>  &lt;/bean&gt;</pre>
  +    <pre>&lt;/betwixt&gt;</pre>
  +    <p>&nbsp;</td>
  +    <td align="center">&nbsp;</td>
  +  </tr>
  +
  +  <tr>
       <td><strong>Additional Documentation</strong>.  Create simple
           User's Guide, examples, or other documentation for this package.</td>
       <td align="center">&nbsp;</td>
  @@ -92,4 +131,4 @@
   </table>
   
   </body>
  -</html>
  +</html>
  \ No newline at end of file
  
  
  
  1.8       +284 -256  jakarta-commons-sandbox/betwixt/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/build.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- build.xml	30 Jan 2002 19:41:06 -0000	1.7
  +++ build.xml	31 Jan 2002 19:56:02 -0000	1.8
  @@ -1,262 +1,290 @@
  -<!-- $Id: build.xml,v 1.7 2002/01/30 19:41:06 rdonkin Exp $ -->
  -<project name="betwixt" default="test" basedir=".">
  +<project name="Digester" default="compile" basedir=".">
   
  -   <!-- patternset describing files to be copied from the doc directory -->
  -   <patternset id="patternset-doc"/>
   
  -   <!-- patternset describing test classes -->
  -   <patternset id="patternset-test-classes">
  -      <include name="**/Test*.class"/>
  -   </patternset>
  -
  -   <!-- patternset describing non test classes -->
  -   <patternset id="patternset-non-test-classes">
  -      <include name="**/*.class"/>
  -      <exclude name="**/Test*.class"/>
  -   </patternset>
  -
  -   <!-- patternset describing non test source files (*.java, *html, etc.) -->
  -   <patternset id="patternset-javadocable-sources">
  -      <include name="**/*"/>
  -      <exclude name="**/Test*.java"/>
  -   </patternset>
  -
  -   <!-- ######################################################### -->
  -
  -   <target name="init">
  -      <tstamp/>
  -
  -      <!-- read properties from the build.properties, if any -->
  -      <property name="component-propfile" value="${basedir}/build.properties"/>
  -      <property file="${component-propfile}"/>
  -
  -      <!-- read properties from the commons build.properties, if any -->
  -      <property name="commons-propfile" value="${basedir}/../build.properties"/>
  -      <property file="${commons-propfile}"/>
  -
  -      <!-- read properties from the ${user.home}/propfile, if any -->
  -      <property name="user-propfile" value="${user.home}/build.properties"/>
  -      <property file="${user-propfile}"/>
  -
  -
  -      <!-- default properties -->
  -      <property name="jdk-doc-url" value="http://java.sun.com/products/jdk/1.3/docs/api"/>
  -
  -      <!-- command line classpath, if any -->
  -      <property name="cp" value=""/>
  -
  -      <!-- now combine the classpaths -->
  -      <property name="classpath" value="${cp}:${collections.jar}:${junit.jar}:${logging.jar}"/>
  -
  -      <property name="name" value="betwixt"/>
  -      <property name="Name" value="Betwixt"/>
  -      <property name="Name-Long" value="Jakarta Commons Betwixt Package"/>
  -
  -      <!-- The current version number of this component -->
  -      <property name="component.version"       value="1.0-dev"/>
  -
  -      <property name="test.entry" value="org.apache.commons.betwixt.TestAll"/>
  -      <property name="test.failonerror" value="true" />
  -      <property name="test.runner" value="junit.textui.TestRunner" />
  -
  -      <property name="workdir" value="${java.io.tmpdir}/buildtemp_${DSTAMP}${TSTAMP}"/>
  -      <property name="source" value="${basedir}"/>
  -      <property name="source.src" value="${basedir}/src"/>
  -      <property name="source.src.java" value="${source.src}/java"/>
  -      <property name="source.src.test" value="${source.src}/test"/>
  -      <property name="source.doc" value="${basedir}/doc"/>
  -      <property name="dest" value="${basedir}/dist"/>
  -      <property name="dest.classes" value="${dest}/classes"/>
  -      <property name="dest.doc" value="${dest}/docs"/>
  -      <property name="dest.doc.api" value="${dest.doc}/api"/>
  -      <property name="dest.jardir" value="${dest}"/>
  -      <property name="dest.jardir.jar" value="${dest.jardir}/${name}.jar"/>
  -
  -      <available property="available-doc" file="${source.doc}"/> <!-- does this module have docs? -->
  -      <available property="available-src-java" file="${source.src.java}"/> <!-- does this module have java src? -->
  -      <available property="available-src-test" file="${source.src.test}"/> <!-- does this module have test src? -->
  -
  -   </target>
  -
  -   <!-- ######################################################### -->
  -
  -   <target name="copy-javadoc-source" depends="init" if="available-src-java">
  -      <mkdir dir="${javadoc-source-dir}"/>
  -      <copy todir="${javadoc-source-dir}" filtering="no">
  -         <fileset dir="${source.src.java}">
  -            <patternset refid="patternset-javadocable-sources"/>
  -         </fileset>
  -      </copy>
  -   </target>
  -
  -   <target name="copy-doc" depends="init" if="available-doc">
  -      <mkdir dir="${doc-source-dir}/${name}"/>
  -      <copy todir="${doc-source-dir}/${name}" filtering="no">
  -         <fileset dir="${source.doc}">
  -            <patternset refid="patternset-doc"/>
  -         </fileset>
  -      </copy>
  -   </target>
  -
  -   <!-- ######################################################### -->
  -
  -   <target name="clean" depends="init" description="removes generated files">
  -      <delete dir="${dest}"/>
  -   </target>
  -
  -   <target name="clean-doc" depends="init,clean-javadoc">
  -      <delete dir="${dest.doc}"/>
  -   </target>
  -
  -   <target name="clean-javadoc" depends="init">
  -      <delete dir="${dest.doc.api}"/>
  -   </target>
  -
  -   <target name="clean-build" depends="init">
  -      <delete dir="${dest.classes}"/>
  -   </target>
  -
  -   <target name="clean-dist" depends="init">
  -      <delete file="${dest.jardir.jar}"/>
  -   </target>
  -
  -   <!-- ######################################################### -->
  -
  -   <target name="doc" depends="init,doc-top,doc-copy,doc-javadoc" description="generates javadocs and other documentation">
  -   </target>
  -
  -   <target name="doc-top" depends="init">
  -      <mkdir  dir="${dest}"/>
  -      <copy todir="${dest}" file="../LICENSE"/>
  -   </target>
  -
  -   <target name="doc-copy" depends="init" if="available-doc">
  -      <mkdir dir="${dest.doc}"/>
  -      <copy todir="${dest.doc}">
  -      <fileset dir="${source.doc}">
  -         <patternset refid="patternset-doc"/>
  -      </fileset>
  -      </copy>
  -   </target>
  -
  -   <target name="doc-javadoc" depends="init" if="available-src-java">
  -      <!-- copy all the non-test sources out to the work directory and javadoc that -->
  -      <mkdir dir="${workdir}"/>
  -      <copy todir="${workdir}">
  -        <fileset dir="${source.src.java}">
  -          <patternset refid="patternset-javadocable-sources"/>
  -        </fileset>
  -      </copy>
  -      <mkdir dir="${dest.doc.api}"/>
  -      <javadoc packagenames="org.*, javax.*"
  -               sourcepath="${workdir}"
  -               destdir="${dest.doc.api}"
  -               windowtitle="${Name-Long}"
  -               doctitle="${Name-Long}"
  -               bottom="&lt;small&gt;Copyright &amp;copy; 2001-2002 Apache Software Foundation. Documentation generated ${TODAY}&lt;/small&gt;."
  -               public="true"
  -               version="true"
  -               author="true"
  -               splitindex="false"
  -               nodeprecated="true"
  -               nodeprecatedlist="true"
  -               notree="true"
  -               noindex="false"
  -               nohelp="true"
  -               nonavbar="false"
  -               serialwarn="false">
  -          <link href="${jdk-doc-url}"/>
  -      </javadoc>
  -      <delete dir="${workdir}"/>
  -   </target>
  -
  -   <!-- ######################################################### -->
  -
  -   <target name="build" depends="init,build-java" description="compiles source files"/>
  -
  -   <target name="build-java" depends="init" if="available-src-java">
  -      <mkdir dir="${dest.classes}"/>
  -      <javac destdir="${dest.classes}"
  -             srcdir="${source.src.java}"
  -             classpath="${classpath}"
  -             debug="false"
  -             deprecation="true"
  -             optimize="true"/>
  -   </target>
  -
  -   <target name="build-test" depends="init,build-java" if="available-src-test">
  -      <mkdir dir="${dest.classes}"/>
  -      <javac destdir="${dest.classes}"
  -             srcdir="${source.src.test}"
  -             classpath="${classpath}"
  -             debug="false"
  -             deprecation="true"
  -             optimize="true"/>
  +<!--
  +        "Digester" component of the Jakarta Commons Subproject
  +        $Id: build.xml,v 1.8 2002/01/31 19:56:02 jstrachan Exp $
  +-->
  +
  +
  +<!-- ========== Initialize Properties ===================================== -->
  +
  +
  +  <property file="build.properties"/>                <!-- Component local   -->
  +  <property file="../build.properties"/>             <!-- Commons local     -->
  +  <property file="${user.home}/build.properties"/>   <!-- User local        -->
  +
  +
  +<!-- ========== External Dependencies ===================================== -->
  +
  +
  +  <!-- The directories corresponding to your necessary dependencies -->
  +  <property name="jaxp.home"               value="/usr/local/jaxp1.1"/>
  +  <property name="jdk.home"                value="/usr/local/jdk1.3"/>
  +  <property name="junit.home"              value="/usr/local/junit3.7"/>
  +  <property name="commons.home"            value="../../jakarta-commons"/>
  +  <property name="beanutils.home"          value="${commons.home}/beanutils"/>
  +  <property name="collections.home"        value="${commons.home}/collections"/>
  +  <property name="logging.home"            value="${commons.home}/logging"/>
  +  <property name="digester.home"           value="${commons.home}/digester"/>
  +
  +
  +<!-- ========== Derived Values ============================================ -->
  +
  +
  +  <!-- The locations of necessary jar files -->
  +  <property name="jdk.api"                 value="${jdk.home}/docs/api"/>
  +  <property name="jaxp.jaxp.jar"           value="${jaxp.home}/jaxp.jar"/>
  +  <property name="jaxp.parser.jar"         value="${jaxp.home}/crimson.jar"/>
  +  <property name="jaxp.api"                value="${jaxp.home}/docs/api"/>
  +  <property name="junit.jar"               value="${junit.home}/junit.jar"/>
  +  <property name="commons-beanutils.api"   value="${beanutils.home}/dist/docs/api"/>
  +  <property name="commons-beanutils.jar"   value="${beanutils.home}/dist/commons-beanutils.jar"/>
  +  <property name="commons-collections.api" value="${collections.home}/dist/docs/api"/>
  +  <property name="commons-collections.jar" value="${collections.home}/dist/commons-collections.jar"/>
  +  <property name="commons-logging.api"     value="${logging.home}/dist/docs/api"/>
  +  <property name="commons-logging.jar"     value="${logging.home}/dist/commons-logging.jar"/>
  +  <property name="commons-digester.api"    value="${digester.home}/dist/docs/api"/>
  +  <property name="commons-digester.jar"    value="${digester.home}/dist/commons-digester.jar"/>
  +  
  +
  +<!-- ========== Component Declarations ==================================== -->
  +
  +
  +  <!-- The name of this component -->
  +  <property name="component.name"          value="betwixt"/>
  +
  +  <!-- The primary package name of this component -->
  +  <property name="component.package"       value="org.apache.commons.betwixt"/>
  +
  +  <!-- The title of this component -->
  +  <property name="component.title"         value="Betwixt - mapping beans to XML"/>
  +
  +  <!-- The current version number of this component -->
  +  <property name="component.version"       value="1.0-dev"/>
  +
  +  <!-- The base directory for compilation targets -->
  +  <property name="build.home"              value="target"/>
  +
  +  <!-- The base directory for component configuration files -->
  +  <property name="conf.home"               value="src/conf"/>
  +
  +  <!-- The base directory for distribution targets -->
  +  <property name="dist.home"               value="dist"/>
  +
  +  <!-- The base directory for component sources -->
  +  <property name="source.home"             value="src/java"/>
  +
  +  <!-- The base directory for unit test sources -->
  +  <property name="test.home"               value="src/test"/>
  +
  +
  +<!-- ========== Compiler Defaults ========================================= -->
  +
  +
  +  <!-- Should Java compilations set the 'debug' compiler option? -->
  +  <property name="compile.debug"           value="true"/>
  +
  +  <!-- Should Java compilations set the 'deprecation' compiler option? -->
  +  <property name="compile.deprecation"     value="false"/>
  +
  +  <!-- Should Java compilations set the 'optimize' compiler option? -->
  +  <property name="compile.optimize"        value="true"/>
  +
  +  <!-- Construct compile classpath -->
  +  <path id="compile.classpath">
  +    <pathelement location="${build.home}/classes"/>
  +    <pathelement location="${jaxp.jaxp.jar}"/>
  +    <pathelement location="${jaxp.parser.jar}"/>
  +    <pathelement location="${commons-beanutils.jar}"/>
  +    <pathelement location="${commons-collections.jar}"/>
  +    <pathelement location="${commons-logging.jar}"/>
  +    <pathelement location="${commons-digester.jar}"/>
  +    <pathelement location="${junit.jar}"/>
  +  </path>
  +
  +
  +<!-- ========== Test Execution Defaults =================================== -->
  +
  +
  +  <!-- Construct unit test classpath -->
  +  <path id="test.classpath">
  +    <pathelement location="${build.home}/classes"/>
  +    <pathelement location="${build.home}/tests"/>
  +    <pathelement location="${junit.jar}"/>
  +    <pathelement location="${jaxp.jaxp.jar}"/>
  +    <pathelement location="${jaxp.parser.jar}"/>
  +    <pathelement location="${commons-beanutils.jar}"/>
  +    <pathelement location="${commons-collections.jar}"/>
  +    <pathelement location="${commons-logging.jar}"/>
  +    <pathelement location="${commons-digester.jar}"/>
  +  </path>
  +
  +  <!-- Should all tests fail if one does? -->
  +  <property name="test.failonerror"        value="true"/>
  +
  +  <!-- The test runner to execute -->
  +  <property name="test.runner"             value="junit.textui.TestRunner"/>
  +
  +
  +<!-- ========== Executable Targets ======================================== -->
  +
  +
  +  <target name="init"
  +   description="Initialize and evaluate conditionals">
  +    <echo message="-------- ${component.name} ${component.version} --------"/>
  +    <filter  token="name"                  value="${component.package}"/>
  +    <filter  token="version"               value="${component.version}"/>
  +  </target>
  +
  +
  +  <target name="prepare" depends="init"
  +   description="Prepare build directory">
  +    <mkdir dir="${build.home}"/>
  +    <mkdir dir="${build.home}/classes"/>
  +    <mkdir dir="${build.home}/conf"/>
  +    <mkdir dir="${build.home}/tests"/>
  +  </target>
  +
  +
  +  <target name="static" depends="prepare"
  +   description="Copy static files to build directory">
  +    <tstamp/>
  +    <copy  todir="${build.home}/conf" filtering="on">
  +      <fileset dir="${conf.home}" includes="*.MF"/>
  +    </copy>
  +  </target>
  +
  +
  +  <target name="compile" depends="static"
  +   description="Compile shareable components">
  +    <javac  srcdir="${source.home}"
  +           destdir="${build.home}/classes"
  +             debug="${compile.debug}"
  +       deprecation="${compile.deprecation}"
  +          optimize="${compile.optimize}">
  +      <classpath refid="compile.classpath"/>
  +    </javac>
  +    <copy    todir="${build.home}/classes" filtering="on">
  +      <fileset dir="${source.home}" excludes="**/*.java"/>
  +    </copy>
  +  </target>
  +
  +
  +  <target name="compile.tests" depends="compile"
  +   description="Compile unit test cases">
  +    <javac  srcdir="${test.home}"
  +           destdir="${build.home}/tests"
  +             debug="${compile.debug}"
  +       deprecation="${compile.deprecation}"
  +          optimize="${compile.optimize}">
  +      <classpath refid="test.classpath"/>
  +    </javac>
  +    <copy    todir="${build.home}/tests" filtering="on">
  +      <fileset dir="${test.home}" excludes="**/*.java"/>
  +    </copy>
  +  </target>
  +
  +
  +  <target name="clean"
  +   description="Clean build and distribution directories">
  +    <delete    dir="${build.home}"/>
  +    <delete    dir="${dist.home}"/>
  +  </target>
  +
  +
  +  <target name="all" depends="clean,compile"
  +   description="Clean and compile all components"/>
  +
  +
  +  <target name="javadoc" depends="compile"
  +   description="Create component Javadoc documentation">
  +    <mkdir      dir="${dist.home}"/>
  +    <mkdir      dir="${dist.home}/docs"/>
  +    <mkdir      dir="${dist.home}/docs/api"/>
  +    <javadoc sourcepath="${source.home}"
  +                destdir="${dist.home}/docs/api"
  +           packagenames="org.apache.commons.*"
  +                 author="true"
  +                private="true"
  +                version="true"
  +               doctitle="&lt;h1&gt;${component.title}&lt;/h1&gt;"
  +            windowtitle="${component.title} (Version ${component.version})"
  +                 bottom="Copyright (c) 2002 - Apache Software Foundation">
  +      <link     offline="true" packagelistLoc="${commons-beanutils.api}"
  +                   href="http://jakarta.apache.org/commons/beanutils/api/"/>
  +      <link     offline="true" packagelistLoc="${commons-collections.api}"
  +                   href="http://jakarta.apache.org/commons/collections/api/"/>
  +      <link     offline="true" packagelistLoc="${commons-logging.api}"
  +                   href="http://jakarta.apache.org/commons/logging/api/"/>
  +      <link     offline="true"  packagelistLoc="${jdk.api}"
  +                   href="http://java.sun.com/products/jdk/1.3/docs/api"/>
  +      <link     offline="true"  packagelistLoc="${jaxp.api}"
  +                   href="http://java.sun.com/xml/jaxp-docs-1.1/docs/api"/>
  +      <classpath  refid="compile.classpath"/>
  +    </javadoc>
  +  </target>
  +
  +
  +  <target name="dist" depends="compile,javadoc"
  +   description="Create binary distribution">
  +    <mkdir      dir="${dist.home}"/>
  +    <copy      file="../LICENSE"
  +              todir="${dist.home}"/>
  +    <mkdir      dir="${build.home}/classes/META-INF"/>
  +    <copy      file="../LICENSE"
  +             tofile="${build.home}/classes/META-INF/LICENSE.txt"/>
  +    <jar    jarfile="${dist.home}/commons-${component.name}.jar"
  +            basedir="${build.home}/classes"
  +           manifest="${build.home}/conf/MANIFEST.MF"/>
  +  </target>
  +
  +
  +<!-- ========== Unit Test Targets ========================================= -->
  +
  +
  +  <target name="test" depends="compile.tests"
  +   description="Run all unit test cases">
  +    <java classname="org.apache.commons.betwixt.TestAll" fork="yes" failonerror="${test.failonerror}">
  +      <classpath refid="test.classpath"/>
  +    </java>
  +  </target>
  +
  +
  +   <target name="test.reader" depends="compile.tests" 
  +      description="Runs sample bean reader">
  +    <java classname="org.apache.commons.betwixt.TestBeanReader" fork="yes">
  +      <classpath refid="test.classpath"/>
  +      <sysproperty key="org.apache.commons.logging.log" value="org.apache.commons.logging.SimpleLog"/>
  +      <sysproperty key="org.apache.commons.logging.simplelog.defaultlog" value="info"/>
  +    </java>
  +   </target>
  +
  +<!-- ========== Sample Program Targets ==================================== -->
  +
  +   <target name="demo.writer" depends="compile.tests" 
  +      description="Runs sample bean writer">
  +    <echo message="Running sample bean writer..."/>
  +    <java classname="org.apache.commons.betwixt.SampleBeanWriter" fork="yes">
  +      <classpath refid="test.classpath"/>
  +    </java>
  +   </target>
  +
  +   <target name="demo.sys" depends="compile.tests" 
  +      description="Runs system properties sample">
  +    <echo message="Running system properties sample..."/>
  +    <java classname="org.apache.commons.betwixt.SystemProperties" fork="yes">
  +      <classpath refid="test.classpath"/>
  +    </java>
  +   </target>
  +
  +   <target name="demo.rss" depends="compile.tests" 
  +      description="Runs the RSS sample">
  +    <echo message="Running the RSS sample..."/>
  +    <java classname="org.apache.commons.betwixt.RSSBeanWriter" fork="yes">
  +      <classpath refid="test.classpath"/>
  +    </java>
      </target>
   
  -   <!-- ######################################################### -->
   
  -   <target name="test" depends="build-test" if="test.entry" description="runs (junit) unit tests">
  -      <!--
  -      <junit printsummary="yes" fork="on" haltonfailure="yes">
  -      	<formatter type="plain" usefile="false"/>
  -      	<test name="${test.entry}"/>
  -      	<classpath>
  -      		<pathelement location="${dest.classes}" />
  -      		<pathelement path="${classpath}" />
  -      		<pathelement path="${java.class.path}" />
  -      	</classpath>
  -      </junit>
  -      -->
  -
  -      <java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
  -        <arg value="${test.entry}"/>
  -        <classpath>
  -          <pathelement location="${dest.classes}" />
  -          <pathelement path="${classpath}" />
  -          <pathelement path="${java.class.path}" />
  -        </classpath>
  -      </java>
  -   </target>
  -
  -   <!-- ######################################################### -->
  -
  -   <target name="dist" depends="dist-jar,doc" description="builds binary distribution"/>
  -
  -   <target name="dist-jar" depends="build">
  -      <mkdir dir="${dest.jardir}"/>
  -      <mkdir dir="${workdir}"/>
  -      <copy todir="${workdir}">
  -         <fileset dir="${dest.classes}">
  -            <patternset refid="patternset-non-test-classes"/>
  -         </fileset>
  -      </copy>
  -      <jar jarfile="${dest.jardir.jar}" manifest="${source.src}/conf/MANIFEST.MF">
  -         <fileset dir="${workdir}"/>
  -      </jar>
  -      <delete dir="${workdir}"/>
  -      <delete dir="${dest.classes}"/>
  -   </target>
  -
  -   <!-- ######################################################### -->
  -
  -   <target name="demo" depends="build-test" description="runs sample program">
  -      <java classname="org.apache.commons.betwixt.SampleBeanWriter" fork="yes">
  -        <classpath>
  -          <pathelement location="${dest.classes}" />
  -          <pathelement path="${classpath}" />
  -          <pathelement path="${java.class.path}" />
  -        </classpath>
  -      </java>
  -   </target>
  -
  -   <target name="demo2" depends="build-test" description="runs sample program2">
  -      <java classname="org.apache.commons.betwixt.SystemProperties" fork="yes">
  -        <classpath>
  -          <pathelement location="${dest.classes}" />
  -          <pathelement path="${classpath}" />
  -          <pathelement path="${java.class.path}" />
  -        </classpath>
  -      </java>
  -   </target>
   </project>
  
  
  
  1.1                  jakarta-commons-sandbox/betwixt/OVERVIEW.html
  
  Index: OVERVIEW.html
  ===================================================================
  <html>
  
  <head>
  <meta http-equiv="Content-Language" content="en-gb">
  <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
  <meta name="ProgId" content="FrontPage.Editor.Document">
  <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  <title>Jakarta Commons Betwixt User Guide</title>
  </head>
  
  <body>
  
  <h1>Jakarta Commons <i>Betwixt</i> Overview</h1>
  <p>Betwixt aims to be a Java Bean to XML mapping library. It provides an 
  XMLIntrospector in a similar manner to the Introspector in the java.beans 
  package which defines how a bean appears as XML. There are many ways of encoding 
  beans as XML. Betwixt will provide a default representation based on 
  introspection which can be customized to taste to get nicer looking XML.</p>
  <h2>Getting Started</h2>
  <p>Probably the best way to get started is to look at some examples. The best 
  example to start with is the Ant target &quot;demo.rss&quot; which runs the RSSBeanWriter 
  sample program in the src/test directory. Once you've got the Jakarta Commons 
  build system working, by installing Ant and creating your own build.properties 
  to point to the required JARs type the following at a command line</p>
  <pre>ant demo-rss</pre>
  <p>This uses the Commons Digester RSSDigester example to parse an RSS document, 
  create a Channel bean and then write it out again as XML using the default 
  XMLIntrospector and the BeanWriter. You should see the XML come out from the 
  Channel bean which looks similar to a real RSS document.</p>
  <p>&nbsp;</p>
  
  </body>
  
  </html>
  
  
  
  1.6       +23 -6     jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/ElementDescriptor.java
  
  Index: ElementDescriptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/ElementDescriptor.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ElementDescriptor.java	30 Jan 2002 19:35:36 -0000	1.5
  +++ ElementDescriptor.java	31 Jan 2002 19:56:02 -0000	1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/ElementDescriptor.java,v 1.5 2002/01/30 19:35:36 rdonkin Exp $
  - * $Revision: 1.5 $
  - * $Date: 2002/01/30 19:35:36 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/ElementDescriptor.java,v 1.6 2002/01/31 19:56:02 jstrachan Exp $
  + * $Revision: 1.6 $
  + * $Date: 2002/01/31 19:56:02 $
    *
    * ====================================================================
    *
  @@ -57,7 +57,7 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    * 
  - * $Id: ElementDescriptor.java,v 1.5 2002/01/30 19:35:36 rdonkin Exp $
  + * $Id: ElementDescriptor.java,v 1.6 2002/01/31 19:56:02 jstrachan Exp $
    */
   package org.apache.commons.betwixt;
   
  @@ -70,7 +70,7 @@
     * and <code>ElementDescriptor</code>'s for it's child elements.
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.5 $
  +  * @version $Revision: 1.6 $
     */
   public class ElementDescriptor extends NodeDescriptor {
   
  @@ -82,11 +82,18 @@
       /** the expression used to evaluate the new context of this node 
        * or null if the same context is to be used */
       private Expression contextExpression;
  -  
  +
  +    /** Whether this element refers to a primitive type (or property of a parent object) */
  +    private boolean primitiveType;
  +    
       /** Base constructor */
       public ElementDescriptor() {
       }
   
  +    public ElementDescriptor(boolean primitiveType) {
  +        this.primitiveType = primitiveType;
  +    }
  +
       /** Creates a <code>ElementDescriptor</code> with no namespace URI or prefix */
       public ElementDescriptor(String localName) {
           super( localName );
  @@ -135,5 +142,15 @@
       /** Sets the expression used to evaluate the new context of this element */
       public void setContextExpression(Expression contextExpression) {
           this.contextExpression = contextExpression;
  +    }
  +    
  +    /** @return whether this element refers to a primitive type (or property of a parent object) */
  +    public boolean isPrimitiveType() {
  +        return primitiveType;
  +    }
  +    
  +    /** Sets whether this element refers to a primitive type (or property of a parent object) */
  +    public void setPrimitiveType(boolean primitiveType) {
  +        this.primitiveType = primitiveType;
       }
   }
  
  
  
  1.5       +38 -7     jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/NodeDescriptor.java
  
  Index: NodeDescriptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/NodeDescriptor.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- NodeDescriptor.java	30 Jan 2002 19:35:36 -0000	1.4
  +++ NodeDescriptor.java	31 Jan 2002 19:56:02 -0000	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/NodeDescriptor.java,v 1.4 2002/01/30 19:35:36 rdonkin Exp $
  - * $Revision: 1.4 $
  - * $Date: 2002/01/30 19:35:36 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/NodeDescriptor.java,v 1.5 2002/01/31 19:56:02 jstrachan Exp $
  + * $Revision: 1.5 $
  + * $Date: 2002/01/31 19:56:02 $
    *
    * ====================================================================
    *
  @@ -57,11 +57,12 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    * 
  - * $Id: NodeDescriptor.java,v 1.4 2002/01/30 19:35:36 rdonkin Exp $
  + * $Id: NodeDescriptor.java,v 1.5 2002/01/31 19:56:02 jstrachan Exp $
    */
   package org.apache.commons.betwixt;
   
   import org.apache.commons.betwixt.expression.Expression;
  +import org.apache.commons.betwixt.expression.Updater;
   
   /** <p> Common superclass for <code>ElementDescriptor</code> and <code>AttributeDescriptor</code>.</p>
     *
  @@ -69,7 +70,7 @@
     * or they can have a local name, qualified name and a namespace uri.</p>
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.4 $
  +  * @version $Revision: 1.5 $
     */
   public class NodeDescriptor {
   
  @@ -77,9 +78,13 @@
       private String localName;
       private String qualifiedName;
       /** The namespace URI of this node */
  -    private String uri;
  +    private String uri = "";
       /** the expression used to evaluate the text value of this node */
       private Expression textExpression;
  +    /** the updater used to update the current bean from the text value of this node */
  +    private Updater updater;
  +    /** the property type associated with this node, if any */
  +    private Class propertyType;
       
       /** Base constructor */
       public NodeDescriptor() {
  @@ -128,13 +133,19 @@
       
       /** Returns the namespace URI that this node belongs to or "" if there is no namespace defined */
       public String getURI() {
  -        return ( uri != null ) ? uri : "";
  +        return uri;
       }
       
   
       /** Sets the namespace URI that this node belongs to.
        */
       public void setURI(String uri) {
  +        if ( uri == null ) {
  +            throw new IllegalArgumentException( 
  +                "The namespace URI cannot be null. " 
  +                + "No namespace URI is specified with the empty string" 
  +            );
  +        }
           this.uri = uri;
       }
       
  @@ -146,5 +157,25 @@
       /** Sets the expression used to evaluate the text value of this node */
       public void setTextExpression(Expression textExpression) {
           this.textExpression = textExpression;
  +    }
  +    
  +    /** the updater used to update the current bean from the text value of this node */
  +    public Updater getUpdater() {
  +        return updater;
  +    }
  +    
  +    /** sets the updater used to update the current bean from the text value of this node */
  +    public void setUpdater(Updater updater) {
  +        this.updater = updater;
  +    }
  +    
  +    /** @return the property type associated with this node, if any */
  +    public Class getPropertyType() {
  +        return propertyType;
  +    }
  +    
  +    /** Sets the property type associated with this node, if any */
  +    public void setPropertyType(Class propertyType) {
  +        this.propertyType = propertyType;
       }
   }
  
  
  
  1.14      +16 -8     jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/XMLIntrospector.java
  
  Index: XMLIntrospector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/XMLIntrospector.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- XMLIntrospector.java	30 Jan 2002 19:35:36 -0000	1.13
  +++ XMLIntrospector.java	31 Jan 2002 19:56:02 -0000	1.14
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/XMLIntrospector.java,v 1.13 2002/01/30 19:35:36 rdonkin Exp $
  - * $Revision: 1.13 $
  - * $Date: 2002/01/30 19:35:36 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/XMLIntrospector.java,v 1.14 2002/01/31 19:56:02 jstrachan Exp $
  + * $Revision: 1.14 $
  + * $Date: 2002/01/31 19:56:02 $
    *
    * ====================================================================
    *
  @@ -57,7 +57,7 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    * 
  - * $Id: XMLIntrospector.java,v 1.13 2002/01/30 19:35:36 rdonkin Exp $
  + * $Id: XMLIntrospector.java,v 1.14 2002/01/31 19:56:02 jstrachan Exp $
    */
   package org.apache.commons.betwixt;
   
  @@ -85,12 +85,13 @@
   import org.apache.commons.betwixt.expression.Expression;
   import org.apache.commons.betwixt.expression.IteratorExpression;
   import org.apache.commons.betwixt.expression.MethodExpression;
  +import org.apache.commons.betwixt.expression.MethodUpdater;
   import org.apache.commons.betwixt.expression.StringExpression;
   
   /** <p><code>XMLIntrospector</code> an introspector of beans to create a XMLBeanInfo instance.</p>
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.13 $
  +  * @version $Revision: 1.14 $
     */
   public class XMLIntrospector {
   
  @@ -155,10 +156,12 @@
           
           ElementDescriptor elementDescriptor = new ElementDescriptor();
           elementDescriptor.setLocalName( beanDescriptor.getName() );
  +        elementDescriptor.setPropertyType( beanInfo.getBeanDescriptor().getBeanClass() );
           
           // add default string value for primitive types
           if ( isPrimitiveType( beanType ) ) {
               elementDescriptor.setTextExpression( StringExpression.getInstance() );
  +            elementDescriptor.setPrimitiveType(true);
           }
           else if ( isLoopType( beanType ) ) {
               ElementDescriptor loopDescriptor = new ElementDescriptor();
  @@ -252,10 +255,11 @@
           Class type = propertyDescriptor.getPropertyType();
           NodeDescriptor nodeDescriptor = null;
           Method readMethod = propertyDescriptor.getReadMethod();
  +        Method writeMethod = propertyDescriptor.getWriteMethod();
           if ( readMethod == null ) {
               return;
           }
  -        // ignore class property
  +        // XXX: ignore class property ??
           if ( Class.class.equals( type ) && "class".equals( propertyDescriptor.getName() ) ) {
               return;
           }
  @@ -265,16 +269,19 @@
                   attributes.add( nodeDescriptor );
               }
               else {
  -                nodeDescriptor = new ElementDescriptor();
  +                nodeDescriptor = new ElementDescriptor(true);
                   elements.add( nodeDescriptor );
               }
               nodeDescriptor.setTextExpression( new MethodExpression( readMethod ) );
  +            nodeDescriptor.setUpdater( new MethodUpdater( writeMethod ) );
           }
           else if ( isLoopType( type ) ) {
               ElementDescriptor loopDescriptor = new ElementDescriptor();
               loopDescriptor.setContextExpression(
                   new IteratorExpression( new MethodExpression( readMethod ) )
               );
  +            // XXX: need to support some kind of 'add' or handle arrays, Lists or indexed properties
  +            //loopDescriptor.setUpdater( new MethodUpdater( writeMethod ) );
               if ( Map.class.isAssignableFrom( type ) ) {
                   loopDescriptor.setQualifiedName( "entry" );
               }
  @@ -288,16 +295,17 @@
           else {
               ElementDescriptor elementDescriptor = new ElementDescriptor();
               elementDescriptor.setContextExpression( new MethodExpression( readMethod ) );
  +            elementDescriptor.setUpdater( new MethodUpdater( writeMethod ) );
               
               nodeDescriptor = elementDescriptor;            
               elements.add( nodeDescriptor );
           }
           nodeDescriptor.setLocalName( propertyDescriptor.getName() );
  +        nodeDescriptor.setPropertyType( type );        
           
           // XXX: associate more bean information with the descriptor?
           //nodeDescriptor.setDisplayName( propertyDescriptor.getDisplayName() );
           //nodeDescriptor.setShortDescription( propertyDescriptor.getShortDescription() );
  -        //nodeDescriptor.setTypeName( type.getName() );        
       }
       
       /** Factory method to create XMLBeanInfo instances */
  
  
  
  1.4       +9 -5      jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/ConstantExpression.java
  
  Index: ConstantExpression.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/ConstantExpression.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ConstantExpression.java	30 Jan 2002 19:35:36 -0000	1.3
  +++ ConstantExpression.java	31 Jan 2002 19:56:02 -0000	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/ConstantExpression.java,v 1.3 2002/01/30 19:35:36 rdonkin Exp $
  - * $Revision: 1.3 $
  - * $Date: 2002/01/30 19:35:36 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/ConstantExpression.java,v 1.4 2002/01/31 19:56:02 jstrachan Exp $
  + * $Revision: 1.4 $
  + * $Date: 2002/01/31 19:56:02 $
    *
    * ====================================================================
    *
  @@ -57,7 +57,7 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    * 
  - * $Id: ConstantExpression.java,v 1.3 2002/01/30 19:35:36 rdonkin Exp $
  + * $Id: ConstantExpression.java,v 1.4 2002/01/31 19:56:02 jstrachan Exp $
    */
   package org.apache.commons.betwixt.expression;
   
  @@ -66,7 +66,7 @@
     * <p> In other words, {@link #evaluate} returns a value independent of the context. </p>
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.3 $
  +  * @version $Revision: 1.4 $
     */
   public class ConstantExpression implements Expression {
   
  @@ -94,6 +94,10 @@
           return value;
       }
       
  +    public void update(Context context, String newValue) {
  +        // do nothing
  +    }
  +
       /** Gets the constant value of this expression */
       public Object getValue() {
           return value;
  
  
  
  1.6       +9 -5      jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/Context.java
  
  Index: Context.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/Context.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Context.java	31 Jan 2002 19:20:27 -0000	1.5
  +++ Context.java	31 Jan 2002 19:56:02 -0000	1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/Context.java,v 1.5 2002/01/31 19:20:27 rdonkin Exp $
  - * $Revision: 1.5 $
  - * $Date: 2002/01/31 19:20:27 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/Context.java,v 1.6 2002/01/31 19:56:02 jstrachan Exp $
  + * $Revision: 1.6 $
  + * $Date: 2002/01/31 19:56:02 $
    *
    * ====================================================================
    *
  @@ -56,7 +56,7 @@
    * individuals on behalf of the Apache Software Foundation.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
  - * $Id: Context.java,v 1.5 2002/01/31 19:20:27 rdonkin Exp $
  + * $Id: Context.java,v 1.6 2002/01/31 19:56:02 jstrachan Exp $
    */
   package org.apache.commons.betwixt.expression;
   
  @@ -86,7 +86,7 @@
     * If the child is a parent then that operation fails. </p>
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.5 $
  +  * @version $Revision: 1.6 $
     */
   public class Context {
   
  @@ -98,6 +98,10 @@
       private Log log; 
       /** The parent context from this one descends */
       private Context parent;
  +    
  +    public Context() {
  +        this.log = LogSource.getInstance( getClass() );
  +    }
       
       /** Convenience constructor sets evaluted bean and log.
         *
  
  
  
  1.4       +10 -5     jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/EmptyExpression.java
  
  Index: EmptyExpression.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/EmptyExpression.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- EmptyExpression.java	30 Jan 2002 19:35:36 -0000	1.3
  +++ EmptyExpression.java	31 Jan 2002 19:56:02 -0000	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/EmptyExpression.java,v 1.3 2002/01/30 19:35:36 rdonkin Exp $
  - * $Revision: 1.3 $
  - * $Date: 2002/01/30 19:35:36 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/EmptyExpression.java,v 1.4 2002/01/31 19:56:02 jstrachan Exp $
  + * $Revision: 1.4 $
  + * $Date: 2002/01/31 19:56:02 $
    *
    * ====================================================================
    *
  @@ -57,7 +57,7 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    * 
  - * $Id: EmptyExpression.java,v 1.3 2002/01/30 19:35:36 rdonkin Exp $
  + * $Id: EmptyExpression.java,v 1.4 2002/01/31 19:56:02 jstrachan Exp $
    */
   package org.apache.commons.betwixt.expression;
   
  @@ -66,7 +66,7 @@
     * <p> See {@link #evaluate}. </p>
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.3 $
  +  * @version $Revision: 1.4 $
     */
   public class EmptyExpression implements Expression {
       
  @@ -89,4 +89,9 @@
       public Object evaluate(Context context) {
           return context.getBean();
       }
  +    
  +    public void update(Context context, String newValue) {
  +        // do nothing
  +    }
  +
   }
  
  
  
  1.3       +14 -5     jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/Expression.java
  
  Index: Expression.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/Expression.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Expression.java	30 Jan 2002 19:35:36 -0000	1.2
  +++ Expression.java	31 Jan 2002 19:56:03 -0000	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/Expression.java,v 1.2 2002/01/30 19:35:36 rdonkin Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/01/30 19:35:36 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/Expression.java,v 1.3 2002/01/31 19:56:03 jstrachan Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/01/31 19:56:03 $
    *
    * ====================================================================
    *
  @@ -57,16 +57,25 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    * 
  - * $Id: Expression.java,v 1.2 2002/01/30 19:35:36 rdonkin Exp $
  + * $Id: Expression.java,v 1.3 2002/01/31 19:56:03 jstrachan Exp $
    */
   package org.apache.commons.betwixt.expression;
   
   /** <p><code>Expression</code> represents an arbitrary expression on a bean.</p>
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.2 $
  +  * @version $Revision: 1.3 $
     */
   public interface Expression {
   
  +    /** Evaluates the expression on the bean with the given context
  +     * and returns the result 
  +     */
       public Object evaluate(Context context);    
  +    
  +    /** Updates the current bean context with a new String value.
  +     * This is typically used when parsing XML and updating a beans value
  +     * from XML 
  +     */
  +    public void update(Context context, String newValue);
   }
  
  
  
  1.5       +9 -5      jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/IteratorExpression.java
  
  Index: IteratorExpression.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/IteratorExpression.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- IteratorExpression.java	30 Jan 2002 19:35:36 -0000	1.4
  +++ IteratorExpression.java	31 Jan 2002 19:56:03 -0000	1.5
  @@ -1,7 +1,7 @@
    /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/IteratorExpression.java,v 1.4 2002/01/30 19:35:36 rdonkin Exp $
  - * $Revision: 1.4 $
  - * $Date: 2002/01/30 19:35:36 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/IteratorExpression.java,v 1.5 2002/01/31 19:56:03 jstrachan Exp $
  + * $Revision: 1.5 $
  + * $Date: 2002/01/31 19:56:03 $
    *
    * ====================================================================
    *
  @@ -57,7 +57,7 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    * 
  - * $Id: IteratorExpression.java,v 1.4 2002/01/30 19:35:36 rdonkin Exp $
  + * $Id: IteratorExpression.java,v 1.5 2002/01/31 19:56:03 jstrachan Exp $
    */
   
   package org.apache.commons.betwixt.expression;
  @@ -75,7 +75,7 @@
   /** <p><code>IteratorExpression</code> returns an iterator over the current context.</p>
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.4 $
  +  * @version $Revision: 1.5 $
     */
   public class IteratorExpression implements Expression {
       
  @@ -124,5 +124,9 @@
           // we've got something we can't deal with
           // so return an empty iterator
           return Collections.EMPTY_LIST.iterator();
  +    }
  +    
  +    public void update(Context context, String newValue) {
  +        // do nothing
       }
   }
  
  
  
  1.5       +11 -7     jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/MethodExpression.java
  
  Index: MethodExpression.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/MethodExpression.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MethodExpression.java	30 Jan 2002 19:35:36 -0000	1.4
  +++ MethodExpression.java	31 Jan 2002 19:56:03 -0000	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/MethodExpression.java,v 1.4 2002/01/30 19:35:36 rdonkin Exp $
  - * $Revision: 1.4 $
  - * $Date: 2002/01/30 19:35:36 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/MethodExpression.java,v 1.5 2002/01/31 19:56:03 jstrachan Exp $
  + * $Revision: 1.5 $
  + * $Date: 2002/01/31 19:56:03 $
    *
    * ====================================================================
    *
  @@ -57,7 +57,7 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    * 
  - * $Id: MethodExpression.java,v 1.4 2002/01/30 19:35:36 rdonkin Exp $
  + * $Id: MethodExpression.java,v 1.5 2002/01/31 19:56:03 jstrachan Exp $
    */
   package org.apache.commons.betwixt.expression;
   
  @@ -66,7 +66,7 @@
   /** <p><code>MethodExpression</code> evaluates a method on the current bean context.</p>
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.4 $
  +  * @version $Revision: 1.5 $
     */
   public class MethodExpression implements Expression {
   
  @@ -86,7 +86,7 @@
           this.method = method;
       }
   
  -    /** Evaluate by calling method on bean */
  +    /** Evaluate by calling the read method on the current bean */
       public Object evaluate(Context context) {
           Object bean = context.getBean();
           if ( bean != null ) {
  @@ -113,7 +113,11 @@
           }
           return null;
       }
  -    
  +
  +    public void update(Context context, String newValue) {
  +        // do nothing
  +    }
  +
       /** Gets the constant value of this expression */
       public Method getMethod() {
           return method;
  
  
  
  1.4       +10 -5     jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/StringExpression.java
  
  Index: StringExpression.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/StringExpression.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StringExpression.java	30 Jan 2002 19:35:36 -0000	1.3
  +++ StringExpression.java	31 Jan 2002 19:56:03 -0000	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/StringExpression.java,v 1.3 2002/01/30 19:35:36 rdonkin Exp $
  - * $Revision: 1.3 $
  - * $Date: 2002/01/30 19:35:36 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/StringExpression.java,v 1.4 2002/01/31 19:56:03 jstrachan Exp $
  + * $Revision: 1.4 $
  + * $Date: 2002/01/31 19:56:03 $
    *
    * ====================================================================
    *
  @@ -57,14 +57,14 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    * 
  - * $Id: StringExpression.java,v 1.3 2002/01/30 19:35:36 rdonkin Exp $
  + * $Id: StringExpression.java,v 1.4 2002/01/31 19:56:03 jstrachan Exp $
    */
   package org.apache.commons.betwixt.expression;
   
   /** <p><code>StringExpression</code> returns the current context object as a string.</p>
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.3 $
  +  * @version $Revision: 1.4 $
     */
   public class StringExpression implements Expression {
       
  @@ -92,4 +92,9 @@
           }
           return null;
       }
  +    
  +    public void update(Context context, String newValue) {
  +        // do nothing
  +    }
  +
   }
  
  
  
  1.4       +10 -5     jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/VariableExpression.java
  
  Index: VariableExpression.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/VariableExpression.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- VariableExpression.java	30 Jan 2002 19:35:36 -0000	1.3
  +++ VariableExpression.java	31 Jan 2002 19:56:03 -0000	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/VariableExpression.java,v 1.3 2002/01/30 19:35:36 rdonkin Exp $
  - * $Revision: 1.3 $
  - * $Date: 2002/01/30 19:35:36 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/VariableExpression.java,v 1.4 2002/01/31 19:56:03 jstrachan Exp $
  + * $Revision: 1.4 $
  + * $Date: 2002/01/31 19:56:03 $
    *
    * ====================================================================
    *
  @@ -57,7 +57,7 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    * 
  - * $Id: VariableExpression.java,v 1.3 2002/01/30 19:35:36 rdonkin Exp $
  + * $Id: VariableExpression.java,v 1.4 2002/01/31 19:56:03 jstrachan Exp $
    */
   package org.apache.commons.betwixt.expression;
   
  @@ -65,7 +65,7 @@
     * <code>$foo</code> which returns the value of the given variable.</p>
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.3 $
  +  * @version $Revision: 1.4 $
     */
   public class VariableExpression implements Expression {
   
  @@ -99,4 +99,9 @@
       public void setVariableName(String variableName) {
           this.variableName = variableName;
       }
  +    
  +    public void update(Context context, String newValue) {
  +        // do nothing
  +    }
  +
   }
  
  
  
  1.1                  jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/MethodUpdater.java
  
  Index: MethodUpdater.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   * 
   * $Id: MethodUpdater.java,v 1.1 2002/01/31 19:56:03 jstrachan Exp $
   */
  package org.apache.commons.betwixt.expression;
  
  import java.lang.reflect.Method;
  
  /** <p><code>MethodUpdater</code> updates the current bean context 
    * by calling a WriteMethod with the String value from the XML attribute 
    * or element.</p>
    *
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
    * @version $Revision: 1.1 $
    */
  public class MethodUpdater implements Updater {
  
      /** The method to call on the bean */
      private Method method;
      
      /** Base constructor */
      public MethodUpdater() {
      }
      
      /** Convenience constructor sets method property */
      public MethodUpdater(Method method) {
          this.method = method;
      }
  
      /** Updates the current bean context with the given String value */
      public void update(Context context, String newValue) {
          Object bean = context.getBean();
          if ( bean != null ) {
              // XXX: should use the primitive type converters from 
              // commons-beanutils either BeanUtils or PropertyUtils
              Object[] arguments = { newValue };
              try {
                  method.invoke( bean, arguments );
              }
              catch (Exception e) {
                  handleException(context, e);
              }
          }
      }
  
      /** Gets the constant value of this expression */
      public Method getMethod() {
          return method;
      }
      
      /** Sets the constant value of this expression */
      public void setMethod(Method method) {
          this.method = method;
      }
      
      // Implementation methods
      //-------------------------------------------------------------------------    
      
      /** 
        * <p> Log error to context's logger. </p> 
        *
        * <p> Allows derived objects to handle exceptions differently. </p>
        */
      protected void handleException(Context context, Exception e) {
          // use the context's logger to log the problem
          context.getLog().error("[MethodExpression] Cannot evaluate expression", e);
      }
  }
  
  
  
  1.1                  jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/expression/Updater.java
  
  Index: Updater.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   * 
   * $Id: Updater.java,v 1.1 2002/01/31 19:56:03 jstrachan Exp $
   */
  package org.apache.commons.betwixt.expression;
  
  /** <p><code>Updater</code> acts like an lvalue which updates the current 
    * context bean from some text from an XML attribute or element.</p>
    *
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
    * @version $Revision: 1.1 $
    */
  public interface Updater {
  
      /** Updates the current bean context with a new String value.
       * This is typically used when parsing XML and updating a beans value
       * from XML 
       */
      public void update(Context context, String newValue);
  }
  
  
  
  1.1                  jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/io/BeanCreateRule.java
  
  Index: BeanCreateRule.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   * 
   * $Id: BeanCreateRule.java,v 1.1 2002/01/31 19:56:03 jstrachan Exp $
   */
  package org.apache.commons.betwixt.io;
  
  import java.util.HashMap;
  import java.util.Iterator;
  import java.util.Map;
  
  import org.apache.commons.betwixt.AttributeDescriptor;
  import org.apache.commons.betwixt.ElementDescriptor;
  import org.apache.commons.betwixt.expression.Context;
  import org.apache.commons.betwixt.expression.Updater;
  
  import org.apache.commons.digester.Rule;
  import org.apache.commons.digester.Digester;
  
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogSource;
  
  import org.xml.sax.Attributes;
  
  /** <p><code>BeanCreateRule</code> is a Digester Rule for creating beans
    * from the betwixt XML metadata.</p>
    *
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
    * @version $Revision: 1.1 $
    */
  public class BeanCreateRule extends Rule {
  
      /** Logger */
      private static final Log log = LogSource.getInstance( BeanCreateRule.class.getName() );
      
      /** The descriptor of this element */
      private ElementDescriptor descriptor;
      /** The Context used when evaluating Updaters */
      private Context context = new Context();
      /** Have we added our child rules to the digester? */
      private boolean addedChildren;
      /** In this begin-end loop did we actually create a new bean */
      private boolean createdBean;
      
      public BeanCreateRule(Digester digester, ElementDescriptor descriptor) {
          super( digester );
          this.descriptor = descriptor;
      }
      
          
      // Rule interface
      //-------------------------------------------------------------------------    
      
      /**
       * Process the beginning of this element.
       *
       * @param attributes The attribute list of this element
       */
      public void begin(Attributes attributes) throws Exception {
          log.debug( "Called with descriptor: " + descriptor + " propertyType: " + descriptor.getPropertyType() );
          
          // XXX: if a single rule instance gets reused and nesting occurs
          // XXX: we should probably use a stack of booleans to test if we created a bean
          // XXX: or let digester take nulls, which would be easier for us ;-)
          createdBean = false;
          
          if ( descriptor.getPropertyType() != null ) {
              Object instance = createBean(attributes);
              if ( instance != null ) {
                  createdBean = true;
                  context.setBean( instance );
  
                  // iterate through all attributes        
                  AttributeDescriptor[] attributeDescriptors = descriptor.getAttributeDescriptors();
                  if ( attributeDescriptors != null ) {
                      for ( int i = 0, size = attributeDescriptors.length; i < size; i++ ) {
                          AttributeDescriptor attributeDescriptor = attributeDescriptors[i];
  
                          String value = attributes.getValue( 
                              attributeDescriptor.getURI(),
                              attributeDescriptor.getLocalName() 
                          );
  
                          Updater updater = attributeDescriptor.getUpdater();
                          if ( updater != null ) {
                              updater.update( context, value );
                          }
                      }
                  }
  
                  addChildRules();
  
                  digester.push(instance);
              }
          }
      }
  
  
      /**
       * Process the end of this element.
       */
      public void end() throws Exception {
          if ( createdBean ) {
              Object top = digester.pop();
          }
      }
  
  
      // Implementation methods
      //-------------------------------------------------------------------------    
      
      /** Factory method to create new bean instances */
      protected Object createBean(Attributes attributes) throws Exception {
          try {
              return descriptor.getPropertyType().newInstance();
          }
          catch (Exception e) {
              log.debug( "Could not create instance of type: " + descriptor.getPropertyType().getName(), e );
              return null;
          }
      }
          
      /** Adds the rules to the digester for all child elements */
      protected void addChildRules() {
          if ( ! addedChildren ) {
              addedChildren = true;
                          
              Digester digester = getDigester();            
              String prefix = descriptor.getQualifiedName() + "/";
              ElementDescriptor[] childDescriptors = descriptor.getElementDescriptors();
              if ( childDescriptors != null ) {
                  
                  for ( int i = 0, size = childDescriptors.length; i < size; i++ ) {
                      final ElementDescriptor childDescriptor = childDescriptors[i];
  
                      String path = prefix + childDescriptor.getQualifiedName();
                      if ( childDescriptor.isPrimitiveType() ) {
                          Rule rule = new Rule( digester ) {
                              public void body(String text) throws Exception {
                                  childDescriptor.getUpdater().update( context, text );
                              }        
                          };
  
                          digester.addRule( path, rule );
                      }
                      else {
                          digester.addRule( path, new BeanCreateRule( digester, childDescriptor ) );
                      }
                  }
              }
          }
      }
  }
  
  
  
  1.1                  jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/io/BeanReader.java
  
  Index: BeanReader.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   * 
   * $Id: BeanReader.java,v 1.1 2002/01/31 19:56:03 jstrachan Exp $
   */
  package org.apache.commons.betwixt.io;
  
  import java.beans.IntrospectionException;
  import java.util.Iterator;
  
  import javax.xml.parsers.SAXParser;
  
  import org.apache.commons.betwixt.AttributeDescriptor;
  import org.apache.commons.betwixt.ElementDescriptor;
  import org.apache.commons.betwixt.XMLBeanInfo;
  import org.apache.commons.betwixt.XMLIntrospector;
  import org.apache.commons.betwixt.expression.Context;
  import org.apache.commons.betwixt.expression.Expression;
  
  import org.apache.commons.digester.Digester;
  import org.apache.commons.digester.Rule;
  
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogSource;
  
  import org.xml.sax.XMLReader;
  
  /** <p><code>BeanReader</code> reads a tree of beans from an XML document.</p>
    *
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
    * @version $Revision: 1.1 $
    */
  public class BeanReader extends Digester {
  
      /** Introspector used */
      private XMLIntrospector introspector = new XMLIntrospector();    
      /** Log used for logging (Doh!) */
      private Log log = LogSource.getInstance( BeanReader.class.getName() );
      
      /**
       * Construct a new BeanReader with default properties.
       */
      public BeanReader() {
      }
  
      /**
       * Construct a new BeanReader, allowing a SAXParser to be passed in.  This
       * allows BeanReader to be used in environments which are unfriendly to
       * JAXP1.1 (such as WebLogic 6.0).  Thanks for the request to change go to
       * James House (james@interobjective.com).  This may help in places where
       * you are able to load JAXP 1.1 classes yourself.
       */
      public BeanReader(SAXParser parser) {
          super(parser);
      }
  
      /**
       * Construct a new BeanReader, allowing an XMLReader to be passed in.  This
       * allows BeanReader to be used in environments which are unfriendly to
       * JAXP1.1 (such as WebLogic 6.0).  Note that if you use this option you
       * have to configure namespace and validation support yourself, as these
       * properties only affect the SAXParser and emtpy constructor.
       */
      public BeanReader(XMLReader reader) {
          super(reader);
      }
  
      
      /** Registers a bean class for use by the writer */
      public void registerBeanClass(Class beanClass) throws IntrospectionException {
          // introspect and find the ElementDescriptor to use as the root
          XMLBeanInfo xmlInfo = introspector.introspect( beanClass );
          ElementDescriptor elementDescriptor = xmlInfo.getElementDescriptor();        
          
          String path = elementDescriptor.getQualifiedName();
          
          Rule rule = new BeanCreateRule( this, elementDescriptor );
          addRule( path, rule );
          
          log.info( "Added rule: " + rule + " to path: " + path );
      }
      
      // Properties
      //-------------------------------------------------------------------------        
  
      /**
       * <p> Get the introspector used. </p>
       *
       * <p> The {@link XMLBeanInfo} used to map each bean is created by the <code>XMLIntrospector</code>.
       * One way in which the mapping can be customized is by altering the <code>XMLIntrospector</code>. </p>
       */
      public XMLIntrospector getXMLIntrospector() {
          return introspector;
      }
      
  
      /**
       * <p> Set the introspector to be used. </p>
       *
       * <p> The {@link XMLBeanInfo} used to map each bean is created by the <code>XMLIntrospector</code>.
       * One way in which the mapping can be customized is by altering the <code>XMLIntrospector</code>. </p>
       *
       * @param introspector use this introspector
       */
      public void setXMLIntrospector(XMLIntrospector introspector) {
          this.introspector = introspector;
      }
  
      /**
       * <p> Get the current level for logging. </p>
       *
       * @return a <code>org.apache.commons.logging.Log</code> level constant
       */ 
      public Log getLog() {
          return log;
      }
  
      /**
       * <p> Set the current logging level. </p>
       *
       * @param level a <code>org.apache.commons.logging.Log</code> level constant
       */ 
      public void setLog(Log log) {
          this.log = log;
      }
          
      // Implementation methods
      //-------------------------------------------------------------------------    
      
  }
  
  
  
  1.5       +7 -6      jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/AbstractTestCase.java
  
  Index: AbstractTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/AbstractTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractTestCase.java	30 Jan 2002 19:35:37 -0000	1.4
  +++ AbstractTestCase.java	31 Jan 2002 19:56:03 -0000	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/AbstractTestCase.java,v 1.4 2002/01/30 19:35:37 rdonkin Exp $
  - * $Revision: 1.4 $
  - * $Date: 2002/01/30 19:35:37 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/AbstractTestCase.java,v 1.5 2002/01/31 19:56:03 jstrachan Exp $
  + * $Revision: 1.5 $
  + * $Date: 2002/01/31 19:56:03 $
    *
    * ====================================================================
    *
  @@ -57,7 +57,7 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    * 
  - * $Id: AbstractTestCase.java,v 1.4 2002/01/30 19:35:37 rdonkin Exp $
  + * $Id: AbstractTestCase.java,v 1.5 2002/01/31 19:56:03 jstrachan Exp $
    */
   package org.apache.commons.betwixt;
   
  @@ -65,7 +65,8 @@
   import java.util.HashMap;
   import java.util.Map;
   
  -import junit.framework.*;
  +import junit.framework.TestCase;
  +import junit.framework.TestSuite;
   
   import org.apache.commons.betwixt.io.BeanWriter;
   
  @@ -73,7 +74,7 @@
   /** Abstract base class for test cases.
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.4 $
  +  * @version $Revision: 1.5 $
     */
   public abstract class AbstractTestCase extends TestCase {
       
  
  
  
  1.3       +9 -6      jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/SampleBeanWriter.java
  
  Index: SampleBeanWriter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/SampleBeanWriter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SampleBeanWriter.java	30 Jan 2002 19:35:37 -0000	1.2
  +++ SampleBeanWriter.java	31 Jan 2002 19:56:03 -0000	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/SampleBeanWriter.java,v 1.2 2002/01/30 19:35:37 rdonkin Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/01/30 19:35:37 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/SampleBeanWriter.java,v 1.3 2002/01/31 19:56:03 jstrachan Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/01/31 19:56:03 $
    *
    * ====================================================================
    *
  @@ -57,13 +57,16 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    * 
  - * $Id: SampleBeanWriter.java,v 1.2 2002/01/30 19:35:37 rdonkin Exp $
  + * $Id: SampleBeanWriter.java,v 1.3 2002/01/31 19:56:03 jstrachan Exp $
    */
   package org.apache.commons.betwixt;
   
   import java.io.StringWriter;
   
  -import junit.framework.*;
  +import junit.framework.Test;
  +import junit.framework.TestCase;
  +import junit.framework.TestSuite;
  +import junit.textui.TestRunner;
   
   import org.apache.commons.betwixt.io.BeanWriter;
   
  @@ -71,7 +74,7 @@
   /** A sample program to output a bean as pretty printed XML
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.2 $
  +  * @version $Revision: 1.3 $
     */
   public class SampleBeanWriter extends AbstractTestCase {
       
  
  
  
  1.4       +17 -13    jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/TestAll.java
  
  Index: TestAll.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/TestAll.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestAll.java	30 Jan 2002 19:41:06 -0000	1.3
  +++ TestAll.java	31 Jan 2002 19:56:03 -0000	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/TestAll.java,v 1.3 2002/01/30 19:41:06 rdonkin Exp $
  - * $Revision: 1.3 $
  - * $Date: 2002/01/30 19:41:06 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/TestAll.java,v 1.4 2002/01/31 19:56:03 jstrachan Exp $
  + * $Revision: 1.4 $
  + * $Date: 2002/01/31 19:56:03 $
    *
    * ====================================================================
    *
  @@ -57,24 +57,28 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    * 
  - * $Id: TestAll.java,v 1.3 2002/01/30 19:41:06 rdonkin Exp $
  + * $Id: TestAll.java,v 1.4 2002/01/31 19:56:03 jstrachan Exp $
    */
   package org.apache.commons.betwixt;
   
  -import junit.framework.*;
  +import junit.framework.Test;
  +import junit.framework.TestCase;
  +import junit.framework.TestSuite;
  +import junit.textui.TestRunner;
   
   import org.apache.commons.betwixt.expression.TestEvaluation;
   
   /** Entry point for all JUnit tests.
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.3 $
  +  * @version $Revision: 1.4 $
    */
   public class TestAll extends TestCase {
  -    public TestAll(String testName) {
  -        super(testName);
  +    
  +    public static void main( String[] args ) {
  +        TestRunner.run( suite() );
       }
  -
  +    
       public static Test suite() {
           TestSuite suite = new TestSuite();
           suite.addTest(TestBeanWriter.suite());
  @@ -82,9 +86,9 @@
           suite.addTest(TestEvaluation.suite());
           return suite;
       }
  -
  -    public static void main(String args[]) {
  -        String[] testCaseName = { TestAll.class.getName() };
  -        junit.textui.TestRunner.main(testCaseName);
  +    
  +    public TestAll(String testName) {
  +        super(testName);
       }
  +
   }
  
  
  
  1.7       +14 -19    jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/TestBeanWriter.java
  
  Index: TestBeanWriter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/TestBeanWriter.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestBeanWriter.java	30 Jan 2002 19:35:37 -0000	1.6
  +++ TestBeanWriter.java	31 Jan 2002 19:56:03 -0000	1.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/TestBeanWriter.java,v 1.6 2002/01/30 19:35:37 rdonkin Exp $
  - * $Revision: 1.6 $
  - * $Date: 2002/01/30 19:35:37 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/TestBeanWriter.java,v 1.7 2002/01/31 19:56:03 jstrachan Exp $
  + * $Revision: 1.7 $
  + * $Date: 2002/01/31 19:56:03 $
    *
    * ====================================================================
    *
  @@ -57,13 +57,16 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    * 
  - * $Id: TestBeanWriter.java,v 1.6 2002/01/30 19:35:37 rdonkin Exp $
  + * $Id: TestBeanWriter.java,v 1.7 2002/01/31 19:56:03 jstrachan Exp $
    */
   package org.apache.commons.betwixt;
   
   import java.io.StringWriter;
   
  -import junit.framework.*;
  +import junit.framework.Test;
  +import junit.framework.TestCase;
  +import junit.framework.TestSuite;
  +import junit.textui.TestRunner;
   
   import org.apache.commons.betwixt.io.BeanWriter;
   
  @@ -75,10 +78,14 @@
   /** Test harness for the BeanWriter
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.6 $
  +  * @version $Revision: 1.7 $
     */
   public class TestBeanWriter extends AbstractTestCase {
       
  +    public static void main( String[] args ) {
  +        TestRunner.run( suite() );
  +    }
  +    
       public static Test suite() {
           return new TestSuite(TestBeanWriter.class);
       }
  @@ -88,29 +95,17 @@
       }
       
       public void testBeanWriter() throws Exception {
  -        StringWriter buffer = new StringWriter();
  -        BeanWriter writer = new BeanWriter( buffer );
  -        
           Object bean = createBean();
           
  -/*        
  -        writer.write( bean );
  -        
  -        String text = buffer.toString();
  -        
  -        System.out.println( "Found: " + text );
  -*/
  -        
           System.out.println( "Now trying pretty print" );
           
  -        writer = new BeanWriter();
  +        BeanWriter writer = new BeanWriter();
           writer.enablePrettyPrint();
           writer.write( bean );
       }
       
       
  -    public void testLooping() throws Exception
  -    {
  +    public void testLooping() throws Exception {
           //LogSource.setLogImplementation(SimpleLog.class);
           
           
  
  
  
  1.5       +12 -10    jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/TestXMLIntrospector.java
  
  Index: TestXMLIntrospector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/TestXMLIntrospector.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestXMLIntrospector.java	30 Jan 2002 19:35:37 -0000	1.4
  +++ TestXMLIntrospector.java	31 Jan 2002 19:56:03 -0000	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/TestXMLIntrospector.java,v 1.4 2002/01/30 19:35:37 rdonkin Exp $
  - * $Revision: 1.4 $
  - * $Date: 2002/01/30 19:35:37 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/TestXMLIntrospector.java,v 1.5 2002/01/31 19:56:03 jstrachan Exp $
  + * $Revision: 1.5 $
  + * $Date: 2002/01/31 19:56:03 $
    *
    * ====================================================================
    *
  @@ -57,31 +57,33 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    * 
  - * $Id: TestXMLIntrospector.java,v 1.4 2002/01/30 19:35:37 rdonkin Exp $
  + * $Id: TestXMLIntrospector.java,v 1.5 2002/01/31 19:56:03 jstrachan Exp $
    */
   package org.apache.commons.betwixt;
   
   import java.io.StringWriter;
   
  -import junit.framework.*;
  +import junit.framework.Test;
  +import junit.framework.TestCase;
  +import junit.framework.TestSuite;
   import junit.textui.TestRunner;
   
   
   /** Test harness for the XMLIntrospector
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.4 $
  +  * @version $Revision: 1.5 $
     */
   public class TestXMLIntrospector extends AbstractTestCase {
       
  -    public static Test suite() {
  -        return new TestSuite(TestXMLIntrospector.class);
  -    }
  -    
       public static void main( String[] args ) {
           TestRunner.run( suite() );
       }
       
  +    public static Test suite() {
  +        return new TestSuite(TestXMLIntrospector.class);
  +    }
  +        
       public TestXMLIntrospector(String testName) {
           super(testName);
       }
  
  
  
  1.1                  jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/RSSBeanWriter.java
  
  Index: RSSBeanWriter.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   * 
   * $Id: RSSBeanWriter.java,v 1.1 2002/01/31 19:56:03 jstrachan Exp $
   */
  package org.apache.commons.betwixt;
  
  import java.io.InputStream;
  
  import junit.framework.Test;
  import junit.framework.TestCase;
  import junit.framework.TestSuite;
  import junit.textui.TestRunner;
  
  import org.apache.commons.betwixt.io.BeanWriter;
  
  import org.apache.commons.digester.rss.RSSDigester;
  
  /** A sample program to output a bean as pretty printed XML
    *
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
    * @version $Revision: 1.1 $
    */
  public class RSSBeanWriter extends AbstractTestCase {
      
      public RSSBeanWriter(String testName) {
          super(testName);
      }
  
      public static void main(String[] args) throws Exception {
          RSSBeanWriter sample = new RSSBeanWriter("RSS");
          sample.run( args );
      }
      
      public void run(String[] args) throws Exception {
          RSSDigester digester = new RSSDigester();
          Object bean = null;
          if ( args.length > 0 ) {
              bean = digester.parse( args[0] );
          }
          else {
              InputStream in = getClass().getResourceAsStream( "rss-example.xml" );
              bean = digester.parse( in ); 
              in.close();
          }
          
          write( bean );
      }
          
      public void write(Object bean) throws Exception {
          BeanWriter writer = new BeanWriter();
          writer.getXMLIntrospector().setAttributesForPrimitives(false);
          writer.enablePrettyPrint();
          writer.write( bean );
      }
  }
  
  
  
  
  1.1                  jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/TestBeanReader.java
  
  Index: TestBeanReader.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   * 
   * $Id: TestBeanReader.java,v 1.1 2002/01/31 19:56:03 jstrachan Exp $
   */
  package org.apache.commons.betwixt;
  
  import java.io.InputStream;
  import java.io.IOException;
  
  import junit.framework.Test;
  import junit.framework.TestCase;
  import junit.framework.TestSuite;
  import junit.textui.TestRunner;
  
  import org.apache.commons.betwixt.io.BeanReader;
  import org.apache.commons.betwixt.io.BeanWriter;
  
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogSource;
  import org.apache.commons.logging.SimpleLog;
  
  
  /** Test harness for the BeanReader
    *
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
    * @version $Revision: 1.1 $
    */
  public class TestBeanReader extends TestCase {
      
      public static void main( String[] args ) {
          TestRunner.run( suite() );
      }
      
      public static Test suite() {
          return new TestSuite(TestBeanReader.class);
      }
      
      public TestBeanReader(String testName) {
          super(testName);
      }
      
      public void testBeanWriter() throws Exception {
          BeanReader reader = new BeanReader();
          reader.registerBeanClass( getBeanClass() );
  
          InputStream in = getXMLInput();
          try {
              Object bean = reader.parse( in );
  
              System.out.println( "Read bean: " + bean );
              System.out.println();
              System.out.println( "Lets turn it back into XML" );
              
              writeBean( bean );
          }
          finally {
              in.close();
          }
      }
      
      public void writeBean(Object bean) throws Exception {
          BeanWriter writer = new BeanWriter();
          writer.enablePrettyPrint();
          writer.write( bean );
      }
      
      /** @return the bean class to use as the root */
      public Class getBeanClass() {
          return CustomerBean.class;
      }
      
      protected InputStream getXMLInput() throws IOException {
          return getClass().getResourceAsStream( "customer.xml" );
      }
      
  }
  
  
  
  
  1.1                  jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/customer.xml
  
  Index: customer.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8" ?>
  <CustomerBean name="James" ID="1">
    <projectMap>
      <entry>
        <key>jaxen</key>
        <value>http://jaxen.org</value>
      </entry>
      <entry>
        <key>jakarta-taglibs</key>
        <value>http://jakarta.apache.org/taglibs/</value>
      </entry>
      <entry>
        <key>dom4j</key>
        <value>http://dom4j.org</value>
      </entry>
      <entry>
        <key>jakarta-commons</key>
        <value>http://jakarta.apache.org/commons/</value>
      </entry>
    </projectMap>
    <projectNames>
      <String>jaxen</String>
      <String>jakarta-taglibs</String>
      <String>dom4j</String>
      <String>jakarta-commons</String>
    </projectNames>
    <emails>
      <String>jstrachan@apache.org</String>
      <String>james_strachan@yahoo.co.uk</String>
    </emails>
    <projectURLs>
      <String>http://jaxen.org</String>
      <String>http://jakarta.apache.org/taglibs/</String>
      <String>http://dom4j.org</String>
      <String>http://jakarta.apache.org/commons/</String>
    </projectURLs>
    <address code="N5" city="London" country="UK" street="Near the park"/>
    <numbers>
      <Integer>3</Integer>
      <Integer>4</Integer>
      <Integer>5</Integer>
    </numbers>
  </CustomerBean>
  
  
  
  1.1                  jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/rss-example.xml
  
  Index: rss-example.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <!DOCTYPE rss PUBLIC
   "-//Netscape Communications//DTD RSS 0.91//EN"
   "http://my.netscape.com/publish/formats/rss-0.91.dtd">
  
  <rss version="0.91">
  
    <channel>
  
      <title>MozillaZine</title>
      <link>http://www.mozillazine.org</link>
      <description>Your source for Mozilla news, advocacy,
        interviews, builds, and more!</description>
      <language>en-US</language>
      <rating>(PICS-1.1 "http://www.rsac.org/ratingsv01.html"
        2 gen true comment "RSACi North America Server"
        for "http://www.rsac.org" on "1996.04.16T08:15-0500"
        r (n 0 s 0 v 0 l 0))</rating>
  
      <image>
        <title>MozillaZine</title>
        <url>http://www.mozillazine.org/image/mynetscape88.gif</url>
        <link>http://www.mozillazine.org</link>
        <width>88</width>
        <height>31</height>
        <description>Articles, discussions, builds, and more...</description>
      </image>
  
      <item>
        <title>Java2 in Navigator 5?</title>
        <link>http://www.mozillazine.org/talkback.html?article=607</link>
        <description>Will Java2 be an integrated part of Navigator 5?
        Read more about it in this discussion...</description>
      </item>
  
      <item>
        <title>Communicator 4.61 Out</title>
        <link>http://www.mozillazine.org/talkback.html?article=606</link>
        <description>The latest version of Communicator is now
        available.  It includes security enhancements
        and various bug fixes.</description>
      </item>
  
      <item>
        <title>Mozilla Dispenses with Old,
        Proprietary DOM</title>
        <link>http://www.mozillazine.org/talkback.html?article=604</link>
      </item>
  
      <item>
        <title>The Animation Contest is Now Closed</title>
        <link>http://www.mozillazine.org/talkback.html?article=603</link>
      </item>
  
      <textinput>
        <title>Send</title>
        <description>Comments about MozillaZine?</description>
        <name>responseText</name>
        <link>http://www.mozillazine.org/cgi-bin/sampleonly.cgi</link>
      </textinput>
  
    </channel>
  
  </rss>
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>