commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sky Chen <sky.freepriso...@gmail.com>
Subject Fwd: [digester] declare plugin in xml rule file
Date Sun, 01 Mar 2015 11:54:57 GMT
There is nothing like Plugin-create-rule in digester-rules.dtd. The doc
says a class used as a plugin may dynamically add its own rules to the
digester by providing an xmlrules file which defines the associated parsing
rules. But there is no example showing how to define "associated parsing
rules".

Suppose I want to create an instance of plugin "SteelBar" which implements
"Bar" interface with this config.xml:

<foo>
   <plugin id="SteelBar" class="SteelBar" />

   <bar plugin-id="SteelBar" name="spam"/>
</foo>


I would like to write my rule.xml as:

<digester-rules>
    <pattern value="foo">
         <object-create-rule classname="Foo"/>
         <set-properties-rule/>

        <pattern value="bar">
            <plugin-create-rule classname="Bar"
include="SteelBar_rule.xml"/>
            <set-next-rule methodname="addBar"/>
        </pattern>
    </pattern>
</digester-rules>

Without "plugin-create-rule" in dtd, how could I archive this?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message