org.sadun.util
Class ObjectDescriptor

java.lang.Object
  extended byorg.sadun.util.ObjectDescriptor

public class ObjectDescriptor
extends java.lang.Object

This object exposes methods which use bean introspection to print out descriptions of objects using a resource bundle.

In general, for each attribute in the object, a corresponding label is searched for in the resource bundle, with a key name equal to the attribute name.

Author:
Cristiano Sadun

Method Summary
static java.lang.String describe(java.lang.Object obj)
          Produces a description of the object, using attribute names as labels.
static java.lang.String describe(java.lang.Object obj, java.util.ResourceBundle resources)
          Produces a description of the object, with labels found in the given bundle by using attribute names as keys.
static java.lang.String describe(java.lang.Object obj, java.util.ResourceBundle resources, java.lang.String prefix)
          Produces a description of the object, with labels found in the given bundle by using attribute names (with an optional prefix) as keys.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

describe

public static java.lang.String describe(java.lang.Object obj)
Produces a description of the object, using attribute names as labels.

Parameters:
obj - the object to describe.
Returns:
a description of the object.

describe

public static java.lang.String describe(java.lang.Object obj,
                                        java.util.ResourceBundle resources)
Produces a description of the object, with labels found in the given bundle by using attribute names as keys.

Parameters:
obj - the object to describe.
resources - the resource bundle where to look for labels
Returns:
a description of the object.

describe

public static java.lang.String describe(java.lang.Object obj,
                                        java.util.ResourceBundle resources,
                                        java.lang.String prefix)
Produces a description of the object, with labels found in the given bundle by using attribute names (with an optional prefix) as keys.

Parameters:
obj - the object to describe.
resources - the resource bundle where to look for labels
prefix - an optional prefix prepended to the resource name when looking in the bundle (may be null)
Returns:
a description of the object.