| Method from org.apache.tiles.definition.UrlDefinitionsFactory Detail: |
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() + "'");
}
} Deprecated! Let - the definitions be loaded by a DefinitionDAO .
Deprecated!Appends locale-specific Definition objects to an existing
Definitions set by reading locale-specific versions of
the applied sources. |
public void addSource(Object source) {
if (source == null) {
throw new DefinitionsFactoryException(
"Source object must not be null");
}
if (!(source instanceof URL)) {
throw new DefinitionsFactoryException(
"Source object must be an URL");
}
if (definitionDao instanceof URLReader) {
((URLReader) definitionDao).addSourceURL((URL) source);
}
} Deprecated! Use - URLReader#addSourceURL(URL) .
Deprecated!Adds a source where Definition objects are stored.
Implementations should publish what type of source object they expect.
The source should contain enough information to resolve a configuration
source containing definitions. The source should be a "base" source for
configurations. Internationalization and Localization properties will be
applied by implementations to discriminate the correct data sources based
on locale. |
protected static List<String> calculatePostfixes(Locale locale) {
return LocaleUtil.calculatePostfixes(locale);
} Deprecated! Use - LocaleUtil#calculatePostfixes(Locale) instead.
Deprecated!Calculate the postfixes along the search path from the base bundle to the
bundle specified by baseName and locale.
Method copied from java.util.ResourceBundle |
protected static String concatPostfix(String name,
String postfix) {
return LocaleUtil.concatPostfix(name, postfix);
} Deprecated! Use - LocaleUtil#concatPostfix(String,String) instead
Deprecated!Concat postfix to the name. Take care of existing filename extension.
Transform the given name "name.ext" to have "name" + "postfix" + "ext".
If there is no ext, return "name" + "postfix". |
protected DefinitionDAO<Locale> createDefaultDefinitionDAO() {
return new ResolvingLocaleUrlDefinitionDAO();
} Deprecated!Creates the default definition DAO, if it has not been specified outside. |
protected Definitions createDefinitions() {
return new CompatibilityDefinitionsImpl(definitionDao);
} Deprecated! Do - not use! Deprecated with no replacement.
Deprecated!Creates a new instance of Definitions. Override this method
to provide your custom instance of Definitions. |
protected Definitions getDefinitions() {
return new CompatibilityDefinitionsImpl(definitionDao);
} Deprecated! Do - not use! Deprecated with no replacement.
Deprecated!Returns the definitions holder object. |
protected List<String> getResourceNames(String resourceString) {
StringTokenizer tokenizer = new StringTokenizer(resourceString, ",");
List< String > filenames = new ArrayList< String >(tokenizer.countTokens());
while (tokenizer.hasMoreTokens()) {
filenames.add(tokenizer.nextToken().trim());
}
return filenames;
} Deprecated! Deprecated - without replacement.
Deprecated!Parse the resourceString into a list of resource paths
which can be loaded by the application context. |
protected String getResourceString(Map<String, String> parms) {
String resourceStr = parms.get(DefinitionsFactory.DEFINITIONS_CONFIG);
if (resourceStr == null) {
resourceStr = parms.get(BasicTilesContainer.DEFINITIONS_CONFIG);
}
if (resourceStr == null) {
resourceStr = parms.get(UrlDefinitionsFactory.LEGACY_DEFINITIONS_CONFIG);
}
if (resourceStr == null) {
resourceStr = "/WEB-INF/tiles.xml";
}
return resourceStr;
} Deprecated! Deprecated - without replacement.
Deprecated! |
protected boolean isContextProcessed(TilesRequestContext tilesContext) {
return true;
} Deprecated! It - always return true.
Deprecated!Indicates whether a given context has been processed or not.
This method can be used to avoid unnecessary synchronization of the
DefinitionsFactory in multi-threaded situations. Check the return of
isContextProcessed before synchronizing the object and reading
locale-specific definitions. |
public Definitions readDefinitions() {
return new CompatibilityDefinitionsImpl(definitionDao);
} Deprecated! Let - the Definitions Factory use it.
Deprecated!Creates and returns a Definitions set by reading
configuration data from the applied sources. |
public synchronized void refresh() {
log.debug("Updating Tiles definitions. . .");
if (definitionDao instanceof Refreshable) {
((Refreshable) definitionDao).refresh();
}
} Deprecated! |
public boolean refreshRequired() {
return (definitionDao instanceof RefreshMonitor)
&& ((RefreshMonitor) definitionDao).refreshRequired();
} Deprecated!Indicates whether the DefinitionsFactory is out of date and needs to be
reloaded. |