From 9940de968eb23e18e41149c9288280b2fe3596b2 Mon Sep 17 00:00:00 2001 From: Tor Norbye Date: Thu, 30 May 2013 16:05:34 -0700 Subject: Add resource reference annotations These annotations allow you to annotate an int parameter or return value to indicate that the int should correspond to a resource constant (such a R.string.app_name). Change-Id: I3a0b2ef0b943bdf9d5a2e1f978ccf3445eed829a --- core/java/android/annotation/RawRes.java | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 core/java/android/annotation/RawRes.java (limited to 'core/java/android/annotation/RawRes.java') diff --git a/core/java/android/annotation/RawRes.java b/core/java/android/annotation/RawRes.java new file mode 100644 index 0000000..39970b3 --- /dev/null +++ b/core/java/android/annotation/RawRes.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2013 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 java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.PARAMETER; +import static java.lang.annotation.RetentionPolicy.SOURCE; + +/** + * Denotes that an integer parameter, field or method return value is expected + * to be a raw resource reference. + * + * {@hide} + */ +@Documented +@Retention(SOURCE) +@Target({METHOD, PARAMETER, FIELD}) +public @interface RawRes { +} -- cgit v1.1