protected Locale getLocale() { if (GwtConfig.get().getModuleRunner().getLocale() != null) { return GwtConfig.get().getModuleRunner().getLocale(); } DefaultLocale annotation = GwtReflectionUtils.getAnnotation(proxiedClass, DefaultLocale.class); if (annotation != null) { String[] localeCodes = annotation.value().split("_"); switch (localeCodes.length) { case 1: return new Locale(localeCodes[0]); case 2: return new Locale(localeCodes[0], localeCodes[1]); default: throw new GwtTestI18NException("Cannot parse Locale value in annoted class [" + proxiedClass.getSimpleName() + "] : @" + DefaultLocale.class.getSimpleName() + "(" + annotation.value() + ")"); } } else { return null; } }
protected Locale getLocale() { if (GwtConfig.get().getModuleRunner().getLocale() != null) { return GwtConfig.get().getModuleRunner().getLocale(); } DefaultLocale annotation = GwtReflectionUtils.getAnnotation(proxiedClass, DefaultLocale.class); if (annotation != null) { String[] localeCodes = annotation.value().split("_"); switch (localeCodes.length) { case 1: return new Locale(localeCodes[0]); case 2: return new Locale(localeCodes[0], localeCodes[1]); default: throw new GwtTestI18NException("Cannot parse Locale value in annoted class [" + proxiedClass.getSimpleName() + "] : @" + DefaultLocale.class.getSimpleName() + "(" + annotation.value() + ")"); } } else { return null; } }
DefaultLocale.class); if (defLocaleAnnot != null) { defLocaleValue = defLocaleAnnot.value();
DefaultLocale.class); if (defLocaleAnnot != null) { defLocaleValue = defLocaleAnnot.value();
DefaultLocale.class); if (defLocaleAnnot != null) { defLocaleValue = defLocaleAnnot.value();
DefaultLocale.class); if (defLocaleAnnot != null) { defLocaleValue = defLocaleAnnot.value();
String defaultLocale = null; if (defLocaleAnnot != null) { defaultLocale = defLocaleAnnot.value(); } else { defaultLocale = DefaultLocale.DEFAULT_LOCALE;
String defaultLocale = null; if (defLocaleAnnot != null) { defaultLocale = defLocaleAnnot.value(); } else { defaultLocale = DefaultLocale.DEFAULT_LOCALE;
public void accept(MessageInterfaceVisitor cv, GwtLocale locale) throws MessageProcessingException { String defaultLocale = DefaultLocale.DEFAULT_LOCALE; DefaultLocale defLocaleAnnot = getAnnotation(DefaultLocale.class); if (defLocaleAnnot != null) { defaultLocale = defLocaleAnnot.value(); } GwtLocale sourceLocale; try { sourceLocale = factory.fromString(defaultLocale); } catch (IllegalArgumentException e) { // ignore specified default sourceLocale = factory.fromString(DefaultLocale.DEFAULT_LOCALE); } cv.visitMessageInterface(this, sourceLocale); for (Message msg : getMessages()) { MessageTranslation trans = msg.getTranslation(locale); MessageVisitor mv = cv.visitMessage(msg, trans != null ? trans : msg); if (mv != null) { msg.accept(mv); } } cv.endMessageInterface(this); }
public void accept(MessageInterfaceVisitor cv, GwtLocale locale) throws MessageProcessingException { String defaultLocale = DefaultLocale.DEFAULT_LOCALE; DefaultLocale defLocaleAnnot = getAnnotation(DefaultLocale.class); if (defLocaleAnnot != null) { defaultLocale = defLocaleAnnot.value(); } GwtLocale sourceLocale; try { sourceLocale = factory.fromString(defaultLocale); } catch (IllegalArgumentException e) { // ignore specified default sourceLocale = factory.fromString(DefaultLocale.DEFAULT_LOCALE); } cv.visitMessageInterface(this, sourceLocale); for (Message msg : getMessages()) { MessageTranslation trans = msg.getTranslation(locale); MessageVisitor mv = cv.visitMessage(msg, trans != null ? trans : msg); if (mv != null) { msg.accept(mv); } } cv.endMessageInterface(this); }
protected GwtLocale getDefaultLocale() { DefaultLocale defLocaleAnnot = getAnnotation(DefaultLocale.class); String defLocale = defLocaleAnnot != null ? defLocaleAnnot.value() : DefaultLocale.DEFAULT_LOCALE; return localeFactory.fromString(defLocale); }
protected GwtLocale getDefaultLocale() { DefaultLocale defLocaleAnnot = getAnnotation(DefaultLocale.class); String defLocale = defLocaleAnnot != null ? defLocaleAnnot.value() : DefaultLocale.DEFAULT_LOCALE; return localeFactory.fromString(defLocale); }
String defaultLocale = null; if (defLocaleAnnot != null) { defaultLocale = defLocaleAnnot.value(); } else { defaultLocale = DefaultLocale.DEFAULT_LOCALE;
public void accept(MessageInterfaceVisitor cv, GwtLocale locale) throws MessageProcessingException { String defaultLocale = DefaultLocale.DEFAULT_LOCALE; DefaultLocale defLocaleAnnot = getAnnotation(DefaultLocale.class); if (defLocaleAnnot != null) { defaultLocale = defLocaleAnnot.value(); } GwtLocale sourceLocale; try { sourceLocale = factory.fromString(defaultLocale); } catch (IllegalArgumentException e) { // ignore specified default sourceLocale = factory.fromString(DefaultLocale.DEFAULT_LOCALE); } cv.visitMessageInterface(this, sourceLocale); for (Message msg : getMessages()) { MessageTranslation trans = msg.getTranslation(locale); MessageVisitor mv = cv.visitMessage(msg, trans != null ? trans : msg); if (mv != null) { msg.accept(mv); } } cv.endMessageInterface(this); }
protected GwtLocale getDefaultLocale() { DefaultLocale defLocaleAnnot = getAnnotation(DefaultLocale.class); String defLocale = defLocaleAnnot != null ? defLocaleAnnot.value() : DefaultLocale.DEFAULT_LOCALE; return localeFactory.fromString(defLocale); }