Class LocalStringList

java.lang.Object
io.sf.jclf.text.LocalStringList

public class LocalStringList extends Object
A localized list of Strings. Lists can be nested.

A string list is a file containing several strings, each one on a different line.

  • Method Details

    • getLocaleName

      public String getLocaleName()
      Get the locale name.
      Returns:
      the locale name.
    • setParent

      public void setParent(LocalStringList parent)
      Set the parent of this list.
      Parameters:
      parent - the parent list.
    • isEmpty

      public boolean isEmpty()
      Is this list empty?
      Returns:
      true if the list is empty, false otherwise.
    • contains

      public boolean contains(String word)
      Does this list contain that word?
      Parameters:
      word - the word to search for.
      Returns:
      true if this list contains the specified word, false otherwise.
    • iterator

      public Iterator<String> iterator()
      Retrieves an iterator for the string list.
      Returns:
      the iterator.
    • getLocalList

      public static LocalStringList getLocalList(String baseName, String ext) throws IOException
      Get the requested localized StringList for the default locale.
      Parameters:
      baseName - see class description.
      ext - see class description.
      Returns:
      the localized string list best matching the default locale.
      Throws:
      IOException - if cannot find the localized file for the given base name and extension, for the default locale.
    • getLocalList

      public static LocalStringList getLocalList(String baseName, String ext, Locale locale) throws IOException
      Get the requested localized StringList.
      Parameters:
      baseName - see class description.
      ext - see class description.
      locale - see class description.
      Returns:
      the localized string list best matching the given locale.
      Throws:
      IOException - if cannot find the localized file for the given base name, locale, and extension.
    • loadList

      public static LocalStringList loadList(String baseFileName, String localeName, String ext)
      Load a localized StringList.
      Parameters:
      baseFileName - the base file name.
      localeName - the locale.
      ext - the extension.
      Returns:
      the exact localized string list for the given locale, or null if it could not be loaded.