org.nuiton.i18n.init
Class I18nInitializer

java.lang.Object
  extended by org.nuiton.i18n.init.I18nInitializer
Direct Known Subclasses:
ClassPathI18nInitializer, DefaultI18nInitializer

public abstract class I18nInitializer
extends Object

Abstract object to resolv I18nBundle and prepare initialization of I18n.

Since:
1.1
Author:
tchemit , fdebois

Field Summary
protected  Charset encoding
          Encoding used to load i18n bundles.
protected  I18nMessageFormatter messageFormatter
          Message formatter used in I18n to produce final translated messages.
 
Constructor Summary
protected I18nInitializer()
           
 
Method Summary
 Charset getEncoding()
          Get the Charset encoding used for i18n Properties file loading.
 I18nMessageFormatter getMessageFormatter()
          Get the I18nMessageFormatter to use on each i18n message translation.
abstract  I18nBundle[] resolvBundles()
          Resolv the bundles.
 I18nBundle[] resolvBundles(URL... urls)
           
 void setEncoding(Charset encoding)
          Set encoding to use for i18n Properties file loading.
 void setMessageFormatter(I18nMessageFormatter messageFormatter)
          Set messageFormatter to use on each i18n message translation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

encoding

protected Charset encoding
Encoding used to load i18n bundles.

Since:
2.4

messageFormatter

protected I18nMessageFormatter messageFormatter
Message formatter used in I18n to produce final translated messages.

Since:
2.4
Constructor Detail

I18nInitializer

protected I18nInitializer()
Method Detail

resolvBundles

public abstract I18nBundle[] resolvBundles()
                                    throws Exception
Resolv the bundles.

Returns:
the bundles detected
Throws:
Exception - if any pb while getting bundles

resolvBundles

public I18nBundle[] resolvBundles(URL... urls)
                           throws Exception
Throws:
Exception

getEncoding

public Charset getEncoding()
Get the Charset encoding used for i18n Properties file loading.

Returns:
encoding to use
Since:
2.4

setEncoding

public void setEncoding(Charset encoding)
                 throws NullPointerException
Set encoding to use for i18n Properties file loading.

Parameters:
encoding - Charset encoding to use
Throws:
NullPointerException - if encoding is null
Since:
2.4

getMessageFormatter

public I18nMessageFormatter getMessageFormatter()
Get the I18nMessageFormatter to use on each i18n message translation.

Returns:
formatter to use
Since:
2.4

setMessageFormatter

public void setMessageFormatter(I18nMessageFormatter messageFormatter)
                         throws NullPointerException
Set messageFormatter to use on each i18n message translation.

Parameters:
messageFormatter - I18nMessageFormatter to use
Throws:
NullPointerException - if messageFormatter is null
Since:
2.4


Copyright © 2004-2011 CodeLutin. All Rights Reserved.