freemarker.template
Class UnparsedTemplateFactory

java.lang.Object
  extended by freemarker.template.UnparsedTemplateFactory
All Implemented Interfaces:
CompileableFactory<UnparsedTemplate>

public final class UnparsedTemplateFactory
extends java.lang.Object
implements CompileableFactory<UnparsedTemplate>

A factory class that can create UnparsedTemplate objects for various inputs.

Since:
1.9
Version:
$Id: UnparsedTemplateFactory.java 1112 2013-04-12 02:59:25Z run2000 $
Author:
Nicholas Cull

Field Summary
static UnparsedTemplateFactory INSTANCE
          The singleton instance of this UnparsedTemplateFactory.
 
Method Summary
 UnparsedTemplate create(CompileableFactoryParameters params)
          Create an instance of a UnparsedTemplate object from the given InputStream, using the named character encoding.
 UnparsedTemplate createFromFile(java.io.File file)
          Create an instance of a UnparsedTemplate object from the given file, using the platform default character encoding.
 UnparsedTemplate createFromFile(java.io.File file, java.lang.String encoding)
          Create an instance of a UnparsedTemplate object from the given file, using the named character encoding.
 UnparsedTemplate createFromFile(java.lang.String filePath)
          Create an instance of a UnparsedTemplate object from the given file path, using the platform default character encoding.
 UnparsedTemplate createFromFile(java.lang.String filePath, java.lang.String encoding)
          Create an instance of a UnparsedTemplate object from the given file, using the named character encoding.
 UnparsedTemplate createFromReader(java.io.Reader reader)
          Create an instance of a UnparsedTemplate object from the given Reader.
 UnparsedTemplate createFromStream(java.io.InputStream stream)
          Create an instance of a UnparsedTemplate object from the given InputStream, using the platform default character encoding.
 UnparsedTemplate createFromStream(java.io.InputStream stream, java.lang.String encoding)
          Create an instance of a UnparsedTemplate object from the given InputStream, using the named character encoding.
 UnparsedTemplate createFromString(java.lang.String str)
          Create an instance of a UnparsedTemplate object from the given String.
 java.lang.String getName()
          Return a name for the compilable object created by this factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final UnparsedTemplateFactory INSTANCE
The singleton instance of this UnparsedTemplateFactory.

Method Detail

getName

public java.lang.String getName()
Return a name for the compilable object created by this factory.

Specified by:
getName in interface CompileableFactory<UnparsedTemplate>
Returns:
"unparsed", to indicate this factory creates an unparsed text compilable object

create

public UnparsedTemplate create(CompileableFactoryParameters params)
                        throws java.io.IOException
Create an instance of a UnparsedTemplate object from the given InputStream, using the named character encoding.

Specified by:
create in interface CompileableFactory<UnparsedTemplate>
Parameters:
params -
Returns:
a newly created UnparsedTemplate object from the given input stream
Throws:
java.io.IOException - there was a problem reading from the input stream

createFromStream

public UnparsedTemplate createFromStream(java.io.InputStream stream)
                                  throws java.io.IOException
Create an instance of a UnparsedTemplate object from the given InputStream, using the platform default character encoding.

Parameters:
stream - the input stream from which the UnparsedTemplate object will be created
Returns:
a newly created UnparsedTemplate object from the given input stream
Throws:
java.io.IOException - there was a problem reading from the input stream

createFromStream

public UnparsedTemplate createFromStream(java.io.InputStream stream,
                                         java.lang.String encoding)
                                  throws java.io.IOException
Create an instance of a UnparsedTemplate object from the given InputStream, using the named character encoding.

Parameters:
stream - the input stream from which the UnparsedTemplate object will be created
encoding - the character encoding of the input stream
Returns:
a newly created UnparsedTemplate object from the given input stream
Throws:
java.io.IOException - there was a problem reading from the input stream

createFromFile

public UnparsedTemplate createFromFile(java.io.File file)
                                throws java.io.IOException
Create an instance of a UnparsedTemplate object from the given file, using the platform default character encoding.

Parameters:
file - the file from which the UnparsedTemplate object will be created
Returns:
a newly created UnparsedTemplate object from the given file
Throws:
java.io.IOException - there was a problem reading from the file

createFromFile

public UnparsedTemplate createFromFile(java.io.File file,
                                       java.lang.String encoding)
                                throws java.io.IOException
Create an instance of a UnparsedTemplate object from the given file, using the named character encoding.

Parameters:
file - the file from which the UnparsedTemplate object will be created
encoding - the character encoding of the file
Returns:
a newly created UnparsedTemplate object from the given file
Throws:
java.io.IOException - there was a problem reading from the file

createFromFile

public UnparsedTemplate createFromFile(java.lang.String filePath)
                                throws java.io.IOException
Create an instance of a UnparsedTemplate object from the given file path, using the platform default character encoding.

Parameters:
filePath - the file from which the UnparsedTemplate object will be created
Returns:
a newly created UnparsedTemplate object from the given file path
Throws:
java.io.IOException - there was a problem reading from the file path

createFromFile

public UnparsedTemplate createFromFile(java.lang.String filePath,
                                       java.lang.String encoding)
                                throws java.io.IOException
Create an instance of a UnparsedTemplate object from the given file, using the named character encoding.

Parameters:
filePath - the file from which the UnparsedTemplate object will be created
encoding - the character encoding of the file
Returns:
a newly created UnparsedTemplate object from the given file
Throws:
java.io.IOException - there was a problem reading from the file

createFromReader

public UnparsedTemplate createFromReader(java.io.Reader reader)
                                  throws java.io.IOException
Create an instance of a UnparsedTemplate object from the given Reader.

Parameters:
reader - the reader from which the UnparsedTemplate object will be created
Returns:
a newly created UnparsedTemplate object from the given reader
Throws:
java.io.IOException - there was a problem reading from the reader

createFromString

public UnparsedTemplate createFromString(java.lang.String str)
                                  throws java.io.IOException
Create an instance of a UnparsedTemplate object from the given String.

Parameters:
str - the string from which the UnparsedTemplate object will be created
Returns:
a newly created UnparsedTemplate object from the given string
Throws:
java.io.IOException - there was a problem reading from the string