/** * Returns an instance of {@link Properties} containing the properly * localized messages for the component, in the {@link Locale} identified by * the component's containing page. * * @param component * The component to get properties for. * * @return A new {@link Properties} instance representing the localized properties for * the specified component. */ protected Properties getLocalizedProperties(IComponent component) { Defense.notNull(component, "component"); Resource specificationLocation = component.getSpecification().getSpecificationLocation(); Locale locale = component.getPage().getLocale(); Map propertiesMap = findPropertiesMapForResource(specificationLocation); Properties result = (Properties) propertiesMap.get(locale); if (result == null) { // Not found, create it now. result = assembleComponentProperties(component, specificationLocation, propertiesMap, locale); propertiesMap.put(locale, result); } return result; }
/** * Returns an instance of {@link Properties} containing the properly * localized messages for the component, in the {@link Locale} identified by * the component's containing page. * * @param component * The component to get properties for. * * @return A new {@link Properties} instance representing the localized properties for * the specified component. */ protected Properties getLocalizedProperties(IComponent component) { Defense.notNull(component, "component"); Resource specificationLocation = component.getSpecification().getSpecificationLocation(); Locale locale = component.getPage().getLocale(); Map propertiesMap = findPropertiesMapForResource(specificationLocation); Properties result = (Properties) propertiesMap.get(locale); if (result == null) { // Not found, create it now. result = assembleComponentProperties(component, specificationLocation, propertiesMap, locale); propertiesMap.put(locale, result); } return result; }