org.pf.nls
Class NLSIniFileLoader

java.lang.Object
  extended by org.pf.nls.NLSIniFileLoader

public class NLSIniFileLoader
extends Object

This loader is capable of reading text values from an NLS-ini file to one or more TextContainer objects.

Version:
1.0
Author:
M.Duchrow

Constructor Summary
NLSIniFileLoader()
          Initialize the new instance with default values.
 
Method Summary
 String getDefaultEncoding()
          Returns the default encoding that will be used to read text from a file if no explicit encoding was provided.
 TextContainer loadText(File file, Locale locale)
          Returns a text container with all texts for the specified locale from the given file.
 TextContainerList loadText(File file, Locale[] locales)
          Returns a list of text containers with all texts for the specified locales from the given file.
 TextContainer loadText(org.pf.file.FileLocator fileLocator, Locale locale)
          Returns a text container with all texts for the specified locale from the given file.
 TextContainerList loadText(org.pf.file.FileLocator fileLocator, Locale[] locales)
          Returns a list of text containers with all texts for the specified locales from the given file.
 TextContainer loadText(org.pf.file.FileLocator fileLocator, String localeName)
          Returns a text container with all texts for the specified locale from the given file.
 TextContainerList loadText(org.pf.file.FileLocator fileLocator, String[] localeNames)
          Returns a list of text containers with all texts for the specified locales from the given file.
 TextContainer loadText(File file, String localeName)
          Returns a text container with all texts for the specified locale from the given file.
 TextContainerList loadText(File file, String[] localeNames)
          Returns a list of text containers with all texts for the specified locales from the given file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NLSIniFileLoader

public NLSIniFileLoader()
Initialize the new instance with default values.

Method Detail

loadText

public TextContainer loadText(File file,
                              String localeName)
Returns a text container with all texts for the specified locale from the given file.


loadText

public TextContainer loadText(File file,
                              Locale locale)
Returns a text container with all texts for the specified locale from the given file.


loadText

public TextContainerList loadText(File file,
                                  Locale[] locales)
Returns a list of text containers with all texts for the specified locales from the given file.


loadText

public TextContainerList loadText(File file,
                                  String[] localeNames)
Returns a list of text containers with all texts for the specified locales from the given file. Returns null if the given file is null or the localeNames are null or empty.


loadText

public TextContainer loadText(org.pf.file.FileLocator fileLocator,
                              String localeName)
Returns a text container with all texts for the specified locale from the given file.


loadText

public TextContainer loadText(org.pf.file.FileLocator fileLocator,
                              Locale locale)
Returns a text container with all texts for the specified locale from the given file.


loadText

public TextContainerList loadText(org.pf.file.FileLocator fileLocator,
                                  Locale[] locales)
Returns a list of text containers with all texts for the specified locales from the given file.


loadText

public TextContainerList loadText(org.pf.file.FileLocator fileLocator,
                                  String[] localeNames)
Returns a list of text containers with all texts for the specified locales from the given file. Returns null if the given file is null or the localeNames are null or empty.


getDefaultEncoding

public String getDefaultEncoding()
Returns the default encoding that will be used to read text from a file if no explicit encoding was provided.

Returns:
"UTF-8"


Copyright © 2015 Manfred Duchrow Consulting & Software. All rights reserved.