1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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
18 using System
.Collections
;
22 /// Abstracts the underlying template engine being
25 public interface ITemplateEngine
28 /// Implementors should process the template with
29 /// data from the context.
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
);
38 /// Implementors should process the input template with
39 /// data from the context.
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
);
49 /// Implementors should process the input template with
50 /// data from the context.
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
);
60 /// Implementors should return <c>true</c> only if the
61 /// specified template exists and can be used
63 /// <param name="templateName"></param>
64 /// <returns></returns>
65 bool HasTemplate(String templateName
);