commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nation, Carey" <Carey.Nat...@turner.com>
Subject Property not being set [Digester]
Date Thu, 09 Sep 2004 17:07:36 GMT
Hi,
I have some xml that uses attributes.  One of the properties that maps to an attribute is
stored internally as a class of mine.  The setter
accepts a String and instantiates one of my objects passing the string to the ctor and stores
the ref to that object in my bean.  Something like this:

class Foo
{
    public Foo( String s)...
}

class Bean
{
   private Foo f;

   public void setFoo( String s)
   {
      f = new Foo( s);
   }
}

<bean foo="12345" />

When I get the object back, f is null.  Bean is actually nested inside another object, if
that matters.

I know that setFoo is being called because I put a trace message in there.  I know further
than the "final" object that I'm getting back from digester is not the instance that is calling
setFoo, because I printed out the toString with the instance info on there.

There are other fields in Bean that are base Java types (int, String), that are making it
to the final instance of the object.

I thought maybe they were calling clone, but it doesn't appear that that is happening.  So
what is happening?  What do I have to do to get my fields copied (or whatever magic is happening)?

Thanks,
Carey Nation


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message