commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Maslovsky" <anton_maslov...@hotmail.com>
Subject [Digester][PATCH] ObjectParamRule support for XML rules
Date Tue, 07 Oct 2003 07:47:11 GMT
Hi,

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.

Tow files are patched:

DigesterRuleParser.java
digester-rules.dtd

Regards,
Anton

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* 
http://join.msn.com/?page=features/junkmail

Mime
View raw message