KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > blandware > atleap > common > parsers > html > Tags


1 /*
2  * Copyright 2004 Blandware (http://www.blandware.com)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package com.blandware.atleap.common.parsers.html;
17
18 import java.util.Collections JavaDoc;
19 import java.util.HashSet JavaDoc;
20 import java.util.Set JavaDoc;
21
22 /**
23  * <p>Tags</p>
24  * <p><a HREF="Tags.java.htm"><i>View Source</i></a></p>
25  * <p>This code is taken from Apache lucene demo</p>
26  * <p/>
27  *
28  * @author Andrey Grebnev <a HREF="mailto:andrey.grebnev@blandware.com">&lt;andrey.grebnev@blandware.com&gt;</a>
29  * @version $Revision: 1.1 $ $Date: 2005/03/26 14:26:03 $
30  */

31 public final class Tags {
32
33     /**
34      * contains all tags for which whitespaces have to be inserted for proper tokenization
35      */

36     public static final Set JavaDoc WS_ELEMS = Collections.synchronizedSet(new HashSet JavaDoc());
37
38     static {
39         WS_ELEMS.add("<hr");
40         WS_ELEMS.add("<hr/"); // note that "<hr />" does not need to be listed explicitly
41
WS_ELEMS.add("<br");
42         WS_ELEMS.add("<br/");
43         WS_ELEMS.add("<p");
44         WS_ELEMS.add("</p");
45         WS_ELEMS.add("<div");
46         WS_ELEMS.add("</div");
47         WS_ELEMS.add("<td");
48         WS_ELEMS.add("</td");
49         WS_ELEMS.add("<li");
50         WS_ELEMS.add("</li");
51         WS_ELEMS.add("<q");
52         WS_ELEMS.add("</q");
53         WS_ELEMS.add("<blockquote");
54         WS_ELEMS.add("</blockquote");
55         WS_ELEMS.add("<dt");
56         WS_ELEMS.add("</dt");
57         WS_ELEMS.add("<h1");
58         WS_ELEMS.add("</h1");
59         WS_ELEMS.add("<h2");
60         WS_ELEMS.add("</h2");
61         WS_ELEMS.add("<h3");
62         WS_ELEMS.add("</h3");
63         WS_ELEMS.add("<h4");
64         WS_ELEMS.add("</h4");
65         WS_ELEMS.add("<h5");
66         WS_ELEMS.add("</h5");
67         WS_ELEMS.add("<h6");
68         WS_ELEMS.add("</h6");
69         WS_ELEMS.add("<title");
70         WS_ELEMS.add("</title");
71     }
72 }
73
Popular Tags