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
ConstructorsModifierConstructorDescriptionprotectedPostfixedApplicationResource(String localePath) Create a new PostfixedApplicationResource for the specified path.protectedPostfixedApplicationResource(String path, Locale locale) Create a new PostfixedApplicationResource for the specified path. -
Method Summary
Modifier and TypeMethodDescriptionbooleanfinal LocaleGet the Locale for this resource.final StringGet the path name for this resource.final StringgetLocalePath(Locale newLocale) Get the path name of another version of the resource.final StringgetPath()Get the path name for this resource.inthashCode()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods 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:
getLocalePathin 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:
getPathin interfaceApplicationResource- Returns:
- the path excluding localization.
-
getLocalePath
Get the path name of another version of the resource.- Specified by:
getLocalePathin interfaceApplicationResource- Parameters:
newLocale- the Locale for the new version.- Returns:
- the path including localization.
-
getLocale
Get the Locale for this resource.- Specified by:
getLocalein interfaceApplicationResource- Returns:
- the Locale.
-
hashCode
public int hashCode() -
equals
-