Debian Codegraph @

src/org/jetbrains/annotations/Nls.java

raw symbols SCIP
1 /*
2 * Copyright 2000-2021 JetBrains s.r.o.
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 * https://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 org.jetbrains.annotations;
18
19 import java.lang.annotation.Documented;
20 import java.lang.annotation.ElementType;
21 import java.lang.annotation.Retention;
22 import java.lang.annotation.RetentionPolicy;
23 import java.lang.annotation.Target;
24
25 /**
26 * Specifies that an element of the program is an user-visible string which needs to be localized.
27 * This annotation is intended to be used by localization tools for
28 * detecting strings which should be reported as requiring localization.
29 *
30 * <p>
31 * This annotation also could be used as a meta-annotation, to define derived annotations for convenience.
32 * E.g. the following annotation could be defined to annotate the strings that represent dialog titles:
33 *
34 * <pre>
35 * &#64;Nls(capitalization = Capitalization.Title)
36 * &#64;interface DialogTitle {}
37 * </pre>
38 * <p>
39 * Note that using the derived annotation as meta-annotation is not supported.
40 * Meta-annotation works only one level deep.
41 *
42 * @see NonNls
43 */
44 @Documented
45 @Retention(RetentionPolicy.CLASS)
46 @Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE, ElementType.TYPE_USE, ElementType.TYPE, ElementType.PACKAGE})
47 public @interface Nls {
48
49 enum Capitalization {
50
51 NotSpecified,
52 /**
53 * e.g. This Is a Title
54 */
55 Title,
56 /**
57 * e.g. This is a sentence
58 */
59 Sentence
60 }
61
62 Capitalization capitalization() default Capitalization.NotSpecified;
63 }