org.mentawai.list
Class ListManager

java.lang.Object
  extended by org.mentawai.list.ListManager

public class ListManager
extends Object

Author:
Sergio Oliveira

Field Summary
static String LIST_DIR
           
 
Constructor Summary
ListManager()
           
 
Method Summary
static void addList(DBListData list, ConnectionHandler connHandler)
           
static void addList(ListData list)
          Add a ListData to this ListManager.
static ListData convert(Collection data)
           
static ListData convert(Collection data, String keyProperty, String valueProperty)
           
static ListData convert(Map data)
           
static ListData convert(String listName, Collection data)
           
static ListData convert(String listName, Collection data, String keyProperty, String valueProperty)
           
static ListData convert(String listName, Enum[] enums, boolean i18n)
           
static ListData convert(String listName, Map data)
           
static ListData getList(String listname)
          Get a ListData by its name.
static List<ListData> getLists()
          Return all lists (ListData) in a java.util.List
static String getValue(String listName, int id)
           
static String getValue(String listName, int id, Locale loc)
           
static String getValue(String listName, String id)
           
static String getValue(String listName, String id, Locale loc)
           
static void init()
          Load any list inside the "/lists" directory (default).
static void setListDir(String listDir)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIST_DIR

public static String LIST_DIR
Constructor Detail

ListManager

public ListManager()
Method Detail

setListDir

public static void setListDir(String listDir)

init

public static void init()
                 throws IOException
Load any list inside the "/lists" directory (default). If the directory does not exist, ignore because the user probably doesn't want to load any list. He may not even know about this feature!

Throws:
IOException

getList

public static ListData getList(String listname)
Get a ListData by its name.

Parameters:
listname - The name of the list to return
Returns:
The list (ListData)

addList

public static void addList(ListData list)
Add a ListData to this ListManager.

Parameters:
list - The list to add

getLists

public static List<ListData> getLists()
Return all lists (ListData) in a java.util.List

Returns:
The list of all ListDatas in this ListManager.

addList

public static void addList(DBListData list,
                           ConnectionHandler connHandler)

convert

public static ListData convert(Collection data,
                               String keyProperty,
                               String valueProperty)

convert

public static ListData convert(String listName,
                               Collection data,
                               String keyProperty,
                               String valueProperty)

getValue

public static String getValue(String listName,
                              int id)

getValue

public static String getValue(String listName,
                              String id)

getValue

public static String getValue(String listName,
                              int id,
                              Locale loc)

getValue

public static String getValue(String listName,
                              String id,
                              Locale loc)

convert

public static ListData convert(Collection data)

convert

public static ListData convert(String listName,
                               Collection data)

convert

public static ListData convert(String listName,
                               Enum[] enums,
                               boolean i18n)

convert

public static ListData convert(Map data)

convert

public static ListData convert(String listName,
                               Map data)


Copyright © 2013. All Rights Reserved.