Uploaded image for project: 'Commons Digester'
  1. Commons Digester
  2. DIGESTER-80

[PATCH] Support for ObjectParamRule in Digester XML rules

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.5
    • None
    • None
    • Operating System: Windows XP
      Platform: All

    • 23644

    Description

      I've added support for the ObjectParamRule in XML rules file for the Digester.
      The syntax is as follows:

      <!--
      ObjectParamRule
      attrname - an arbitrary Object defined programatically, assigned if the
      element pattern AND specified attribute name are matched
      param - an arbitrary Object defined programatically, assigned when the
      element pattern associated with the Rule is matched
      type - class name for object
      value - initial value for the object
      -->
      <!ELEMENT object-param-rule EMPTY>
      <!ATTLIST object-param-rule
      pattern CDATA #IMPLIED
      paramnumber CDATA #REQUIRED
      param CDATA #REQUIRED
      attrname CDATA #IMPLIED
      type CDATA #REQUIRED
      value CDATA #IMPLIED>

      XML example:

      <object-param-rule paramnumber="0" type="java.lang.String"
      value="meter.serial"/>

      Generaly, type attribute can be any Java type. The value can be a string
      representation of any type that stnaddard ConvertUtils classes are capable to
      convert into the corresponding object instance. Attribute 'value' is optional,
      in this case an object will be created using default ctor.

      Tow files are patched:

      DigesterRuleParser.java
      digester-rules.dtd

      Regards,
      Anton

      Attachments

        Activity

          People

            Unassigned Unassigned
            maslovsky@mail.ru Anton Maslovsky
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: