Debian Codegraph @

src/com/google/javascript/jscomp/parsing/Annotation.java

raw symbols SCIP
1 /*
2 * Copyright 2010 The Closure Compiler Authors.
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
17 package com.google.javascript.jscomp.parsing;
18
19 import com.google.common.collect.ImmutableMap;
20
21 import java.util.Map;
22
23 /**
24 * All natively recognized JSDoc annotations.
25 * @author [email protected] (Nick Santos)
26 */
27 enum Annotation {
28 NG_INJECT,
29 AUTHOR,
30 CONSISTENTIDGENERATOR,
31 CONSTANT,
32 CONSTRUCTOR,
33 DEFINE,
34 DEPRECATED,
35 DESC,
36 DICT,
37 ENUM,
38 EXTENDS,
39 EXTERNS,
40 EXPORT,
41 EXPOSE,
42 FILE_OVERVIEW,
43 HIDDEN,
44 IDGENERATOR,
45 IMPLEMENTS,
46 IMPLICIT_CAST,
47 INHERIT_DOC,
48 INTERFACE,
49 JAVA_DISPATCH,
50 LENDS,
51 LICENSE, // same as preserve
52 MEANING,
53 MODIFIES,
54 NO_ALIAS,
55 NO_COMPILE,
56 NO_SHADOW,
57 NO_SIDE_EFFECTS,
58 NO_TYPE_CHECK,
59 NOT_IMPLEMENTED,
60 OVERRIDE,
61 PARAM,
62 PRESERVE, // same as license
63 PRESERVE_TRY,
64 PRIVATE,
65 PROTECTED,
66 PUBLIC,
67 RETURN,
68 SEE,
69 STABLEIDGENERATOR,
70 STRUCT,
71 SUPPRESS,
72 TEMPLATE,
73 CLASS_TEMPLATE,
74 THIS,
75 THROWS,
76 TYPE,
77 TYPEDEF,
78 VERSION;
79
80 static final Map<String, Annotation> recognizedAnnotations =
81 new ImmutableMap.Builder<String, Annotation>().
82 put("ngInject", Annotation.NG_INJECT).
83 put("argument", Annotation.PARAM).
84 put("author", Annotation.AUTHOR).
85 put("consistentIdGenerator", Annotation.CONSISTENTIDGENERATOR).
86 put("const", Annotation.CONSTANT).
87 put("constant", Annotation.CONSTANT).
88 put("constructor", Annotation.CONSTRUCTOR).
89 put("copyright", Annotation.LICENSE).
90 put("define", Annotation.DEFINE).
91 put("deprecated", Annotation.DEPRECATED).
92 put("desc", Annotation.DESC).
93 put("dict", Annotation.DICT).
94 put("enum", Annotation.ENUM).
95 put("export", Annotation.EXPORT).
96 put("expose", Annotation.EXPOSE).
97 put("extends", Annotation.EXTENDS).
98 put("externs", Annotation.EXTERNS).
99 put("fileoverview", Annotation.FILE_OVERVIEW).
100 put("final", Annotation.CONSTANT).
101 put("hidden", Annotation.HIDDEN).
102 put("idGenerator", Annotation.IDGENERATOR).
103 put("implements", Annotation.IMPLEMENTS).
104 put("implicitCast", Annotation.IMPLICIT_CAST).
105 put("inheritDoc", Annotation.INHERIT_DOC).
106 put("interface", Annotation.INTERFACE).
107 put("javadispatch", Annotation.JAVA_DISPATCH).
108 put("lends", Annotation.LENDS).
109 put("license", Annotation.LICENSE).
110 put("meaning", Annotation.MEANING).
111 put("modifies", Annotation.MODIFIES).
112 put("noalias", Annotation.NO_ALIAS).
113 put("nocompile", Annotation.NO_COMPILE).
114 put("noshadow", Annotation.NO_SHADOW).
115 put("nosideeffects", Annotation.NO_SIDE_EFFECTS).
116 put("notypecheck", Annotation.NO_TYPE_CHECK).
117 put("override", Annotation.OVERRIDE).
118 put("owner", Annotation.AUTHOR).
119 put("param", Annotation.PARAM).
120 put("preserve", Annotation.PRESERVE).
121 put("preserveTry", Annotation.PRESERVE_TRY).
122 put("private", Annotation.PRIVATE).
123 put("protected", Annotation.PROTECTED).
124 put("public", Annotation.PUBLIC).
125 put("return", Annotation.RETURN).
126 put("returns", Annotation.RETURN).
127 put("see", Annotation.SEE).
128 put("stableIdGenerator", Annotation.STABLEIDGENERATOR).
129 put("struct", Annotation.STRUCT).
130 put("suppress", Annotation.SUPPRESS).
131 put("template", Annotation.TEMPLATE).
132 put("classTemplate", Annotation.CLASS_TEMPLATE).
133 put("this", Annotation.THIS).
134 put("throws", Annotation.THROWS).
135 put("type", Annotation.TYPE).
136 put("typedef", Annotation.TYPEDEF).
137 put("version", Annotation.VERSION).
138 build();
139 }