|
| 1 | +/* |
| 2 | + * Copyright 2000-2009 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 | + * 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 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 not an user-visible string which needs to be localized, |
| 27 | + * or does not contain such strings. This annotation is intended to be used by localization tools for |
| 28 | + * detecting strings which should not be reported as requiring localization. |
| 29 | + * <ul> |
| 30 | + * <li>If a method parameter is annotated with {@code NonNls}, the strings passed |
| 31 | + * as values of this parameter are not reported as requiring localization. |
| 32 | + * Also, if the parameter of a property setter method is annotated with {@code NonNls}, values |
| 33 | + * of that property in UI Designer forms are never highlighted as hard-coded strings.</li> |
| 34 | + * <li>If a field is annotated with {@code NonNls}, all string literals found in the |
| 35 | + * initializer of the field are not reported as requiring localization.</li> |
| 36 | + * <li>If a method is called on a field, parameter or local variable annotated with {@code NonNls}, |
| 37 | + * string literals passed as parameters to the method are not reported as requiring localization. |
| 38 | + * <li>If a field, parameter or local variable annotated with {@code NonNls} is passed as a |
| 39 | + * parameter to the {@code equals()} method invoked on a string literal, the literal is not |
| 40 | + * reported as requiring localization.</li> |
| 41 | + * <li>If a field, parameter or local variable annotated with {@code NonNls} is found at |
| 42 | + * the left side of an assignment expression, all string literals in the right side |
| 43 | + * of the expression are not reported as requiring localization.</li> |
| 44 | + * <li>If a method is annotated with {@code NonNls}, string literals returned from the method |
| 45 | + * are not reported as requiring localization.</li> |
| 46 | + * <li>If a class is annotated with {@code NonNls}, all string literals in |
| 47 | + * the class and all its subclasses are not reported as requiring localization.</li> |
| 48 | + * <li>If a package is annotated with {@code NonNls}, all string literals in |
| 49 | + * the package and all its subpackages are not reported as requiring localization.</li> |
| 50 | + * </ul> |
| 51 | + * |
| 52 | + * @author max |
| 53 | + * @see Nls |
| 54 | + */ |
| 55 | +@Documented |
| 56 | +@Retention(RetentionPolicy.CLASS) |
| 57 | +@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE, ElementType.TYPE_USE, ElementType.TYPE, ElementType.PACKAGE}) |
| 58 | +public @interface NonNls { |
| 59 | + |
| 60 | +} |
0 commit comments