Package org.apache.tiles.request.locale
Class PostfixedApplicationResource
java.lang.Object
org.apache.tiles.request.locale.PostfixedApplicationResource
- All Implemented Interfaces:
ApplicationResource
- Direct Known Subclasses:
StrutsApplicationResource
,URLApplicationResource
An ApplicationResource whose localization is managed by postfixing the file name.
The various localizations are file sitting next to each other, with the locale identified in the postfix.
For instance:
/WEB-INF/tiles.xml /WEB-INF/tiles_fr.xml /WEB-INF/tiles_it.xml /WEB-INF/tiles_it_IT.xmlTwo PostfixedApplicationResources are equals if they share the same localized path and the same class.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
PostfixedApplicationResource
(String localePath) Create a new PostfixedApplicationResource for the specified path.protected
PostfixedApplicationResource
(String path, Locale locale) Create a new PostfixedApplicationResource for the specified path. -
Method Summary
Modifier and TypeMethodDescriptionboolean
final Locale
Get the Locale for this resource.final String
Get the path name for this resource.final String
getLocalePath
(Locale newLocale) Get the path name of another version of the resource.final String
getPath()
Get the path name for this resource.int
hashCode()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.tiles.request.ApplicationResource
getInputStream, getLastModified
-
Constructor Details
-
PostfixedApplicationResource
Create a new PostfixedApplicationResource for the specified path.- Parameters:
localePath
- the path including localization.
-
PostfixedApplicationResource
Create a new PostfixedApplicationResource for the specified path.- Parameters:
path
- the path excluding localization.locale
- the Locale.
-
-
Method Details
-
getLocalePath
Get the path name for this resource. You can access this resource by passing the path togetResource
.- Specified by:
getLocalePath
in interfaceApplicationResource
- Returns:
- the path including localization.
-
getPath
Get the path name for this resource. Multiple versions of a resource can share the same path if the locale part is different.- Specified by:
getPath
in interfaceApplicationResource
- Returns:
- the path excluding localization.
-
getLocalePath
Get the path name of another version of the resource.- Specified by:
getLocalePath
in interfaceApplicationResource
- Parameters:
newLocale
- the Locale for the new version.- Returns:
- the path including localization.
-
getLocale
Get the Locale for this resource.- Specified by:
getLocale
in interfaceApplicationResource
- Returns:
- the Locale.
-
hashCode
public int hashCode() -
equals
-