I have an XML file that contains this sort of element:

        <FtpUrl>ftp://user:[EMAIL PROTECTED]:21/some/path</FtpUrl>

I also have a Config object that has a java.net.URL property with a 
getter/setter:

        public class MyConfig {
                // ...
                public URL getFtpUrl();
                public void setFtpUrl(URL url);
                // ...
        }

However, I can't decide how to tie these together with Digester.  I 
couldn't get a bean property setter to work, I suspect because there is no 
conversion between the String in the XML file and a java.net.URL.  Second, 
I thought I'd use an ObjectCreationFactory with a FactoryCreateRule to use 
the body text to construct a new URL and return it, then add a SetNextRule 
to set that URL into the config object.  But I can't seem to get at the 
body text via a ObjectCreationFactory (I get the attribtues passed to the 
factory,but not the body from what I could tell).

So, my next step is to create my own Rule and add it to the Digester.  But 
that seems a bit extreme.  Is there a less custom way of doing this?

Regards,
Brian.

Reply via email to