commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <robertburrelldon...@blueyonder.co.uk>
Subject Re: cvs commit: jakarta-commons/digester/xdocs index.xml
Date Mon, 10 Mar 2003 22:27:15 GMT
hi tim

i'm glad to see you've committed the patch.

i do have one small request. to produce the release notes, the release 
manager has to go through the logs of all the commits made since the last 
release. so, the digester house commit style is longer, more descriptive 
log messages. if the commit fixes a bug, the bug number should also be 
recorded.

- robert

On Monday, March 10, 2003, at 09:10 PM, tobrien@apache.org wrote:

> tobrien     2003/03/10 13:10:11
>
>   Modified:    digester project.xml
>                digester/src/java/org/apache/commons/digester/xmlrules
>                         DigesterRuleParser.java digester-rules.dtd
>                digester/src/test/org/apache/commons/digester/xmlrules
>                         DigesterLoaderTest.java TestObject.java test.xml
>                         testrules.xml
>                digester/xdocs index.xml
>   Log:
>   Added patch with tests for bean-property-setter-rule
>
>   Revision  Changes    Path
>   1.10      +7 -0      jakarta-commons/digester/project.xml
>
>   Index: project.xml
>   ===================================================================
>   RCS file: /home/cvs/jakarta-commons/digester/project.xml,v
>   retrieving revision 1.9
>   retrieving revision 1.10
>   diff -u -r1.9 -r1.10
>   --- project.xml	28 Feb 2003 08:22:51 -0000	1.9
>   +++ project.xml	10 Mar 2003 21:10:11 -0000	1.10
>   @@ -50,6 +50,13 @@
>          <email>tobrien@apache.org</email>
>        </developer>
>      </developers>
>   +
>   +  <contributors>
>   +    <contributor>
>   +      <name>Bradley M. Handy</name>
>   +      <email>bhandy@users.sf.net</email>
>   +    </contributor>
>   +  </contributors>
>
>      <dependencies>
>        <dependency>
>
>
>
>   1.11      +25 -0     jakarta-
> commons/digester/src/java/org/apache/commons/digester/xmlrules/DigesterRuleParser.
> java
>
>   Index: DigesterRuleParser.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-
> commons/digester/src/java/org/apache/commons/digester/xmlrules/DigesterRuleParser.
> java,v
>   retrieving revision 1.10
>   retrieving revision 1.11
>   diff -u -r1.10 -r1.11
>   --- DigesterRuleParser.java	2 Feb 2003 15:53:56 -0000	1.10
>   +++ DigesterRuleParser.java	10 Mar 2003 21:10:11 -0000	1.11
>   @@ -81,6 +81,7 @@
>     *
>     * @author David H. Martin - Initial Contribution
>     * @author Scott Sanders   - Added ASL, removed external dependencies
>   + * @author Bradley M. Handy - Bean Property Setter Rule addition
>     */
>
>    public class DigesterRuleParser extends RuleSetBase {
>   @@ -223,6 +224,10 @@
>
>            digester.addRule("*/include", new IncludeRule());
>
>   +        digester.addFactoryCreate("*/bean-property-setter-rule", new 
> BeanPropertySetterRuleFactory());
>   +        digester.addRule("*/bean-property-setter-rule", new 
> PatternRule("pattern"));
>   +        digester.addSetNext("*/bean-property-setter-rule", "add", 
> ruleClassName);
>   +
>            digester.addFactoryCreate("*/call-method-rule", new 
> CallMethodRuleFactory());
>            digester.addRule("*/call-method-rule", new 
> PatternRule("pattern"));
>            digester.addSetNext("*/call-method-rule", "add", ruleClassName)
> ;
>   @@ -488,6 +493,26 @@
>        // used to create Rule objects and initialize them from SAX 
> attributes.
>        //////////////////////////////////////////////////////////////////
> /////
>
>   +    /**
>   +     * Factory for creating a BeanPropertySetterRule.
>   +     */
>   +    private class BeanPropertySetterRuleFactory extends 
> AbstractObjectCreationFactory {
>   +        public Object createObject(Attributes attributes) throws 
> Exception {
>   +            Rule beanPropertySetterRule = null;
>   +            String propertyname = attributes.getValue("propertyname");
>   +
>   +            if (propertyname == null) {
>   +                // call the setter method corresponding to the element 
> name.
>   +                beanPropertySetterRule = new BeanPropertySetterRule();
>   +            } else {
>   +                beanPropertySetterRule = new 
> BeanPropertySetterRule(propertyname);
>   +            }
>   +
>   +            return beanPropertySetterRule;
>   +        }
>   +
>   +    }
>   +
>        /**
>         * Factory for creating a CallMethodRule.
>         */
>
>
>
>   1.6       +10 -4     jakarta-
> commons/digester/src/java/org/apache/commons/digester/xmlrules/digester-rules.
> dtd
>
>   Index: digester-rules.dtd
>   ===================================================================
>   RCS file: /home/cvs/jakarta-
> commons/digester/src/java/org/apache/commons/digester/xmlrules/digester-rules.
> dtd,v
>   retrieving revision 1.5
>   retrieving revision 1.6
>   diff -u -r1.5 -r1.6
>   --- digester-rules.dtd	23 Aug 2002 13:42:56 -0000	1.5
>   +++ digester-rules.dtd	10 Mar 2003 21:10:11 -0000	1.6
>   @@ -10,13 +10,13 @@
>         Digester is a framework for pattern-matching-based parsing of XML 
> into
>         Java objects. See http://jakarta.apache.org/commons/digester.html.
>   -->
>
>   -<!ENTITY % rule-elements "call-method-rule | call-param-rule |
>   +<!ENTITY % rule-elements "bean-property-setter-rule | call-method-rule 
> | call-param-rule |
>                       factory-create-rule | object-create-rule |
>                       set-properties-rule | set-property-rule | 
> set-top-rule |
>                       set-next-rule" >
>
>    <!-- digester-rules is the root element. -->
>   -<!ELEMENT digester-rules (pattern | include | call-method-rule | 
> call-param-rule | factory-create-rule | object-create-rule | 
> set-properties-rule | set-property-rule | set-top-rule | set-next-rule )*
> >
>   +<!ELEMENT digester-rules (pattern | include | 
> bean-property-setter-rule | call-method-rule | call-param-rule | 
> factory-create-rule | object-create-rule | set-properties-rule | 
> set-property-rule | set-top-rule | set-next-rule )*>
>
>
>    <!-- <pattern> defines a matching pattern, or part of a matching 
> pattern. Any
>   @@ -34,7 +34,7 @@
>
>      Note that the use of pattern elements is optional; an alternative is 
> for
>      each rule element to contain a 'pattern' attribute.   -->
>   -<!ELEMENT pattern (pattern | include | call-method-rule | 
> call-param-rule |
>   +<!ELEMENT pattern (pattern | include | bean-property-setter-rule | 
> call-method-rule | call-param-rule |
>                       factory-create-rule | object-create-rule |
>                       set-properties-rule | set-property-rule | 
> set-top-rule |
>                       set-next-rule )*>
>   @@ -65,6 +65,12 @@
>         is nested inside one or more <pattern> elements, those patterns
>         will be prepended to the pattern specified in the rule's 'pattern'
>         attribute. -->
>   +
>   +<!-- Bean Property Setter Rule -->
>   +<!ELEMENT bean-property-setter-rule EMPTY>
>   +<!ATTLIST bean-property-setter-rule
>   +    pattern      CDATA #IMPLIED
>   +    propertyname CDATA #IMPLIED>
>
>    <!-- CallMethodRule -->
>    <!ELEMENT call-method-rule EMPTY>
>
>
>
>   1.10      +2 -1      jakarta-
> commons/digester/src/test/org/apache/commons/digester/xmlrules/DigesterLoaderTest.
> java
>
>   Index: DigesterLoaderTest.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-
> commons/digester/src/test/org/apache/commons/digester/xmlrules/DigesterLoaderTest.
> java,v
>   retrieving revision 1.9
>   retrieving revision 1.10
>   diff -u -r1.9 -r1.10
>   --- DigesterLoaderTest.java	2 Feb 2003 15:52:14 -0000	1.9
>   +++ DigesterLoaderTest.java	10 Mar 2003 21:10:11 -0000	1.10
>   @@ -89,7 +89,7 @@
>        }
>
>        public static junit.framework.Test suite() {
>   -        TestSuite suite = new TestSuite(DigesterLoaderTestSuite.class)
> ;
>   +        TestSuite suite = new TestSuite(DigesterLoaderTest.class);
>
>            return suite;
>        }
>   @@ -155,6 +155,7 @@
>            assertEquals("Wrong number of classes created", 2 , list.size(
> ));
>            assertEquals("Pushed first", true , 
> ((TestObject)list.get(0)).isPushed());
>            assertEquals("Didn't push second", false , 
> ((TestObject)list.get(1)).isPushed());
>   +        assertTrue("Property was set properly", ((TestObject)list.get(
> 0)).getProperty().equals("I am a property!") );
>        }
>
>
>
>
>
>   1.8       +11 -0     jakarta-
> commons/digester/src/test/org/apache/commons/digester/xmlrules/TestObject.
> java
>
>   Index: TestObject.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-
> commons/digester/src/test/org/apache/commons/digester/xmlrules/TestObject.
> java,v
>   retrieving revision 1.7
>   retrieving revision 1.8
>   diff -u -r1.7 -r1.8
>   --- TestObject.java	2 Feb 2003 15:49:54 -0000	1.7
>   +++ TestObject.java	10 Mar 2003 21:10:11 -0000	1.8
>   @@ -68,6 +68,7 @@
>     *
>     * @author David H. Martin - Initial Contribution
>     * @author Scott Sanders   - Added ASL, removed external dependencies
>   + * @author Tim O'Brien - Added bean property to test bean property 
> setter rule
>     */
>    public class TestObject {
>
>   @@ -75,6 +76,8 @@
>        private String value = "";
>        private Long longValue = new Long(-1L);
>
>   +    private String property = "";
>   +
>        private HashMap mapValue = new HashMap();
>
>        private boolean pushed = false;
>   @@ -125,5 +128,13 @@
>
>        public String getMapValue( String name ) {
>            return (String) this.mapValue.get( name );
>   +    }
>   +
>   +    public String getProperty() {
>   +        return property;
>   +    }
>   +
>   +    public void setProperty(String pProperty) {
>   +        property = pProperty;
>        }
>    }
>
>
>
>   1.5       +2 -0      jakarta-
> commons/digester/src/test/org/apache/commons/digester/xmlrules/test.xml
>
>   Index: test.xml
>   ===================================================================
>   RCS file: /home/cvs/jakarta-
> commons/digester/src/test/org/apache/commons/digester/xmlrules/test.xml,v
>   retrieving revision 1.4
>   retrieving revision 1.5
>   diff -u -r1.4 -r1.5
>   --- test.xml	23 Aug 2002 13:42:57 -0000	1.4
>   +++ test.xml	10 Mar 2003 21:10:11 -0000	1.5
>   @@ -12,6 +12,7 @@
>          <mapValue name="test1">foo</mapValue>
>          <mapValue name="test2">bar</mapValue>
>        </call-method-rule-tests>
>   +    <property>I am a property!</property>
>      </foo>
>      <baz value="baz2"/>
>      <foo value="foo3">
>   @@ -19,5 +20,6 @@
>    	  <baz value="baz3"/>
>          <foo value="foo4"/>
>        </bar>
>   +    <property>I am a property!</property>
>      </foo>
>    </root>
>
>
>
>   1.5       +1 -0      jakarta-
> commons/digester/src/test/org/apache/commons/digester/xmlrules/testrules.
> xml
>
>   Index: testrules.xml
>   ===================================================================
>   RCS file: /home/cvs/jakarta-
> commons/digester/src/test/org/apache/commons/digester/xmlrules/testrules.
> xml,v
>   retrieving revision 1.4
>   retrieving revision 1.5
>   diff -u -r1.4 -r1.5
>   --- testrules.xml	23 Aug 2002 13:42:57 -0000	1.4
>   +++ testrules.xml	10 Mar 2003 21:10:11 -0000	1.5
>   @@ -15,5 +15,6 @@
>    		    	<call-param-rule pattern="mapValue" attrname="name" 
> paramnumber="0" />
>    		    	<call-param-rule pattern="mapValue" paramnumber="1"/>
>    		</pattern>
>   +                <bean-property-setter-rule pattern="property" 
> name="property"/>
>    	</pattern>
>    </digester-rules>
>
>
>
>   1.3       +4 -1      jakarta-commons/digester/xdocs/index.xml
>
>   Index: index.xml
>   ===================================================================
>   RCS file: /home/cvs/jakarta-commons/digester/xdocs/index.xml,v
>   retrieving revision 1.2
>   retrieving revision 1.3
>   diff -u -r1.2 -r1.3
>   --- index.xml	26 Feb 2003 20:39:32 -0000	1.2
>   +++ index.xml	10 Mar 2003 21:10:11 -0000	1.3
>   @@ -52,10 +52,13 @@
>
>    <section name="Releases">
>     <ul>
>   +  <li>Version 1.4.1 (from mirror)
>   +   <a href="http://jakarta.apache.org/site/binindex.cgi">binary</a>
>   +   <a href="http://jakarta.apache.org/site/sourceindex.cgi">source</a>
>  (latest)</li>
>      <li>Version 1.4 (from mirror)
>        <a href="http://jakarta.apache.org/site/binindex.cgi">binary</a>
>        <a href="http://jakarta.apache.org/site/sourceindex.cgi">source</a>
>   -    (latest)</li>
>   +  </li>
>      <li><a href="http://jakarta.apache.org/builds/jakarta-
> commons/release/commons-digester/v1.3/">Version 1.3</a></li>
>      <li><a href="http://jakarta.apache.org/builds/jakarta-
> commons/release/commons-digester/v1.2/">Version 1.2</a></li>
>      <li><a href="http://jakarta.apache.org/builds/jakarta-
> commons/release/commons-digester/v1.1.1/">Version 1.1.1</a></li>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message