Classes in this File | Line Coverage | Branch Coverage | Complexity | |||||||
TemplateTokenFactory |
|
| 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 java.util.Map; |
|
18 | ||
19 | import org.apache.hivemind.Location; |
|
20 | ||
21 | /** |
|
22 | * A Factory used by {@link org.apache.tapestry.parse.TemplateParser} to create |
|
23 | * {@link org.apache.tapestry.parse.TemplateToken} objects. |
|
24 | * |
|
25 | * <p> |
|
26 | * This class is extended by Spindle - the Eclipse Plugin for Tapestry. |
|
27 | * </p> |
|
28 | * |
|
29 | * @author glongman@intelligentworks.com |
|
30 | * @since 3.0 |
|
31 | */ |
|
32 | 34 | public class TemplateTokenFactory |
33 | { |
|
34 | ||
35 | public OpenToken createOpenToken(String tagName, String jwcId, String type, |
|
36 | Location location) |
|
37 | { |
|
38 | 35 | return new OpenToken(tagName, jwcId, type, location); |
39 | } |
|
40 | ||
41 | public CloseToken createCloseToken(String tagName, Location location) |
|
42 | { |
|
43 | 31 | return new CloseToken(tagName, location); |
44 | } |
|
45 | ||
46 | public TextToken createTextToken(char[] templateData, int blockStart, int end, Location templateLocation) |
|
47 | { |
|
48 | 77 | return new TextToken(templateData, blockStart, end, templateLocation); |
49 | } |
|
50 | ||
51 | public LocalizationToken createLocalizationToken(String tagName, String localizationKey, |
|
52 | boolean raw, Map attributes, Location startLocation) |
|
53 | { |
|
54 | 7 | return new LocalizationToken(tagName, localizationKey, raw, attributes, startLocation); |
55 | } |
|
56 | } |