From be869932d085db74bfa6829364a2c7eb94d26fac Mon Sep 17 00:00:00 2001 From: Mike Keesey Date: Tue, 22 May 2012 15:18:42 -0600 Subject: [PATCH] Adding @Target and the associated ElementType enum for specifying the type an annotation is. --- .../java/lang/annotation/ElementType.java | 22 +++++++++++++++++++ classpath/java/lang/annotation/Target.java | 17 ++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 classpath/java/lang/annotation/ElementType.java create mode 100644 classpath/java/lang/annotation/Target.java diff --git a/classpath/java/lang/annotation/ElementType.java b/classpath/java/lang/annotation/ElementType.java new file mode 100644 index 0000000000..974fb10d64 --- /dev/null +++ b/classpath/java/lang/annotation/ElementType.java @@ -0,0 +1,22 @@ +/* Copyright (c) 2012, Avian Contributors + + Permission to use, copy, modify, and/or distribute this software + for any purpose with or without fee is hereby granted, provided + that the above copyright notice and this permission notice appear + in all copies. + + There is NO WARRANTY for this software. See license.txt for + details. */ + +package java.lang.annotation; + +public enum ElementType { + ANNOTATION_TYPE, + CONSTRUCTOR, + FIELD, + LOCAL_VARIABLE, + METHOD, + PACKAGE, + PARAMETER, + TYPE +} diff --git a/classpath/java/lang/annotation/Target.java b/classpath/java/lang/annotation/Target.java new file mode 100644 index 0000000000..8d2550343c --- /dev/null +++ b/classpath/java/lang/annotation/Target.java @@ -0,0 +1,17 @@ +/* Copyright (c) 2012, Avian Contributors + + Permission to use, copy, modify, and/or distribute this software + for any purpose with or without fee is hereby granted, provided + that the above copyright notice and this permission notice appear + in all copies. + + There is NO WARRANTY for this software. See license.txt for + details. */ + +package java.lang.annotation; + +@Retention(value=RetentionPolicy.RUNTIME) +@Target(value=ElementType.ANNOTATION_TYPE) +public @interface Target { + public ElementType[] value(); +}