Re: XML coding questions

From: Kevin J. Menard, Jr. (nirvdru..egativetwenty.net)
Date: Fri Dec 03 2004 - 21:35:17 EST

  • Next message: Tore Halset: "caching of flattened objects"

    Ok, I have another one. I'll just keep everything in this thread.
    This one should be easy, but for the life of me, I can't figure it out.

    The XMLDecoder docs say that an XML file can be decoded to an object if
    its class has a single arg constructor that takes an XMLDecoder as its
    only argument. So, is decodeRootObject() used with the output just
    tossed away? So the execution flow would be something like:

    final XMLDecoder decoder = XMLDecoder.decoder();
    decoder.decodeRootObject("output.xml");
    final Test t = new Test(decoder);

    I guess the issue is letting the decoder know what it should actually
    be decoding. This seems like what should be done to me, but I just
    want to verify before I really commit to it ;-)

    Additionally, how did WebObjects differentiate between classes with the
    1 constructor arg and those that could be decoded innately? I could
    use reflection to detect the former case, and I'm simulating the latter
    with java.beans.XML{En|De}coder, but that would seem to me that I would
    have to modify the decoder API to have some method that takes in a
    java.lang.Class. Otherwise, I can't really tell how WebObjects
    differentiated between the two cases.

    -- 
    Thanks,
    Kevin
    



    This archive was generated by hypermail 2.0.0 : Fri Dec 03 2004 - 21:35:52 EST