org.dishevelled.identify
Class IdentifyUtils

java.lang.Object
  extended by org.dishevelled.identify.IdentifyUtils

public final class IdentifyUtils
extends Object

Provides static utility methods for determining the name property value and icon bundle for a bean.

Version:
$Revision: 741 $ $Date: 2010-01-02 20:23:15 -0600 (Sat, 02 Jan 2010) $
Author:
Michael Heuer

Nested Class Summary
(package private) static interface IdentifyUtils.IconBundleStrategy
          Strategy used to find an icon bundle for a bean.
(package private) static interface IdentifyUtils.NameStrategy
          Strategy used to determine the value for a name property on a bean.
 
Method Summary
 IconBundle getDefaultIconBundle()
          Return the icon bundle to use as a default icon bundle, in the case the icon bundle strategy is unable to find an icon bundle for a bean.
static IconBundle getIconBundleFor(Object bean)
          Return an icon bundle for the specified bean using the set icon bundle strategy.
 IdentifyUtils.IconBundleStrategy getIconBundleStrategy()
          Return the strategy used to find an icon bundle for a bean.
static IdentifyUtils getInstance()
          Return the static instance of IdentifyUtils.
static String getNameFor(Object bean)
          Return a name for the specified bean using the set name strategy.
 IdentifyUtils.NameStrategy getNameStrategy()
          Return the strategy used to determine the value for a name property on a bean.
 void setDefaultIconBundle(IconBundle defaultIconBundle)
          Set the default icon bundle to defaultIconBundle.
 void setIconBundleStrategy(IdentifyUtils.IconBundleStrategy iconBundleStrategy)
          Set the strategy used to find an icon bundle for a bean to iconBundleStrategy.
 void setNameStrategy(IdentifyUtils.NameStrategy nameStrategy)
          Set the strategy used to determine the value for a name property on a bean to nameStrategy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static IdentifyUtils getInstance()
Return the static instance of IdentifyUtils.

Returns:
the static instance of IdentifyUtils

getNameFor

public static String getNameFor(Object bean)
Return a name for the specified bean using the set name strategy. Return the String "null" if bean is null.

Parameters:
bean - bean
Returns:
a name for the specified bean
See Also:
getNameStrategy()

getIconBundleFor

public static IconBundle getIconBundleFor(Object bean)
Return an icon bundle for the specified bean using the set icon bundle strategy. Return null if bean is null, and the default icon bundle if an icon bundle cannot otherwise be found.

Parameters:
bean - bean
Returns:
an icon bundle for the specified bean
See Also:
getIconBundleStrategy(), getDefaultIconBundle()

getNameStrategy

public IdentifyUtils.NameStrategy getNameStrategy()
Return the strategy used to determine the value for a name property on a bean.

Returns:
the name strategy

setNameStrategy

public void setNameStrategy(IdentifyUtils.NameStrategy nameStrategy)
Set the strategy used to determine the value for a name property on a bean to nameStrategy.

Parameters:
nameStrategy - name strategy, must not be null

getIconBundleStrategy

public IdentifyUtils.IconBundleStrategy getIconBundleStrategy()
Return the strategy used to find an icon bundle for a bean.

Returns:
the icon bundle strategy

setIconBundleStrategy

public void setIconBundleStrategy(IdentifyUtils.IconBundleStrategy iconBundleStrategy)
Set the strategy used to find an icon bundle for a bean to iconBundleStrategy.

Parameters:
iconBundleStrategy - icon bundle strategy, must not be null

getDefaultIconBundle

public IconBundle getDefaultIconBundle()
Return the icon bundle to use as a default icon bundle, in the case the icon bundle strategy is unable to find an icon bundle for a bean.

Returns:
the icon bundle to use as a default icon bundle

setDefaultIconBundle

public void setDefaultIconBundle(IconBundle defaultIconBundle)
Set the default icon bundle to defaultIconBundle.

Parameters:
defaultIconBundle - the default icon bundle, must not be null


Copyright (c) 2003-2010 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).