Missed the test project.
[castle.git] / Components / TemplateEngine / Castle.Components.Common.TemplateEngine / ITemplateEngine.cs
blobd4099bfbf21550c5dd9152e7bb9bf9761e47f82c
1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle.Components.Common.TemplateEngine
17 using System;
18 using System.Collections;
19 using System.IO;
21 /// <summary>
22 /// Abstracts the underlying template engine being
23 /// used.
24 /// </summary>
25 public interface ITemplateEngine
27 /// <summary>
28 /// Implementors should process the template with
29 /// data from the context.
30 /// </summary>
31 /// <param name="context"></param>
32 /// <param name="templateName"></param>
33 /// <param name="output"></param>
34 /// <returns></returns>
35 bool Process(IDictionary context, String templateName, TextWriter output);
37 /// <summary>
38 /// Implementors should process the input template with
39 /// data from the context.
40 /// </summary>
41 /// <param name="context">The context.</param>
42 /// <param name="templateName">Name of the template. Used only for information during logging</param>
43 /// <param name="output">The output.</param>
44 /// <param name="inputTemplate">The input template.</param>
45 /// <returns></returns>
46 bool Process(IDictionary context, String templateName, TextWriter output, String inputTemplate);
48 /// <summary>
49 /// Implementors should process the input template with
50 /// data from the context.
51 /// </summary>
52 /// <param name="context">The context.</param>
53 /// <param name="templateName">Name of the template. Used only for information during logging</param>
54 /// <param name="output">The output.</param>
55 /// <param name="inputTemplate">The input template.</param>
56 /// <returns></returns>
57 bool Process(IDictionary context, String templateName, TextWriter output, TextReader inputTemplate);
59 /// <summary>
60 /// Implementors should return <c>true</c> only if the
61 /// specified template exists and can be used
62 /// </summary>
63 /// <param name="templateName"></param>
64 /// <returns></returns>
65 bool HasTemplate(String templateName);