commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ken Miller" <Ken.Mil...@huskyenergy.ca>
Subject betwixt: No updater for ...
Date Thu, 25 May 2006 21:29:00 GMT
I have an object that contains a Collection of some simple beans, as
well as a couple of attributes.  The XML generated by Betwixt looks like
this:
 
<FolderList nextFolderId="2" id="1">
    <folder folderId="0" folderName="One" id="2"/>
    <folder folderId="1" folderName="Two" id="3"/>
</FolderList>
 
The class def for FolderList looks like this:
 
public class FolderList {
 
   private Collection folderList = null;
   private int nextFolderId = 0;
 
   public FolderList();
   public void addFolder(Folder folder);
   public Collection getFolderList();
   public int getNextFolderId();
   public void setNextFolderId(int i);
}
 
Likewise, Folder looks like this:
 
public class Folder {
 
   String folderName;
   int folderId;

   public int getFolderId();
   public String getFolderName();
   public void setFolderId(int i);
   public void setFolderName(String string);
}

However, when I try to read the XML back in using a BeanReader, I get
this message in the trace file:
 
[TRACE] MyLog - Created bean 0:One
[DEBUG] MyLog -   match='FolderList/folder'
[DEBUG] MyLog -   bodyText=''
[DEBUG] MyLog -   Fire body() for
org.apache.commons.betwixt.io.BeanRuleSet$ActionMappingRule@3cc262
[DEBUG] MyLog -   Fire body() for
org.apache.commons.betwixt.io.BeanRuleSet$ActionMappingRule@fdb00d
[DEBUG] MyLog -   Popping body text '
    '
[DEBUG] MyLog -   Fire end() for
org.apache.commons.betwixt.io.BeanRuleSet$ActionMappingRule@fdb00d
[TRACE] MyLog - No updater for folder    
[DEBUG] MyLog - Cannot pop options off empty stack
[DEBUG] MyLog - Cannot pop options off empty stack
 
The Folder object is instantiated, and the attrributes for it are set
to the correct value, but FolderList.addFolder() is never invoked to
insert the Folder object back into it's parent.  The end result is that
the FolderList object is returned with no Folders.  Not good.
 
Am I missing a mapping rule somewhere?
 
I'm using the current dev build of Betwixt (as of yesterday).
 
 
Cheers!
 
      -klm.
 
-----------------------------------------------------------------------------
Kenneth (Ken) L. Miller
Technical Specialist, Enterprise Web Portals
    Cell: 403.680.3785
Office: 403.750.1790


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