| | |
| | | */ |
| | | public final class ManagedObjectDefinitionI18NResource { |
| | | |
| | | // Application-wide set of instances. |
| | | /** Application-wide set of instances. */ |
| | | private static final Map<String, ManagedObjectDefinitionI18NResource> |
| | | INSTANCES = new HashMap<String, ManagedObjectDefinitionI18NResource>(); |
| | | |
| | |
| | | |
| | | |
| | | |
| | | // Get a resource instance creating it if necessary. |
| | | /** Get a resource instance creating it if necessary. */ |
| | | private static synchronized ManagedObjectDefinitionI18NResource getInstance( |
| | | String prefix) { |
| | | ManagedObjectDefinitionI18NResource instance = INSTANCES.get(prefix); |
| | |
| | | |
| | | |
| | | |
| | | // Mapping from definition to locale-based resource bundle. |
| | | /** Mapping from definition to locale-based resource bundle. */ |
| | | private final Map<AbstractManagedObjectDefinition<?, ?>, |
| | | Map<Locale, ResourceBundle>> resources; |
| | | |
| | | |
| | | |
| | | // The resource name prefix. |
| | | /** The resource name prefix. */ |
| | | private final String prefix; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private ManagedObjectDefinitionI18NResource(String prefix) { |
| | | this.resources = new HashMap<AbstractManagedObjectDefinition<?, ?>, |
| | | Map<Locale, ResourceBundle>>(); |
| | |
| | | |
| | | |
| | | |
| | | // Retrieve the resource bundle associated with a managed object and |
| | | // locale, lazily loading it if necessary. |
| | | /** |
| | | * Retrieve the resource bundle associated with a managed object and |
| | | * locale, lazily loading it if necessary. |
| | | */ |
| | | private synchronized ResourceBundle getResourceBundle( |
| | | AbstractManagedObjectDefinition<?, ?> d, Locale locale) |
| | | throws MissingResourceException, UnsupportedOperationException { |