com.jgoodies.binding.util
Class LoggingUtils

java.lang.Object
  extended by com.jgoodies.binding.util.LoggingUtils

public final class LoggingUtils
extends java.lang.Object

Assists in logging changes in bound bean properties.

Version:
$Revision: 1.6 $
Author:
Andrej Golovnin, Karsten Lentzsch
See Also:
Logger

Method Summary
static void logPropertyChanges(java.lang.Object bean)
          Registers a PropertyChangeListener with the specified bean that logs all PropertyChangeEvents fired by this bean using the default Logger and default log level.
static void logPropertyChanges(java.lang.Object bean, java.util.logging.Logger logger)
          Registers a PropertyChangeListener with the specified bean, which logs all PropertyChangeEvents fired by the given bean using the specified Logger and the default log level.
static void logPropertyChanges(java.lang.Object bean, java.util.logging.Logger logger, java.util.logging.Level level)
          Registers a PropertyChangeListener with the specified bean, which logs all PropertyChangeEvents fired by the given bean using the specified Logger and log level.
static void logPropertyChanges(java.lang.Object bean, java.lang.String propertyName)
          Registers a named PropertyChangeListener with the specified bean, which logs all PropertyChangeEvents of the given property using the default Logger and default log level.
static void logPropertyChanges(java.lang.Object bean, java.lang.String propertyName, java.util.logging.Logger logger)
          Registers a named PropertyChangeListener with the specified bean, which logs all PropertyChangeEvents of the given property using the specified Logger and the default log level.
static void logPropertyChanges(java.lang.Object bean, java.lang.String propertyName, java.util.logging.Logger logger, java.util.logging.Level level)
          Registers a named PropertyChangeListener with the specified bean, which logs all PropertyChangeEvents of the given property, Logger, and log level.
static void setDefaultLevel(java.util.logging.Level level)
          Sets the default log level to be used when logging PropertyChangeEvents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setDefaultLevel

public static void setDefaultLevel(java.util.logging.Level level)
Sets the default log level to be used when logging PropertyChangeEvents. The initial default level is Level.FINE.

Parameters:
level - the default level to be used if no custom level has been provided
Throws:
java.lang.NullPointerException - if the new defaultLevel is null

logPropertyChanges

public static void logPropertyChanges(java.lang.Object bean)
Registers a PropertyChangeListener with the specified bean that logs all PropertyChangeEvents fired by this bean using the default Logger and default log level.

Parameters:
bean - the bean to log PropertyChangeEvents from
Throws:
java.lang.NullPointerException - if the bean is null

logPropertyChanges

public static void logPropertyChanges(java.lang.Object bean,
                                      java.util.logging.Logger logger)
Registers a PropertyChangeListener with the specified bean, which logs all PropertyChangeEvents fired by the given bean using the specified Logger and the default log level.

Parameters:
bean - the bean to log PropertyChangeEvents from
logger - the Logger to be used to log PropertyChangeEvents
Throws:
java.lang.NullPointerException - if the bean or logger is null

logPropertyChanges

public static void logPropertyChanges(java.lang.Object bean,
                                      java.util.logging.Logger logger,
                                      java.util.logging.Level level)
Registers a PropertyChangeListener with the specified bean, which logs all PropertyChangeEvents fired by the given bean using the specified Logger and log level.

Parameters:
bean - the bean to log PropertyChangeEvents from
logger - the Logger to be used to log PropertyChangeEvents
level - the log level
Throws:
java.lang.NullPointerException - if the bean, logger, or level is null

logPropertyChanges

public static void logPropertyChanges(java.lang.Object bean,
                                      java.lang.String propertyName)
Registers a named PropertyChangeListener with the specified bean, which logs all PropertyChangeEvents of the given property using the default Logger and default log level.

Parameters:
bean - the bean to log PropertyChangeEvents from
propertyName - the name of the property which PropertyChangeEvents should be logged
Throws:
java.lang.NullPointerException - if the bean or propertyName is null

logPropertyChanges

public static void logPropertyChanges(java.lang.Object bean,
                                      java.lang.String propertyName,
                                      java.util.logging.Logger logger)
Registers a named PropertyChangeListener with the specified bean, which logs all PropertyChangeEvents of the given property using the specified Logger and the default log level.

Parameters:
bean - the bean to log PropertyChangeEvents from
propertyName - the name of the property which PropertyChangeEvents should be logged
logger - the Logger to be used to log PropertyChangeEvents
Throws:
java.lang.NullPointerException - if the bean, propertyName, or logger is null

logPropertyChanges

public static void logPropertyChanges(java.lang.Object bean,
                                      java.lang.String propertyName,
                                      java.util.logging.Logger logger,
                                      java.util.logging.Level level)
Registers a named PropertyChangeListener with the specified bean, which logs all PropertyChangeEvents of the given property, Logger, and log level.

Parameters:
bean - the bean to log PropertyChangeEvents from
propertyName - the name of the property which PropertyChangeEvents should be logged
logger - the Logger to be used to log PropertyChangeEvents
level - the log level
Throws:
java.lang.NullPointerException - if the bean, propertyName, logger, or level is null


Copyright © 2002-2008 JGoodies Karsten Lentzsch. All Rights Reserved.