On Tue, 2007-01-02 at 15:58 -0800, Turadg Aleahmad wrote:
When is the url property of WobbleModule set? There's a FIXME comment
at the class declaration block:
// FIXME inheriting from BrowseWeb right now but should be refactored since
// WobbleModule doesn't have a simple URL property

XmlEncoder compares the default property value with the current value
while writing out.  If they are the same (i.e. no change has been made
from the default) then it doesn't write out the value as it's
redundant.

Could that explain what you're seeing?

I looked for that at the time and that didn't seem to explain it.  I
using the debugger to to check the value of the url property and it was
set correctly before the object was passed to XmlEncoder.
I now remember something I emailed about before that probably explains
it.  When XmlEncoder compares two object properties to see if it needs
to write out the property, by default it doesn't use the equals method
to see if they are the same.  By default it just checks if the classes
are the same.  The easy way around this is to make sure the default
value of the property "null".  The better way around this is to install
handler that uses the equals method for URLs, instead of using the
default Object handler.
Scott


-t


On 12/20/06, Scott Cytacki <[EMAIL PROTECTED]> wrote:
>
> I just ran into another case where xmlencoder isn't saving certain
> properties from a Pod bean.  It is usually something to do with the bean
> info, or mismatched getter and setters.
> This is something to keep in mind if you are making new beans to go in
> Pods, or you are modifying existing beans.
>
> You should check if the state of your bean is being saved into the Pod
> the way you think it should be.  The easiest way I know to do this is to
> create a curnit that uses a Pod that users your bean.  Then unzip it and
> search the xml files for your bean's classname.  Then look at the xml in
> those files and see if it has all the correct properties and values.
>
> Details for this particular case:
>
> The url property of the WobbleModule isn't being saved.  I worked around
> this without fixing it.
>
> This property is defined in a super super class of WobbleModule:
> AbstractUrlStep.  In between is a class called BrowseWeb, other
> subclasses of BrowseWeb correctly save the url property.  For example
> DisplayPage saves this property correctly.  However DisplayPage has a
> bean info and WobbleModule does not.  So probably this could be fixed by
> giving WobbleModule a BeanInfo, but it would be nice to know why it
> doesn't work without a BeanInfo.  Other properties of WobbleModule are
> saved correctly.  And some of these properties are defined in its super
> super super class PasStep.
>
> I would guess that we are doing something wrong in the BeanInfos of
> either BrowseWeb or AbstractUrlStep which is making this not work.
>
> Scott
>
>
> >
>

>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SAIL-Dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/SAIL-Dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to