@Inject public void setUserSessionSource(UserSessionSource userSessionSource) { this.locale = userSessionSource.getLocale(); }
@Inject protected void setUserSessionSource(UserSessionSource userSessionSource) { this.locale = userSessionSource.getLocale(); }
public WebLocalDateTimeRenderer() { super(""); locale = AppBeans.get(UserSessionSource.class).getLocale(); }
public static Locale getLocale() { return getSource().getLocale(); } }
/** * Format Date (date without time) using {@code dateFormat} string specified in the main message pack. * @return string representation or empty string if the value is null */ public String formatDate(@Nullable Date value) { return datatypeRegistry.getNN(java.sql.Date.class).format(value, uss.getLocale()); }
/** * Parse Long using {@code integerFormat} string specified in the main message pack. * @return Long value or null if a blank string is provided */ @Nullable public Long parseLong(String str) throws ParseException { return datatypeRegistry.getNN(Long.class).parse(str, uss.getLocale()); } }
/** * Parse Date (time without date) using {@code timeFormat} string specified in the main message pack. * @return Date value or null if a blank string is provided */ @Nullable public Date parseTime(String str) throws ParseException { return datatypeRegistry.getNN(Time.class).parse(str, uss.getLocale()); }
/** * Parse BigDecimal using {@code decimalFormat} string specified in the main message pack. * @return BigDecimal value or null if a blank string is provided */ @Nullable public BigDecimal parseBigDecimal(String str) throws ParseException { return datatypeRegistry.getNN(BigDecimal.class).parse(str, uss.getLocale()); }
/** * Parse Integer using {@code integerFormat} string specified in the main message pack. * @return Integer value or null if a blank string is provided */ @Nullable public Integer parseInteger(String str) throws ParseException { return datatypeRegistry.getNN(Integer.class).parse(str, uss.getLocale()); }
/** * Format Double using {@code doubleFormat} string specified in the main message pack. * @return string representation or empty string if the value is null */ public String formatDouble(@Nullable Double value) { return datatypeRegistry.getNN(Double.class).format(value, uss.getLocale()); }
/** * Format Integer using {@code integerFormat} string specified in the main message pack. * @return string representation or empty string if the value is null */ public String formatInteger(@Nullable Integer value) { return datatypeRegistry.getNN(Integer.class).format(value, uss.getLocale()); }
/** * Parse Date (date without time) using {@code dateFormat} string specified in the main message pack. * @return Date value or null if a blank string is provided */ @Nullable public Date parseDate(String str) throws ParseException { return datatypeRegistry.getNN(java.sql.Date.class).parse(str, uss.getLocale()); }
/** * Format Date (time without date) using {@code timeFormat} string specified in the main message pack. * @return string representation or empty string if the value is null */ public String formatTime(@Nullable Date value) { return datatypeRegistry.getNN(Time.class).format(value, uss.getLocale()); }
/** * Parse Boolean using {@code trueString} and {@code falseString} strings specified in the main message pack. * @return Boolean value or null if a blank string is provided */ @Nullable public Boolean parseBoolean(String str) throws ParseException { return datatypeRegistry.getNN(Boolean.class).parse(str, uss.getLocale()); }
/** * Format BigDecimal using {@code decimalFormat} string specified in the main message pack. * @return string representation or empty string if the value is null */ public String formatBigDecimal(@Nullable BigDecimal value) { return datatypeRegistry.getNN(BigDecimal.class).format(value, uss.getLocale()); }
/** * Parse Double using {@code doubleFormat} string specified in the main message pack. * @return Double value or null if a blank string is provided */ @Nullable public Double parseDouble(String str) throws ParseException { return datatypeRegistry.getNN(Double.class).parse(str, uss.getLocale()); }
@Override public Tree<BasicPermissionTarget> getPermissions() { Tree<BasicPermissionTarget> allPermissions = permissionConfig.getSpecific(userSessionSource.getLocale()); return filterPermitted(allPermissions); }
protected Locale getCurrentLocale() { Locale locale; if (userSessionSource.checkCurrentUserSession()) { locale = userSessionSource.getLocale(); } else { locale = messages.getTools().getDefaultLocale(); } return locale; } }
@Override public Tree<BasicPermissionTarget> getPermissions() { Tree<BasicPermissionTarget> allPermissions = permissionConfig.getScreens(userSessionSource.getLocale()); return new Tree<>(collectSuitableNodes(allPermissions.getRootNodes())); }
@Override public void afterPropertiesSet() { UserSessionSource userSessionSource = beanLocator.get(UserSessionSource.NAME); FormatStringsRegistry formatStringsRegistry = beanLocator.get(FormatStringsRegistry.NAME); String timeFormat = formatStringsRegistry.getFormatStringsNN(userSessionSource.getLocale()).getTimeFormat(); setFormat(timeFormat); }