Class PostfixedApplicationResource

java.lang.Object
org.apache.tiles.request.locale.PostfixedApplicationResource
All Implemented Interfaces:
ApplicationResource
Direct Known Subclasses:
StrutsApplicationResource, URLApplicationResource

public abstract class PostfixedApplicationResource extends Object implements ApplicationResource
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.xml
 
Two PostfixedApplicationResources are equals if they share the same localized path and the same class.
  • Constructor Details

    • PostfixedApplicationResource

      protected PostfixedApplicationResource(String localePath)
      Create a new PostfixedApplicationResource for the specified path.
      Parameters:
      localePath - the path including localization.
    • PostfixedApplicationResource

      protected PostfixedApplicationResource(String path, Locale locale)
      Create a new PostfixedApplicationResource for the specified path.
      Parameters:
      path - the path excluding localization.
      locale - the Locale.
  • Method Details

    • getLocalePath

      public final String getLocalePath()
      Get the path name for this resource. You can access this resource by passing the path to getResource.
      Specified by:
      getLocalePath in interface ApplicationResource
      Returns:
      the path including localization.
    • getPath

      public final String 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 interface ApplicationResource
      Returns:
      the path excluding localization.
    • getLocalePath

      public final String getLocalePath(Locale newLocale)
      Get the path name of another version of the resource.
      Specified by:
      getLocalePath in interface ApplicationResource
      Parameters:
      newLocale - the Locale for the new version.
      Returns:
      the path including localization.
    • getLocale

      public final Locale getLocale()
      Get the Locale for this resource.
      Specified by:
      getLocale in interface ApplicationResource
      Returns:
      the Locale.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object