org.nuiton.i18n.plugin.bundle
Class StringFormatToMessageFormatConverter

java.lang.Object
  extended by org.nuiton.i18n.plugin.bundle.StringFormatToMessageFormatConverter
All Implemented Interfaces:
BundleFormatConverter

public class StringFormatToMessageFormatConverter
extends Object
implements BundleFormatConverter

Implementation of BundleFormatConverter to convert Formatter syntax to a MessageFormat syntax.

Created: 05/05/11

Since:
2.4
Author:
fdesbois , tchemit
Plexus component:
role:
"org.nuiton.i18n.plugin.bundle.BundleFormatConverter"
role-hint:
"toMessageFormat"

Field Summary
protected static Pattern PATTERN
           
 
Constructor Summary
StringFormatToMessageFormatConverter()
           
 
Method Summary
 String convert(String value)
          Convert format syntax to an other from value.
protected  String escapeQuoteChar(String value)
          Escape ' char with '', needed by MessageFormat.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PATTERN

protected static Pattern PATTERN
Constructor Detail

StringFormatToMessageFormatConverter

public StringFormatToMessageFormatConverter()
Method Detail

convert

public String convert(String value)
Description copied from interface: BundleFormatConverter
Convert format syntax to an other from value.

Specified by:
convert in interface BundleFormatConverter
Parameters:
value - message with some format placeholders to convert
Returns:
the message with other format syntax

escapeQuoteChar

protected String escapeQuoteChar(String value)
Escape ' char with '', needed by MessageFormat.

Parameters:
value - Message that contains '
Returns:
the message with ' escaped


Copyright © 2007-2011 CodeLutin. All Rights Reserved.