commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Campbell" <mattcampbell...@gmail.com>
Subject [Commons-Digester] Mapping an ArrayList
Date Thu, 02 Nov 2006 14:56:09 GMT
I have the following simple xml file.

<security>
     <security-sections>
          <section>
               <name>issueDetail</name>
               <role>manager</role>
               <role>user</role>
          </section>
          <section>
               <name>person</name>
               <role>user</role>
           </section>
     </security-sections>
</security>





The Digester rules


<?xml version="1.0" encoding="UTF-8"?>

<digester-rules>
    <pattern value="security/security-sections">
        <object-create-rule classname="java.util.ArrayList"/>
        <set-properties-rule/>

        <pattern value="section">
            <object-create-rule classname="
mil.stes.model.security.SecuritySection"/>

            <bean-property-setter-rule pattern="name"/>

            <!-- NEED TO MAP ROLES ARRAYLIST HERE -->

            <set-next-rule methodname="add" paramtype="java.lang.Object"/>
        </pattern>

    </pattern>
</digester-rules>



I've tried multiple times to map the role elements to an arraylist but it
never works. There is no documentation on how to map this on the website so
im asking here.

How would I map the role elements to an arraylist named roles?

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