KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tapestry > parse > TemplateTokenFactory


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 JavaDoc;
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  * @author glongman@intelligentworks.com
29  * @since 3.0
30  */

31 public class TemplateTokenFactory
32 {
33     public OpenToken createOpenToken(String JavaDoc tagName, String JavaDoc jwcId, String JavaDoc type, Location location)
34     {
35         return new OpenToken(tagName, jwcId, type, location);
36     }
37
38     public CloseToken createCloseToken(String JavaDoc tagName, Location location)
39     {
40         return new CloseToken(tagName, location);
41     }
42
43     public TextToken createTextToken(
44         char[] templateData,
45         int blockStart,
46         int end,
47         Location templateLocation)
48     {
49         return new TextToken(templateData, blockStart, end, templateLocation);
50     }
51
52     public LocalizationToken createLocalizationToken(
53         String JavaDoc tagName,
54         String JavaDoc localizationKey,
55         boolean raw,
56         Map JavaDoc attributes,
57         Location startLocation)
58     {
59         return new LocalizationToken(tagName, localizationKey, raw, attributes, startLocation);
60     }
61 }
Popular Tags