NVelocity.Runtime.RuntimeInstance.GetTemplate C# (CSharp) Method

GetTemplate() public method

Returns a Template from the resource manager. This method assumes that the character encoding of the template is set by the input.encoding property. The default is "ISO-8859-1"
/// if template not found from any available source /// /// if template cannot be parsed due to syntax (or other) error. /// /// if an error occurs in template initialization ///
public GetTemplate ( String name ) : Template
name String The file name of the desired template. ///
return NVelocity.Template
		public Template GetTemplate(String name)
		{
			return GetTemplate(name, GetString(RuntimeConstants.INPUT_ENCODING, RuntimeConstants.ENCODING_DEFAULT));
		}

Same methods

RuntimeInstance::GetTemplate ( String name, String encoding ) : Template

Usage Example

示例#1
0
 /// <summary> Returns a <code>Template</code> from the resource manager.
 /// This method assumes that the character encoding of the
 /// template is set by the <code>input.encoding</code>
 /// property.  The default is "ISO-8859-1"
 /// *
 /// </summary>
 /// <param name="name">The file name of the desired template.
 /// </param>
 /// <returns>    The template.
 /// @throws ResourceNotFoundException if template not found
 /// from any available source.
 /// @throws ParseErrorException if template cannot be parsed due
 /// to syntax (or other) error.
 /// @throws Exception if an error occurs in template initialization
 ///
 /// </returns>
 public static Template GetTemplate(String name)
 {
     return(ri.GetTemplate(name));
 }