@Override public NumberSymbols getNumberSymbols(NumberType numberType, Locale locale) throws UnifyException { return localeNumberSymbolMaps.get(locale, numberType); }
@Override public boolean invalidateStaleDocument(String name) throws UnifyException { if (isStaleDocument(name)) { uplDocumentByNameMap.removeSubkeys(name); return true; } return false; }
@Override public boolean invalidateStaleDocument(String name) throws UnifyException { if (uplCompiler.invalidateStaleDocument(name)) { Set<StandalonePanelInfo> infoList = standalonePanelInfoByNameMap.removeSubkeys(name); for (StandalonePanelInfo standalonePanelInfo : infoList) { standalonePanelInfo.invalidate(); } pageNamePropertyBindings.remove(name); return true; } return false; }
@Override public DateTimeFormat getSubPatternDateTimeFormat(String pattern, Locale locale) throws UnifyException { return localeDateTimeFormatMaps.get(locale, pattern); }
@Override public UplElementAttributes compileDescriptor(Locale locale, String descriptor) throws UnifyException { return uplElementByDescriptorMap.get(locale, descriptor); }
@Override public Pattern getPattern(Locale locale, String regexMessageKey) throws UnifyException { return patterns.get(locale, regexMessageKey); }
/** * Returns a cached simple date format pool for specified locale and pattern. * * @param locale * the supplied locale * @param pattern * the supplied pattern * @throws UnifyException * if an error occurs */ public static SimpleDateFormatPool getSimpleDateFormatPool(Locale locale, String pattern) throws UnifyException { return simpleDateFormatPoolMap.get(locale, pattern); }
@Override public UplDocumentAttributes compileComponentDocuments(Locale locale, String name) throws UnifyException { return uplDocumentByNameMap.get(locale, name); }
@Override public Map<String, BindingInfo> getStandalonePanelPropertyBindings(String name) throws UnifyException { standalonePanelInfoByNameMap.get(Locale.getDefault(), name); return pageNamePropertyBindings.get(name); }
@Override public List<? extends Listable> getList(Locale locale, String listName, Object... params) throws UnifyException { if (staticListNames.contains(listName)) { return staticLists.get(locale, listName); } return executeListCommand(listName, locale, params); }
/** * Parses a date string using supplied format. * * @param format * the format to use * @param dateString * the date string to parse * @return parsed date * @throws UnifyException * if an error occurs */ public static Date parse(String format, String dateString) throws UnifyException { return simpleDateFormatPoolMap.get(Locale.getDefault(), format).parse(dateString); }
/** * Formats a date using default locale and supplied date pattern. * * @param format * the date pattern * @param date * the date to format * @return the formatted date * @throws UnifyException * if an error occurs */ public static String format(String format, Date date) throws UnifyException { return simpleDateFormatPoolMap.get(Locale.getDefault(), format).format(date); }
@Override protected Map<String, String> createObject(Locale locale, String listName, Object... params) throws Exception { Map<String, String> listMap = new HashMap<String, String>(); for (Listable listable : staticLists.get(locale, listName, params)) { listMap.put(listable.getListKey(), listable.getListDescription()); } return Collections.unmodifiableMap(listMap); } };
@Override public Map<String, String> getListMap(Locale locale, String listName, Object... params) throws UnifyException { if (staticListNames.contains(listName)) { return staticListMaps.get(locale, listName); } Map<String, String> listMap = new HashMap<String, String>(); for (Listable listable : executeListCommand(listName, locale, params)) { listMap.put(listable.getListKey(), listable.getListDescription()); } return listMap; }
/** * Gets a UPL component with specified descriptor. * * @param locale * the locale * @param descriptor * the UPL descriptor * @param cached * the cached flag. * @return If the cached flag is set, the container returns a cached instance * with the same descriptor and locale if found. Otherwise, a new * instance is returned. * @throws UnifyException * if an error occurs */ public UplComponent getUplComponent(Locale locale, String descriptor, boolean cached) throws UnifyException { if (cached) { return cachedLocaleUplComponentMap.get(locale, descriptor); } try { UplElementAttributes uplElementAttributes = uplCompiler.compileDescriptor(locale, descriptor); UplComponent uplComponent = (UplComponent) getComponent(uplElementAttributes.getComponentName(), null, uplElementAttributes); return uplComponent; } finally { initializationTrailThreadLocal.remove(); } }
new StandalonePanelContext(standalonePanelInfoByNameMap.get(locale, name, uplDocumentAttributes)); StandalonePanelInfo standalonePanelInfo = ctx.getStandalonePanelInfo(); StandalonePanel standalonePanel = (StandalonePanel) getUplComponent(locale, uplDocumentAttributes.getKey());