/** {@inheritDoc} */ public Map<String, Definition> getBaseDefinitions() { return definitionDao.getDefinitions(null); }
/** {@inheritDoc} */ public void addDefinitions(Map<String, Definition> defsMap) { Map<String, Definition> definitions = definitionDao .getDefinitions(null); if (definitions == null) { throw new NullPointerException( "No definitions loaded for default locale"); } definitions.putAll(defsMap); }
/** {@inheritDoc} */ public void addDefinitions(Map<String, Definition> defsMap, Locale locale) { Map<String, Definition> definitions = definitionDao .getDefinitions(locale); if (definitions == null) { throw new NullPointerException( "No definitions loaded for locale '" + locale.toString() + "'"); } definitions.putAll(defsMap); }
/** * Appends locale-specific {@link Definition} objects to an existing * {@link Definitions} set by reading locale-specific versions of * the applied sources. * * @param definitions The Definitions object to append to. * @param tilesContext The requested locale. * @throws DefinitionsFactoryException if an error occurs reading definitions. * @deprecated Let the definitions be loaded by a {@link DefinitionDAO}. */ @Deprecated protected void addDefinitions(Definitions definitions, TilesRequestContext tilesContext) { Locale locale = localeResolver.resolveLocale(tilesContext); Map<String, Definition> defsMap = definitionDao.getDefinitions(locale); if (defsMap == null) { throw new NullPointerException( "There are no definitions mapped to locale '" + locale.toString() + "'"); } }