freemarker.template.cache
Class FileRetrieverParameters

java.lang.Object
  extended by freemarker.template.cache.FileRetrieverParameters
All Implemented Interfaces:
CacheRetrieverParameters

public final class FileRetrieverParameters
extends java.lang.Object
implements CacheRetrieverParameters

Parameter class for creating new FileRetriever objects. This is a convenience class for passing parameters to a file retriever to configure the retriever. Any additional parameters can be added to this parameter class without having to alter the method signature of the retriever itself.

This is an immutable class. Calls to any of the withXXX() methods return a new object.

Since:
1.9
Version:
$Id: FileRetrieverParameters.java 1101 2013-04-01 04:17:32Z run2000 $
Author:
Nicholas Cull

Method Summary
 java.io.File getDirectoryRoot()
          Get the directory root for this parameter object.
 java.lang.String getEncoding()
          Get the character encoding for this parameter object.
 java.lang.String getFilenameSuffix()
          Get the filename suffix for this parameter object.
 TemplateRegistry getRegistry()
          Get the template registry for this parameter object.
static FileRetrieverParameters newInstance()
          Create a new instances of the FileRetrieverParameters class.
static FileRetrieverParameters newInstance(java.io.File directoryRoot)
          Create a new instances of the FileRetrieverParameters class, with the given directory root, and a default TemplateRegistry.
static FileRetrieverParameters newInstance(java.lang.String directoryRoot)
          Create a new instances of the FileRetrieverParameters class, with the given directory root, and a default TemplateRegistry.
 FileRetrieverParameters withDirectoryRoot(java.io.File directoryRoot)
          Return a new FileRetrieverParameters object with the given directory root in place of the existing directory root.
 FileRetrieverParameters withDirectoryRoot(java.lang.String directoryRoot)
          Return a new FileRetrieverParameters object with the given directory root in place of the existing directory root.
 FileRetrieverParameters withEncoding(java.lang.String encoding)
          Return a new FileRetrieverParameters object with the given character encoding in place of the existing character encoding.
 FileRetrieverParameters withFilenameSuffix(java.lang.String filenameSuffix)
          Return a new FileRetrieverParameters object with the given filename suffix in place of the existing filename suffix.
 FileRetrieverParameters withRegistry(TemplateRegistry registry)
          Return a new FileRetrieverParameters object with the given template registry in place of the existing template registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static FileRetrieverParameters newInstance()
Create a new instances of the FileRetrieverParameters class. This includes a default TemplateRegistry.

Returns:
a new FileRetrieverParameters object with a new template registry

newInstance

public static FileRetrieverParameters newInstance(java.io.File directoryRoot)
Create a new instances of the FileRetrieverParameters class, with the given directory root, and a default TemplateRegistry.

Parameters:
directoryRoot - the root directory containing files to be retrieved
Returns:
a new FileRetrieverParameters object with a new template registry

newInstance

public static FileRetrieverParameters newInstance(java.lang.String directoryRoot)
Create a new instances of the FileRetrieverParameters class, with the given directory root, and a default TemplateRegistry.

Parameters:
directoryRoot - the root directory containing files to be retrieved
Returns:
a new FileRetrieverParameters object with a new template registry

withDirectoryRoot

public FileRetrieverParameters withDirectoryRoot(java.io.File directoryRoot)
Return a new FileRetrieverParameters object with the given directory root in place of the existing directory root. This ensures that every FileRetrieverParameters object is immutable.

Parameters:
directoryRoot - the directory root to use in place of the existing directory root
Returns:
a new FileRetrieverParameters object with the new directory root

withDirectoryRoot

public FileRetrieverParameters withDirectoryRoot(java.lang.String directoryRoot)
Return a new FileRetrieverParameters object with the given directory root in place of the existing directory root. This ensures that every FileRetrieverParameters object is immutable.

Parameters:
directoryRoot - the directory root to use in place of the existing directory root
Returns:
a new FileRetrieverParameters object with the new directory root

withFilenameSuffix

public FileRetrieverParameters withFilenameSuffix(java.lang.String filenameSuffix)
Return a new FileRetrieverParameters object with the given filename suffix in place of the existing filename suffix. This ensures that every FileRetrieverParameters object is immutable.

Parameters:
filenameSuffix - the filename suffix to use in place of the existing filename suffix
Returns:
a new FileRetrieverParameters object with the new filename suffix

withEncoding

public FileRetrieverParameters withEncoding(java.lang.String encoding)
Return a new FileRetrieverParameters object with the given character encoding in place of the existing character encoding. This ensures that every FileRetrieverParameters object is immutable.

Parameters:
encoding - the character encoding to use in place of the existing character encoding
Returns:
a new FileRetrieverParameters object with the new character encoding

withRegistry

public FileRetrieverParameters withRegistry(TemplateRegistry registry)
Return a new FileRetrieverParameters object with the given template registry in place of the existing template registry. This ensures that every FileRetrieverParameters object is immutable.

Parameters:
registry - the template registry to use in place of the existing template registry
Returns:
a new FileRetrieverParameters object with the new template registry

getDirectoryRoot

public java.io.File getDirectoryRoot()
Get the directory root for this parameter object.

Returns:
the directory root

getFilenameSuffix

public java.lang.String getFilenameSuffix()
Get the filename suffix for this parameter object.

Returns:
the filename suffix

getEncoding

public java.lang.String getEncoding()
Get the character encoding for this parameter object.

Returns:
the character encoding

getRegistry

public TemplateRegistry getRegistry()
Get the template registry for this parameter object.

Returns:
the template registry