net.sourceforge.acelogger.interpolator
Class JavaUtilFormatterInterpolator

java.lang.Object
  extended by net.sourceforge.acelogger.interpolator.JavaUtilFormatterInterpolator
All Implemented Interfaces:
TextInterpolator

public final class JavaUtilFormatterInterpolator
extends Object
implements TextInterpolator

An implementation of TextInterpolator for the Formatter class.

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

Method Summary
static TextInterpolator getInstance()
          Gets a instance of this class.
 String interpolate(String pattern, Object... params)
          Interpolates parameters within a string, this should include formatting, padding and some basic conditionals.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static TextInterpolator getInstance()
Gets a instance of this class. The returned instance is always the same, synchronization issues are dealt by the methods of this class.

Returns:
A instance of this class.
Since:
1.0.0

interpolate

public String interpolate(String pattern,
                          Object... params)
Interpolates parameters within a string, this should include formatting, padding and some basic conditionals. The provided features depend directly of the underlying interpolator used.

Specified by:
interpolate in interface TextInterpolator
Parameters:
pattern - The string which should be interpolated.
params - The parameters used to interpolate the message.
Returns:
A string containing the pattern interpolated with the supplied parameters.


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