diff options
| author | 2012-01-31 17:44:14 -0800 | |
|---|---|---|
| committer | 2012-01-31 17:44:14 -0800 | |
| commit | 3a29869d0b4a28d663cfbf7d4400d99520a840ea (patch) | |
| tree | b3ba9d73b37d9c8da6c31422166d719928cc4590 | |
| parent | 324e93fcf633c577031e406e3f240faa7e4f0a25 (diff) | |
| parent | d2726ba47ef49ff7de5cd955d702d0bb99432b4a (diff) | |
Merge "Add tools specific annotations to the API."
| -rw-r--r-- | api/current.txt | 10 | ||||
| -rw-r--r-- | core/java/android/annotation/SuppressLint.java | 38 | ||||
| -rw-r--r-- | core/java/android/annotation/TargetApi.java | 35 |
3 files changed, 83 insertions, 0 deletions
diff --git a/api/current.txt b/api/current.txt index bf71f67f20c7..fced7f17d39a 100644 --- a/api/current.txt +++ b/api/current.txt @@ -2402,6 +2402,16 @@ package android.animation { } +package android.annotation { + + public abstract class SuppressLint implements java.lang.annotation.Annotation { + } + + public abstract class TargetApi implements java.lang.annotation.Annotation { + } + +} + package android.app { public abstract class ActionBar { diff --git a/core/java/android/annotation/SuppressLint.java b/core/java/android/annotation/SuppressLint.java new file mode 100644 index 000000000000..2d3456b0ea46 --- /dev/null +++ b/core/java/android/annotation/SuppressLint.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 + * + * 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/core/java/android/annotation/TargetApi.java b/core/java/android/annotation/TargetApi.java new file mode 100644 index 000000000000..ea178903eb49 --- /dev/null +++ b/core/java/android/annotation/TargetApi.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 + * + * 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.METHOD; +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, METHOD, CONSTRUCTOR}) +@Retention(RetentionPolicy.CLASS) +public @interface TargetApi { + /** + * This sets the target api level for the type.. + */ + int value(); +} |