Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||
ITemplateParser |
|
| 1.0;1 |
1 | // Copyright 2004, 2005 The Apache Software Foundation |
|
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. |
|
14 | ||
15 | package org.apache.tapestry.parse; |
|
16 | ||
17 | import org.apache.hivemind.Resource; |
|
18 | ||
19 | /** |
|
20 | * Service interface for the <code>tapestry.TemplateParser</code> service. |
|
21 | * Note that this requires a threaded service model. |
|
22 | * <p> |
|
23 | * Note: had to use the 'I' prefix, so that |
|
24 | * {@link org.apache.tapestry.parse.TemplateParser} could keep its name. |
|
25 | * Otherwise, it makes Spindle support really, really ugly. |
|
26 | * |
|
27 | * @author Howard Lewis Ship |
|
28 | * @since 4.0 |
|
29 | */ |
|
30 | public interface ITemplateParser |
|
31 | { |
|
32 | ||
33 | /** |
|
34 | * Parses the template data into an array of {@link TemplateToken}s. |
|
35 | * <p> |
|
36 | * The parser is <i>decidedly</i> not threadsafe, so care should be taken |
|
37 | * that only a single thread accesses it. |
|
38 | * |
|
39 | * @param templateData |
|
40 | * the HTML template to parse. Some tokens will hold a reference |
|
41 | * to this array. |
|
42 | * @param delegate |
|
43 | * object that "knows" about defined components |
|
44 | * @param resourceLocation |
|
45 | * a description of where the template originated from, used with |
|
46 | * error messages. |
|
47 | */ |
|
48 | TemplateToken[] parse(char[] templateData, |
|
49 | ITemplateParserDelegate delegate, Resource resourceLocation) |
|
50 | throws TemplateParseException; |
|
51 | } |