KickJava   Java API By Example, From Geeks To Geeks.

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


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 /**
18  * An enumeration of the different possible token types.
19  *
20  * @see TemplateToken
21  * @author Howard Lewis Ship
22  */

23
24 public class TokenType
25 {
26     /**
27      * Raw HTML text.
28      *
29      * @see TextToken
30      */

31
32     public static final TokenType TEXT = new TokenType("TEXT");
33
34     /**
35      * The opening tag of an element.
36      *
37      * @see OpenToken
38      */

39
40     public static final TokenType OPEN = new TokenType("OPEN");
41
42     /**
43      * The closing tag of an element.
44      *
45      * @see CloseToken
46      */

47
48     public static final TokenType CLOSE = new TokenType("CLOSE");
49
50     /**
51      * A reference to a localized string.
52      *
53      * @since 2.0.4
54      */

55
56     public static final TokenType LOCALIZATION = new TokenType("LOCALIZATION");
57
58     private final String JavaDoc _name;
59
60     private TokenType(String JavaDoc name)
61     {
62         _name = name;
63     }
64
65     public String JavaDoc toString()
66     {
67         return "TokenType[" + _name + "]";
68     }
69
70     public String JavaDoc getName()
71     {
72         return _name;
73     }
74 }
Popular Tags