Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
TokenType |
|
| 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 | /** | |
18 | * An enumeration of the different possible token types. | |
19 | * | |
20 | * @see TemplateToken | |
21 | * @author Howard Lewis Ship | |
22 | */ | |
23 | ||
24 | public final class TokenType | |
25 | { | |
26 | ||
27 | /** | |
28 | * Raw HTML text. | |
29 | * | |
30 | * @see TextToken | |
31 | */ | |
32 | ||
33 | 0 | public static final TokenType TEXT = new TokenType("TEXT"); |
34 | ||
35 | /** | |
36 | * The opening tag of an element. | |
37 | * | |
38 | * @see OpenToken | |
39 | */ | |
40 | ||
41 | 0 | public static final TokenType OPEN = new TokenType("OPEN"); |
42 | ||
43 | /** | |
44 | * The closing tag of an element. | |
45 | * | |
46 | * @see CloseToken | |
47 | */ | |
48 | ||
49 | 0 | public static final TokenType CLOSE = new TokenType("CLOSE"); |
50 | ||
51 | /** | |
52 | * A reference to a localized string. | |
53 | * | |
54 | * @since 2.0.4 | |
55 | */ | |
56 | ||
57 | 0 | public static final TokenType LOCALIZATION = new TokenType("LOCALIZATION"); |
58 | ||
59 | private final String _name; | |
60 | ||
61 | private TokenType(String name) | |
62 | 0 | { |
63 | 0 | _name = name; |
64 | 0 | } |
65 | ||
66 | public String toString() | |
67 | { | |
68 | 0 | return "TokenType[" + _name + "]"; |
69 | } | |
70 | ||
71 | public String getName() | |
72 | { | |
73 | 0 | return _name; |
74 | } | |
75 | } |