Commons Digester
  1. Commons Digester
  2. DIGESTER-61

Missing DTD definition for BeanPropertySetterRule

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      In the class "DigesterRuleParser" and the corresponding "digester-rules.dtd",
      there is no support for defining a BeanPropertySetterRule in a digester-
      rules.xml file.

      I have added the appropriate support and I am including the diffs here:

      Index: DigesterRuleParser.java
      ===================================================================
      RCS file: /home/cvspublic/jakarta-
      commons/digester/src/java/org/apache/commons/digester/xmlrules/DigesterRulePars
      er.java,v
      retrieving revision 1.10
      diff -r1.10 DigesterRuleParser.java
      225a226,229
      > 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);
      >
      490a495,514
      > /**
      > * 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;
      > }
      >
      > }
      >

      Index: digester-rules.dtd
      ===================================================================
      RCS file: /home/cvspublic/jakarta-
      commons/digester/src/java/org/apache/commons/digester/xmlrules/digester-
      rules.dtd,v
      retrieving revision 1.5
      diff -r1.5 digester-rules.dtd
      13c13
      < <!ENTITY % rule-elements "call-method-rule | call-param-rule |

      > <!ENTITY % rule-elements "bean-property-setter-rule | call-method-rule |
      call-param-rule |
      19c19
      < <!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 )*>
      37,38c37,38
      < <!ELEMENT pattern (pattern
      include call-method-rule call-param-rule

      < factory-create-rule | object-create-rule |

      > <!ELEMENT pattern (pattern | include | bean-property-setter-rule | call-
      method-rule |
      > call-param-rule | factory-create-rule | object-create-
      rule |
      69a70,74
      > <!ELEMENT bean-property-setter-rule EMPTY>
      > <!ATTLIST bean-property-setter-rule
      > pattern CDATA #IMPLIED
      > propertyname CDATA #IMPLIED>
      >

        Activity

        Hide
        rdonkin@apache.org added a comment -

        after 1.4.1 release

        Show
        rdonkin@apache.org added a comment - after 1.4.1 release
        Hide
        rdonkin@apache.org added a comment -

        digester 1.4.1 released

        Show
        rdonkin@apache.org added a comment - digester 1.4.1 released
        Hide
        Tim O'Brien added a comment -

        Patch has been applied, and appropriate tests have been added to src/tests

        Show
        Tim O'Brien added a comment - Patch has been applied, and appropriate tests have been added to src/tests

          People

          • Assignee:
            Unassigned
            Reporter:
            Bradley M. Handy
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development