org.peaseplate.resolver
Class AbstractFileBasedResolver

java.lang.Object
  extended by org.peaseplate.resolver.AbstractFileBasedResolver
All Implemented Interfaces:
Resolver
Direct Known Subclasses:
ClassLoaderResolver, FileResolver

public abstract class AbstractFileBasedResolver
extends java.lang.Object
implements Resolver

An abstract base implementation of a Resolver. Provides methods for file based template resolvers.


Constructor Summary
AbstractFileBasedResolver()
           
 
Method Summary
protected  java.lang.String convertBackslashes(java.lang.String path)
          Replaces any backslashes to slashes.
protected  java.lang.String formatLocale(java.util.Locale locale)
          Formats the locale according to the needs of the includeLocale method
protected  java.lang.String includeLocale(java.lang.String path, java.util.Locale locale)
          Adds the locale to the path.
protected  java.lang.String replaceExtension(java.lang.String path)
          Replaces the extension with ".properties" for the message properties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.peaseplate.resolver.Resolver
resolveMessages, resolveTemplate
 

Constructor Detail

AbstractFileBasedResolver

public AbstractFileBasedResolver()
Method Detail

convertBackslashes

protected java.lang.String convertBackslashes(java.lang.String path)
Replaces any backslashes to slashes.

Parameters:
path - the path
Returns:
the result of the path conversion

replaceExtension

protected java.lang.String replaceExtension(java.lang.String path)
Replaces the extension with ".properties" for the message properties

Parameters:
path - the path
Returns:
the path with a replaced extension

includeLocale

protected java.lang.String includeLocale(java.lang.String path,
                                         java.util.Locale locale)
Adds the locale to the path. "foo/bar.pease" gets "foo/bar_de_AT.pease"

Parameters:
path - the path
locale - the locale
Returns:
the path, now including the locale

formatLocale

protected java.lang.String formatLocale(java.util.Locale locale)
Formats the locale according to the needs of the includeLocale method

Parameters:
locale - the locale, may be null
Returns:
the formatted locale or empty string if locale not specified


Copyright © 2008. All Rights Reserved.