|
From: toby c. <to...@ca...> - 2007-10-07 15:39:37
|
> One solution would be to use the already existing > DOMAdapter.stringify(...) mechanism to specify that java.sql.Date > objects should be serialized as their string representations. yup, but I'd prefer to have the date represented in a standard format. Doesn't toString() vary by locale, etc? > I definitely see merit in both ideas. I'm wondering if a more general > "custom handler" mechanism would have more value than a couple of date > hacks. Similar to the "stringify" mechanism, you could specify a custom > handler for a specific class (strinigify would become a special case of > a custom handler), that returned the element representing the class, and > could represent it however you wanted. Perhaps this solves the more > generalized case of both problems? That's a good idea. I've used another tool that's similar to Domify called Skaringa that allows you to plug in custom handlers and that feature has come in handy. Looks like Domify stores the list of "stringified" classes in the DOMAdapter class and dips into it from the ElementAdapter.getNodeListAdapter(). We could add a DOMAdapter.findAdapter() method that returns a NodeList or null. getNodeListAdapter() could look to see if there's a specific adapter or else fall back to the existing logic. We could probably write a new DOMAdapter.stringify() method that used the new mechanism, to keep back-compatibility. Is this along the lines of what you were thinking? Thanks, Toby |