@@ -0,0 +1,2767 @@
+/*%0A * Copyright 2008-2013 the original author or authors.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *        http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.broadleafcommerce.common.util;%0A%0Aimport org.broadleafcommerce.common.web.BroadleafRequestContext;%0Aimport org.springframework.beans.BeansException;%0Aimport org.springframework.context.ApplicationContext;%0Aimport org.springframework.context.ApplicationContextAware;%0Aimport org.springframework.context.MessageSource;%0Aimport org.springframework.stereotype.Service;%0A%0A/**%0A * Convenience class to faciliate getting internationalized messages. %0A * %0A * Note that this class is scanned as a bean to pick up the applicationContext, but the methods%0A * this class provides should be invoked statically.%0A * %0A * @author Andre Azzolini (apazzolini)%0A */%0A@Service(%22blBLCMessageUtils%22)%0Apublic class BLCMessageUtils implements ApplicationContextAware %7B%0A%0A    protected static ApplicationContext applicationContext;%0A    %0A    /**%0A     * Returns the message requested by the code with no arguments and the currently set Java Locale on %0A     * the %7B@link BroadleafRequestContext%7D as returned by %7B@link BroadleafRequestContext#getJavaLocale()%7D%0A     * %0A     * @param code%0A     * @return the message%0A     */%0A    public static String getMessage(String code) %7B%0A        return getMessage(code, null);%0A    %7D%0A    %0A    /**%0A     * Returns the message requested by the code with the specified arguments and the currently set Java Locale on %0A     * the %7B@link BroadleafRequestContext%7D as returned by %7B@link BroadleafRequestContext#getJavaLocale()%7D%0A     * %0A     * @param code%0A     * @return the message%0A     */%0A    public static String getMessage(String code, Object%5B%5D args) %7B%0A        BroadleafRequestContext brc = BroadleafRequestContext.getBroadleafRequestContext();%0A        return getMessageSource().getMessage(code, args, brc.getJavaLocale());%0A    %7D%0A    %0A    /**%0A     * @return the %22messageSource%22 bean from the application context%0A     */%0A    protected static MessageSource getMessageSource() %7B%0A        return (MessageSource) applicationContext.getBean(%22messageSource%22);%0A    %7D%0A%0A    @Override%0A    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException %7B%0A        BLCMessageUtils.applicationContext = applicationContext;%0A    %7D%0A%0A%7D%0A

Add a utility class for looking up internationalized messages