/** * * @param context * @param messageId * @return generated FacesMessage */ public static FacesMessage getMessage(FacesContext context, String messageId) { return getMessage(context, messageId, ((Object []) (null))); }
/** * Returns the ClassLoader to use when looking up resources under the top level package. By default, this is the * context class loader. * * @return the ClassLoader used to lookup resources */ protected ClassLoader getClassLoader() { return ClassUtils.getContextClassLoader(); }
public static Object newInstance(String type, Class expectedType) throws FacesException { return newInstance(type, expectedType == null ? null : new Class[] {expectedType}); }
/** * Retrieve the message from a specific bundle. It does not look on application message bundle * or default message bundle. If it is required to look on those bundles use getMessageFromBundle instead * * @param bundleBaseName baseName of ResourceBundle to load localized messages * @param messageId id of message * @param params parameters to set at localized message * @return generated FacesMessage */ public static FacesMessage getMessage(String bundleBaseName, String messageId, Object params[]) { return getMessage(bundleBaseName, getCurrentLocale(), messageId, params); }
/** * * @return currently applicable Locale for this request. */ public static Locale getCurrentLocale() { return getCurrentLocale(FacesContext.getCurrentInstance()); }
public static Object newInstance(String type) throws FacesException { if (type == null) { return null; } return newInstance(simpleClassForName(type)); }
/** * Gets the boolean init parameter value from the specified context. If the parameter was not specified, the default * value is used instead. * * @param context * the application's external context * @param names * the init parameter's names * * @return the init parameter value as a boolean * * @throws NullPointerException * if context or name is <code>null</code> */ public static boolean getBooleanInitParameter(ExternalContext context, String[] names) { return getBooleanInitParameter(context, names, false); }
/** * Gets the String init parameter value from the specified context. If the parameter is an empty String or a String * containing only white space, this method returns <code>null</code> * * @param context * the application's external context * @param name * the init parameter's name * * @return the parameter if it was specified and was not empty, <code>null</code> otherwise * * @throws NullPointerException * if context or name is <code>null</code> */ public static String getStringInitParameter(ExternalContext context, String name) { return getStringInitParameter(context,name,null); }
public static Object concat(Object arr1, Object arr2, Object arr3) { return concat(new Object[] {arr1, arr2, arr3}); }
public static void addMessage(FacesMessage.Severity severity, String messageId, Object[] args, FacesContext facesContext) { addMessage(severity, messageId, args, null, facesContext); }
/** * Return the parent NamingContainer of the component passed as argument. * * @param component * @return */ public static UIComponent findParentNamingContainer(UIComponent component) { return findParentNamingContainer(component, true); }
/** * Creates ApplicationObjects like NavigationHandler or StateManager and creates * the right wrapping chain of the ApplicationObjects known as the decorator pattern. * @param <T> * @param interfaceClass The class from which the implementation has to inherit from. * @param classNamesIterator All the class names of the actual ApplicationObject implementations * from the faces-config.xml. * @param defaultObject The default implementation for the given ApplicationObject. * @return * @since 1.0.1 */ public static <T> T buildApplicationObject(Class<T> interfaceClass, Collection<String> classNamesIterator, T defaultObject) { return buildApplicationObject(interfaceClass, null, null, classNamesIterator, defaultObject); }
public static FacesMessage getMessage(String messageId, Object params[]) { Locale locale = getCurrentLocale(); return getMessage(locale, messageId, params); }
public static FacesMessage getMessage(String bundleBaseName, FacesContext context, String messageId) { return getMessage(bundleBaseName, context, messageId, ((Object []) (null))); }
public static Object concat(Object arr1, Object arr2, Object arr3, Object arr4) { return concat(new Object[] {arr1, arr2, arr3, arr4}); }
public static void addMessage(String bundleBaseName, FacesMessage.Severity severity, String messageId, Object[] args, FacesContext facesContext) { addMessage(bundleBaseName, severity, messageId, args, null, facesContext); }
public static FacesMessage getMessage(String bundleBaseName, FacesMessage.Severity severity, String messageId, Object[] args, FacesContext facesContext) { FacesMessage message = getMessage(bundleBaseName, facesContext, messageId, args); message.setSeverity(severity); return message; }
public static Object concat(Object arr1, Object arr2, Object arr3, Object arr4, Object arr5) { return concat(new Object[] {arr1, arr2, arr3, arr4, arr5}); }
public static void addMessage(String bundleBaseName, FacesMessage.Severity severity, String messageId, Object[] args) { addMessage(bundleBaseName, severity, messageId, args, null, FacesContext.getCurrentInstance()); }
public static Object concatSameType(Object toArray, Object[] arrs) { int totalLen = 0; for (int i = 0, len = arrs.length; i < len; i++) { if (arrs[i] != null) { totalLen += Array.getLength(arrs[i]); } } return concat(toArray, totalLen, arrs); }