diff --git a/projects/samskivert/docs/notes.txt b/projects/samskivert/docs/notes.txt index 88654a93..279764ec 100644 --- a/projects/samskivert/docs/notes.txt +++ b/projects/samskivert/docs/notes.txt @@ -1,6 +1,10 @@ samskivert notes -*- mode: outline -*- * To do: +Modify JORA such that if it doesn't find a matching public field in the +persistence object, it looks for getter/setter methods that will handle +the encoding/decoding of the composite fields during persistification. + Add support to the build system for enabling and disabling packages so that people can build just what they want and not have to track down support libraries for, say, WebMacro if they don't want the WebMacro diff --git a/projects/samskivert/src/java/com/samskivert/util/StringUtil.java b/projects/samskivert/src/java/com/samskivert/util/StringUtil.java index 39f39e94..ec16bb7b 100644 --- a/projects/samskivert/src/java/com/samskivert/util/StringUtil.java +++ b/projects/samskivert/src/java/com/samskivert/util/StringUtil.java @@ -1,5 +1,5 @@ // -// $Id: StringUtil.java,v 1.21 2002/02/02 00:03:14 mdb Exp $ +// $Id: StringUtil.java,v 1.22 2002/02/02 09:51:19 mdb Exp $ // // samskivert library - useful routines for java programs // Copyright (C) 2001 Michael Bayne @@ -298,6 +298,22 @@ public class StringUtil return buf.append("]").toString(); } + /** + * Attempts to generate a string representation of the object using + * object.toString(), but catches any exceptions that are + * thrown and reports them in the returned string instead. Useful for + * situations where you can't trust the rat bastards that implemented + * the object you're toString()ing. + */ + public static String safeToString (Object object) + { + try { + return object.toString(); + } catch (Exception e) { + return ""; + } + } + /** * Generates a string from the supplied bytes that is the HEX encoded * representation of those bytes.