|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.admingui.common.util.GuiUtil
public class GuiUtil
| Field Summary | |
|---|---|
static String |
COMMON_RESOURCE_NAME
|
static Locale |
guiLocale
|
static String |
I18N_RESOURCE_BUNDLE
|
static String |
LOGGER_NAME
|
static String |
RESOURCE_NAME
|
| Constructor Summary | |
|---|---|
GuiUtil()
Creates a new instance of GuiUtil |
|
| Method Summary | ||
|---|---|---|
static String |
arrayToString(String[] str,
String delimiter)
This method concatenates the delimiter char to the end of each string in the array, and returns a single string with the concatenated string. |
|
static
|
asArray(Object o)
|
|
static String |
checkEmpty(String test)
|
|
static List<Map<String,Object>> |
convertArrayToListOfMap(Object[] values,
String key)
|
|
static List<String> |
convertListOfStrings(List l)
|
|
static List<Map<String,String>> |
convertMapToListOfMap(Map<String,String> values)
|
|
static String |
encode(String value,
String delim,
String type)
This method encodes the given String with the specified type. |
|
static String |
genId(String uid)
This method generates an ID that is safe for JSF for the given String. |
|
static Boolean |
getBooleanValue(Map pMap,
String name)
|
|
static ResourceBundle |
getBundle(String resourceName)
|
|
static Throwable[] |
getCauses(Throwable start)
Get the chain of exceptions via getCause(). |
|
static String |
getCommonMessage(String key)
|
|
static String |
getCommonMessage(String key,
Object[] args)
|
|
static org.jvnet.hk2.component.Habitat |
getHabitat()
|
|
static Locale |
getLocale()
|
|
static Logger |
getLogger()
|
|
static Object |
getMapValue(Map map,
String mapKeys)
|
|
static String |
getMessage(ResourceBundle bundle,
String key)
|
|
static String |
getMessage(String key)
|
|
static String |
getMessage(String key,
Object[] args)
|
|
static String |
getMessage(String resourceName,
String key)
|
|
static String |
getMessage(String resourceName,
String key,
Object[] args)
|
|
static Throwable |
getRootCause(Throwable e)
Get the original troublemaker. |
|
static Object |
getSessionValue(String key)
|
|
static long |
getTimeStamp()
|
|
static void |
guiLog(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
|
|
static void |
handleError(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx,
String detail)
|
|
static void |
handleException(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx,
Throwable ex)
|
|
static void |
initSessionAttributes()
|
|
static boolean |
isEmpty(String str)
|
|
static boolean |
isSelected(String name,
List<Map> selectedList)
|
|
static String |
listToString(List<String> list,
String delimiter)
|
|
static String |
notNull(String test)
|
|
static List |
parseStringList(String line,
String sep)
Parses a string containing substrings separated from each other by the specified set of separator characters and returns a list of strings. |
|
static void |
prepareAlert(String type,
String summary,
String detail)
|
|
static void |
prepareException(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx,
Throwable ex)
|
|
static void |
prepareSuccessful(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
|
|
static String |
removeToken(String line,
String sep,
String remove)
|
|
static void |
setSessionValue(String key,
Object value)
|
|
static void |
setTimeStamp()
|
|
static String[] |
stringToArray(String str,
String delimiter)
This method converts a string into stringarray, uses the delimeter as the separator character. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String I18N_RESOURCE_BUNDLE
public static final String RESOURCE_NAME
public static final String COMMON_RESOURCE_NAME
public static final String LOGGER_NAME
public static final Locale guiLocale
| Constructor Detail |
|---|
public GuiUtil()
| Method Detail |
|---|
public static Logger getLogger()
public static void guiLog(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
public static boolean isEmpty(String str)
public static String getCommonMessage(String key,
Object[] args)
public static String getMessage(String resourceName,
String key,
Object[] args)
public static String getMessage(String key,
Object[] args)
public static void initSessionAttributes()
public static void setTimeStamp()
throws Exception
Exception
public static long getTimeStamp()
throws Exception
Exception
public static void setSessionValue(String key,
Object value)
public static Object getSessionValue(String key)
public static String encode(String value,
String delim,
String type)
This method encodes the given String with the specified type.
If type is not specified then it defaults to UTF-8.
value - String to be encodeddelim - Reserved Characters don't want to be encodedtype - Encoding type. Default is UTF-8public static String genId(String uid)
This method generates an ID that is safe for JSF for the given String. It does not guarantee that the id is unique, it is the responsibility of the caller to pass in a String that will result in a UID. All non-ascii characters will be replaced with an '_'. This method will also ensure an alpha character (or '_') is the first character in the id.
uid - A non-null String.public static ResourceBundle getBundle(String resourceName)
public static String getMessage(String key)
public static String getCommonMessage(String key)
public static String getMessage(String resourceName,
String key)
public static String getMessage(ResourceBundle bundle,
String key)
public static Locale getLocale()
public static void prepareSuccessful(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
public static void prepareException(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx,
Throwable ex)
public static void prepareAlert(String type,
String summary,
String detail)
public static void handleException(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx,
Throwable ex)
public static void handleError(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx,
String detail)
public static String notNull(String test)
public static List<String> convertListOfStrings(List l)
public static List parseStringList(String line,
String sep)
line into individual string elements
separated by the field separators specified in sep,
and returns these individual strings as a list of strings. The
individual string elements are trimmed of leading and trailing
whitespace. Only non-empty strings are returned in the list.
line - The string to splitsep - The list of separators to use for determining where the
string should be split. If null, then the standard
separators (see StringTokenizer javadocs) are used.
public static String removeToken(String line,
String sep,
String remove)
public static String[] stringToArray(String str,
String delimiter)
public static String arrayToString(String[] str,
String delimiter)
public static String listToString(List<String> list,
String delimiter)
public static <T> T[] asArray(Object o)
public static boolean isSelected(String name,
List<Map> selectedList)
public static String checkEmpty(String test)
public static Boolean getBooleanValue(Map pMap,
String name)
public static org.jvnet.hk2.component.Habitat getHabitat()
public static List<Map<String,Object>> convertArrayToListOfMap(Object[] values,
String key)
public static List<Map<String,String>> convertMapToListOfMap(Map<String,String> values)
public static Object getMapValue(Map map,
String mapKeys)
public static Throwable[] getCauses(Throwable start)
start - the Exception to traverse
public static Throwable getRootCause(Throwable e)
e - the Exception to dig into
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||