fix #774 infinite loop in net.sourceforge.phpeclipse.builder.IdentifierIndexManager...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / ui / text / spelling / JavaDocTagDictionary.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11
12 package net.sourceforge.phpdt.internal.ui.text.spelling;
13
14 import java.net.URL;
15
16 import net.sourceforge.phpdt.internal.ui.text.phpdoc.IJavaDocTagConstants;
17 import net.sourceforge.phpdt.internal.ui.text.spelling.engine.AbstractSpellDictionary;
18
19 /**
20  * Dictionary for Javadoc tags.
21  * 
22  * @since 3.0
23  */
24 public class JavaDocTagDictionary extends AbstractSpellDictionary implements
25                 IJavaDocTagConstants {
26
27         /*
28          * @see net.sourceforge.phpdt.internal.ui.text.spelling.engine.AbstractSpellDictionary#getName()
29          */
30         protected final URL getURL() {
31                 return null;
32         }
33
34         /*
35          * @see net.sourceforge.phpdt.internal.ui.text.spelling.engine.ISpellDictionary#isCorrect(java.lang.String)
36          */
37         public boolean isCorrect(final String word) {
38
39                 if (word.charAt(0) == JAVADOC_TAG_PREFIX)
40                         return super.isCorrect(word);
41
42                 return false;
43         }
44
45         /*
46          * @see net.sourceforge.phpdt.ui.text.spelling.engine.AbstractSpellDictionary#load(java.net.URL)
47          */
48         protected boolean load(final URL url) {
49
50                 unload();
51
52                 for (int index = 0; index < JAVADOC_LINK_TAGS.length; index++)
53                         hashWord(JAVADOC_LINK_TAGS[index]);
54
55                 for (int index = 0; index < JAVADOC_ROOT_TAGS.length; index++)
56                         hashWord(JAVADOC_ROOT_TAGS[index]);
57
58                 for (int index = 0; index < JAVADOC_PARAM_TAGS.length; index++)
59                         hashWord(JAVADOC_PARAM_TAGS[index]);
60
61                 return true;
62         }
63 }