net.sourceforge.acelogger.factory
Class FormatterFactory

java.lang.Object
  extended by net.sourceforge.acelogger.factory.FormatterFactory

public final class FormatterFactory
extends Object

Factory for managing instances of configured formatters.

Since:
1.0.0
Version:
1.0.0
Author:
Zardi (https://sourceforge.net/users/daniel_zardi)

Method Summary
static Formatter getDefaultFormatter()
          Returns the default formatter of this factory, the one used when no formatter is found for a given identifier.
static Formatter getFormatter(String identifier)
          Obtains a properly configured formatter for the given identifier.
static List<Formatter> getRegisteredFormatters()
          Returns a list of all formatters registered in this factory.
static Formatter registerFormatter(Formatter formatter)
          Registers an appender within this factory.
static Formatter setDefaultFormatter(Formatter defaultFormatter)
          Sets the default formatter of this factory, the one used when no formatter is found for a given identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFormatter

public static Formatter getFormatter(String identifier)
Obtains a properly configured formatter for the given identifier.

Parameters:
identifier - The identifier of the intended formatter.
Returns:
A properly configured formatter for the given identifier. If the identifier is not found, then the default formatter is returned.
Since:
1.0.0
See Also:
getDefaultFormatter()

setDefaultFormatter

public static Formatter setDefaultFormatter(Formatter defaultFormatter)
Sets the default formatter of this factory, the one used when no formatter is found for a given identifier.

Parameters:
defaultFormatter - The formatter that will be used as the default one from now.
Returns:
The previous default formatter.
Since:
1.0.0

getDefaultFormatter

public static Formatter getDefaultFormatter()
Returns the default formatter of this factory, the one used when no formatter is found for a given identifier.

Returns:
The default formatter.
Since:
1.0.0

getRegisteredFormatters

public static List<Formatter> getRegisteredFormatters()
Returns a list of all formatters registered in this factory.

Returns:
A list of formatters.
Since:
1.0.0

registerFormatter

public static Formatter registerFormatter(Formatter formatter)
Registers an appender within this factory. The mapped identifier will be the formatters identifier.

Parameters:
formatter - The formatter to be registered.
Returns:
The default formatter if there was no previous mapping for the identifier or the previous configured formatter otherwise.
Since:
1.0.0
See Also:
getDefaultFormatter()


Copyright © 2007-2010 The AceLogger Team. All Rights Reserved.