aboutsummaryrefslogtreecommitdiffstats
path: root/annotations/src/android/annotation
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2012-01-31 14:12:29 -0800
committerXavier Ducrohet <xav@android.com>2012-01-31 14:12:29 -0800
commit4fc23e05df13def115ace408297dac8b39003892 (patch)
tree16cb289d590aa543a6eb300e8bbf44e4bd11c519 /annotations/src/android/annotation
parent825e060cb7a68f4022cf730439b0191ffece7dfd (diff)
downloadsdk-4fc23e05df13def115ace408297dac8b39003892.zip
sdk-4fc23e05df13def115ace408297dac8b39003892.tar.gz
sdk-4fc23e05df13def115ace408297dac8b39003892.tar.bz2
Refactor the lint-specific annotations.
Change-Id: I7d8d466defdcba8e638f158627978f12bfc76965
Diffstat (limited to 'annotations/src/android/annotation')
-rw-r--r--annotations/src/android/annotation/SuppressLint.java38
-rw-r--r--annotations/src/android/annotation/TargetApi.java38
2 files changed, 76 insertions, 0 deletions
diff --git a/annotations/src/android/annotation/SuppressLint.java b/annotations/src/android/annotation/SuppressLint.java
new file mode 100644
index 0000000..c65606d
--- /dev/null
+++ b/annotations/src/android/annotation/SuppressLint.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/org/documents/epl-v10.php
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.annotation;
+
+import static java.lang.annotation.ElementType.CONSTRUCTOR;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/** Indicates that Lint should ignore the specified warnings for the annotated element. */
+@Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE})
+@Retention(RetentionPolicy.CLASS)
+public @interface SuppressLint {
+ /**
+ * The set of warnings (identified by the lint issue id) that should be
+ * ignored by lint. It is not an error to specify an unrecognized name.
+ */
+ String[] value();
+}
diff --git a/annotations/src/android/annotation/TargetApi.java b/annotations/src/android/annotation/TargetApi.java
new file mode 100644
index 0000000..85d4905
--- /dev/null
+++ b/annotations/src/android/annotation/TargetApi.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/org/documents/epl-v10.php
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.annotation;
+
+import static java.lang.annotation.ElementType.CONSTRUCTOR;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/** Indicates that Lint should treat this type as targeting a given API level, no matter what the
+ project target is. */
+@Target({TYPE})
+@Retention(RetentionPolicy.CLASS)
+public @interface TargetApi {
+ /**
+ * This sets the target api level for the type..
+ */
+ int value();
+}