|
From: <ls...@us...> - 2007-08-11 10:57:14
|
Revision: 3384
http://jnode.svn.sourceforge.net/jnode/?rev=3384&view=rev
Author: lsantha
Date: 2007-08-11 03:57:11 -0700 (Sat, 11 Aug 2007)
Log Message:
-----------
Openjdk integration.
Added Paths:
-----------
trunk/core/src/openjdk/java/java/lang/Void.java
trunk/core/src/openjdk/java/java/lang/annotation/
trunk/core/src/openjdk/java/java/lang/annotation/Annotation.java
trunk/core/src/openjdk/java/java/lang/annotation/AnnotationFormatError.java
trunk/core/src/openjdk/java/java/lang/annotation/AnnotationTypeMismatchException.java
trunk/core/src/openjdk/java/java/lang/annotation/Documented.java
trunk/core/src/openjdk/java/java/lang/annotation/ElementType.java
trunk/core/src/openjdk/java/java/lang/annotation/IncompleteAnnotationException.java
trunk/core/src/openjdk/java/java/lang/annotation/Inherited.java
trunk/core/src/openjdk/java/java/lang/annotation/Retention.java
trunk/core/src/openjdk/java/java/lang/annotation/RetentionPolicy.java
trunk/core/src/openjdk/java/java/lang/annotation/Target.java
trunk/core/src/openjdk/java/java/lang/annotation/package-info.java
Added: trunk/core/src/openjdk/java/java/lang/Void.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/Void.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/Void.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,50 @@
+/*
+ * Copyright 1996-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang;
+
+/**
+ * The {@code Void} class is an uninstantiable placeholder class to hold a
+ * reference to the {@code Class} object representing the Java keyword
+ * void.
+ *
+ * @author unascribed
+ * @version 1.22, 05/05/07
+ * @since JDK1.1
+ */
+public final
+class Void {
+
+ /**
+ * The {@code Class} object representing the pseudo-type corresponding to
+ * the keyword {@code void}.
+ */
+ public static final Class<Void> TYPE = Class.getPrimitiveClass("void");
+
+ /*
+ * The Void class cannot be instantiated.
+ */
+ private Void() {}
+}
Added: trunk/core/src/openjdk/java/java/lang/annotation/Annotation.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/annotation/Annotation.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/annotation/Annotation.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang.annotation;
+
+/**
+ * The common interface extended by all annotation types. Note that an
+ * interface that manually extends this one does <i>not</i> define
+ * an annotation type. Also note that this interface does not itself
+ * define an annotation type.
+ *
+ * @author Josh Bloch
+ * @since 1.5
+ */
+public interface Annotation {
+ /**
+ * Returns true if the specified object represents an annotation
+ * that is logically equivalent to this one. In other words,
+ * returns true if the specified object is an instance of the same
+ * annotation type as this instance, all of whose members are equal
+ * to the corresponding member of this annotation, as defined below:
+ * <ul>
+ * <li>Two corresponding primitive typed members whose values are
+ * <tt>x</tt> and <tt>y</tt> are considered equal if <tt>x == y</tt>,
+ * unless their type is <tt>float</tt> or <tt>double</tt>.
+ *
+ * <li>Two corresponding <tt>float</tt> members whose values
+ * are <tt>x</tt> and <tt>y</tt> are considered equal if
+ * <tt>Float.valueOf(x).equals(Float.valueOf(y))</tt>.
+ * (Unlike the <tt>==</tt> operator, NaN is considered equal
+ * to itself, and <tt>0.0f</tt> unequal to <tt>-0.0f</tt>.)
+ *
+ * <li>Two corresponding <tt>double</tt> members whose values
+ * are <tt>x</tt> and <tt>y</tt> are considered equal if
+ * <tt>Double.valueOf(x).equals(Double.valueOf(y))</tt>.
+ * (Unlike the <tt>==</tt> operator, NaN is considered equal
+ * to itself, and <tt>0.0</tt> unequal to <tt>-0.0</tt>.)
+ *
+ * <li>Two corresponding <tt>String</tt>, <tt>Class</tt>, enum, or
+ * annotation typed members whose values are <tt>x</tt> and <tt>y</tt>
+ * are considered equal if <tt>x.equals(y)</tt>. (Note that this
+ * definition is recursive for annotation typed members.)
+ *
+ * <li>Two corresponding array typed members <tt>x</tt> and <tt>y</tt>
+ * are considered equal if <tt>Arrays.equals(x, y)</tt>, for the
+ * appropriate overloading of {@link java.util.Arrays#equals}.
+ * </ul>
+ *
+ * @return true if the specified object represents an annotation
+ * that is logically equivalent to this one, otherwise false
+ */
+ boolean equals(Object obj);
+
+ /**
+ * Returns the hash code of this annotation, as defined below:
+ *
+ * <p>The hash code of an annotation is the sum of the hash codes
+ * of its members (including those with default values), as defined
+ * below:
+ *
+ * The hash code of an annotation member is (127 times the hash code
+ * of the member-name as computed by {@link String#hashCode()}) XOR
+ * the hash code of the member-value, as defined below:
+ *
+ * <p>The hash code of a member-value depends on its type:
+ * <ul>
+ * <li>The hash code of a primitive value <tt><i>v</i></tt> is equal to
+ * <tt><i>WrapperType</i>.valueOf(<i>v</i>).hashCode()</tt>, where
+ * <tt><i>WrapperType</i></tt> is the wrapper type corresponding
+ * to the primitive type of <tt><i>v</i></tt> ({@link Byte},
+ * {@link Character}, {@link Double}, {@link Float}, {@link Integer},
+ * {@link Long}, {@link Short}, or {@link Boolean}).
+ *
+ * <li>The hash code of a string, enum, class, or annotation member-value
+ I <tt><i>v</i></tt> is computed as by calling
+ * <tt><i>v</i>.hashCode()</tt>. (In the case of annotation
+ * member values, this is a recursive definition.)
+ *
+ * <li>The hash code of an array member-value is computed by calling
+ * the appropriate overloading of
+ * {@link java.util.Arrays#hashCode(long[]) Arrays.hashCode}
+ * on the value. (There is one overloading for each primitive
+ * type, and one for object reference types.)
+ * </ul>
+ *
+ * @return the hash code of this annotation
+ */
+ int hashCode();
+
+ /**
+ * Returns a string representation of this annotation. The details
+ * of the representation are implementation-dependent, but the following
+ * may be regarded as typical:
+ * <pre>
+ * @com.acme.util.Name(first=Alfred, middle=E., last=Neuman)
+ * </pre>
+ *
+ * @return a string representation of this annotation
+ */
+ String toString();
+
+ /**
+ * Returns the annotation type of this annotation.
+ */
+ Class<? extends Annotation> annotationType();
+}
Added: trunk/core/src/openjdk/java/java/lang/annotation/AnnotationFormatError.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/annotation/AnnotationFormatError.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/annotation/AnnotationFormatError.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang.annotation;
+
+/**
+ * Thrown when the annotation parser attempts to read an annotation
+ * from a class file and determines that the annotation is malformed.
+ *
+ * @author Josh Bloch
+ * @since 1.5
+ */
+public class AnnotationFormatError extends Error {
+ /**
+ * Constructs a new <tt>AnnotationFormatError</tt> with the specified
+ * detail message.
+ *
+ * @param message the detail message.
+ */
+ public AnnotationFormatError(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new <tt>AnnotationFormatError</tt> with the specified
+ * detail message and cause. Note that the detail message associated
+ * with <code>cause</code> is <i>not</i> automatically incorporated in
+ * this error's detail message.
+ *
+ * @param message the detail message
+ * @param cause the cause (A <tt>null</tt> value is permitted, and
+ * indicates that the cause is nonexistent or unknown.)
+ */
+ public AnnotationFormatError(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+
+ /**
+ * Constructs a new <tt>AnnotationFormatError</tt> with the specified
+ * cause and a detail message of
+ * <tt>(cause == null ? null : cause.toString())</tt> (which
+ * typically contains the class and detail message of <tt>cause</tt>).
+ *
+ * @param cause the cause (A <tt>null</tt> value is permitted, and
+ * indicates that the cause is nonexistent or unknown.)
+ */
+ public AnnotationFormatError(Throwable cause) {
+ super(cause);
+ }
+}
Added: trunk/core/src/openjdk/java/java/lang/annotation/AnnotationTypeMismatchException.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/annotation/AnnotationTypeMismatchException.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/annotation/AnnotationTypeMismatchException.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang.annotation;
+import java.lang.reflect.Method;
+
+/**
+ * Thrown to indicate that a program has attempted to access an element of
+ * an annotation whose type has changed after the annotation was compiled
+ * (or serialized).
+ *
+ * @author Josh Bloch
+ * @since 1.5
+ */
+public class AnnotationTypeMismatchException extends RuntimeException {
+ /**
+ * The <tt>Method</tt> object for the annotation element.
+ */
+ private final Method element;
+
+ /**
+ * The (erroneous) type of data found in the annotation. This string
+ * may, but is not required to, contain the value as well. The exact
+ * format of the string is unspecified.
+ */
+ private final String foundType;
+
+ /**
+ * Constructs an AnnotationTypeMismatchException for the specified
+ * annotation type element and found data type.
+ *
+ * @param element the <tt>Method</tt> object for the annotation element
+ * @param foundType the (erroneous) type of data found in the annotation.
+ * This string may, but is not required to, contain the value
+ * as well. The exact format of the string is unspecified.
+ */
+ public AnnotationTypeMismatchException(Method element, String foundType) {
+ super("Incorrectly typed data found for annotation element " + element
+ + " (Found data of type " + foundType + ")");
+ this.element = element;
+ this.foundType = foundType;
+ }
+
+ /**
+ * Returns the <tt>Method</tt> object for the incorrectly typed element.
+ *
+ * @return the <tt>Method</tt> object for the incorrectly typed element
+ */
+ public Method element() {
+ return this.element;
+ }
+
+ /**
+ * Returns the type of data found in the incorrectly typed element.
+ * The returned string may, but is not required to, contain the value
+ * as well. The exact format of the string is unspecified.
+ *
+ * @return the type of data found in the incorrectly typed element
+ */
+ public String foundType() {
+ return this.foundType;
+ }
+}
Added: trunk/core/src/openjdk/java/java/lang/annotation/Documented.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/annotation/Documented.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/annotation/Documented.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang.annotation;
+
+/**
+ * Indicates that annotations with a type are to be documented by javadoc
+ * and similar tools by default. This type should be used to annotate the
+ * declarations of types whose annotations affect the use of annotated
+ * elements by their clients. If a type declaration is annotated with
+ * Documented, its annotations become part of the public API
+ * of the annotated elements.
+ *
+ * @author Joshua Bloch
+ * @version 1.12, 05/05/07
+ * @since 1.5
+ */
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.ANNOTATION_TYPE)
+public @interface Documented {
+}
Added: trunk/core/src/openjdk/java/java/lang/annotation/ElementType.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/annotation/ElementType.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/annotation/ElementType.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang.annotation;
+
+/**
+ * A program element type. The constants of this enumerated type
+ * provide a simple classification of the declared elements in a
+ * Java program.
+ *
+ * <p>These constants are used with the {@link Target} meta-annotation type
+ * to specify where it is legal to use an annotation type.
+ *
+ * @author Joshua Bloch
+ * @since 1.5
+ */
+public enum ElementType {
+ /** Class, interface (including annotation type), or enum declaration */
+ TYPE,
+
+ /** Field declaration (includes enum constants) */
+ FIELD,
+
+ /** Method declaration */
+ METHOD,
+
+ /** Parameter declaration */
+ PARAMETER,
+
+ /** Constructor declaration */
+ CONSTRUCTOR,
+
+ /** Local variable declaration */
+ LOCAL_VARIABLE,
+
+ /** Annotation type declaration */
+ ANNOTATION_TYPE,
+
+ /** Package declaration */
+ PACKAGE
+}
Added: trunk/core/src/openjdk/java/java/lang/annotation/IncompleteAnnotationException.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/annotation/IncompleteAnnotationException.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/annotation/IncompleteAnnotationException.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang.annotation;
+
+/**
+ * Thrown to indicate that a program has attempted to access an element of
+ * an annotation type that was added to the annotation type definition after
+ * the annotation was compiled (or serialized). This exception will not be
+ * thrown if the new element has a default value.
+ *
+ * @author Josh Bloch
+ * @since 1.5
+ */
+public class IncompleteAnnotationException extends RuntimeException {
+ private Class annotationType;
+ private String elementName;
+
+
+ /**
+ * Constructs an IncompleteAnnotationException to indicate that
+ * the named element was missing from the specified annotation type.
+ *
+ * @param annotationType the Class object for the annotation type
+ * @param elementName the name of the missing element
+ */
+ public IncompleteAnnotationException(
+ Class<? extends Annotation> annotationType,
+ String elementName) {
+ super(annotationType.getName() + " missing element " + elementName);
+
+ this.annotationType = annotationType;
+ this.elementName = elementName;
+ }
+
+ /**
+ * Returns the Class object for the annotation type with the
+ * missing element.
+ *
+ * @return the Class object for the annotation type with the
+ * missing element
+ */
+ public Class<? extends Annotation> annotationType() {
+ return annotationType;
+ }
+
+ /**
+ * Returns the name of the missing element.
+ *
+ * @return the name of the missing element
+ */
+ public String elementName() {
+ return elementName;
+ }
+}
Added: trunk/core/src/openjdk/java/java/lang/annotation/Inherited.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/annotation/Inherited.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/annotation/Inherited.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang.annotation;
+
+/**
+ * Indicates that an annotation type is automatically inherited. If
+ * an Inherited meta-annotation is present on an annotation type
+ * declaration, and the user queries the annotation type on a class
+ * declaration, and the class declaration has no annotation for this type,
+ * then the class's superclass will automatically be queried for the
+ * annotation type. This process will be repeated until an annotation for this
+ * type is found, or the top of the class hierarchy (Object)
+ * is reached. If no superclass has an annotation for this type, then
+ * the query will indicate that the class in question has no such annotation.
+ *
+ * <p>Note that this meta-annotation type has no effect if the annotated
+ * type is used to annotate anything other than a class. Note also
+ * that this meta-annotation only causes annotations to be inherited
+ * from superclasses; annotations on implemented interfaces have no
+ * effect.
+ *
+ * @author Joshua Bloch
+ * @since 1.5
+ */
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.ANNOTATION_TYPE)
+public @interface Inherited {
+}
Added: trunk/core/src/openjdk/java/java/lang/annotation/Retention.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/annotation/Retention.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/annotation/Retention.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang.annotation;
+
+/**
+ * Indicates how long annotations with the annotated type are to
+ * be retained. If no Retention annotation is present on
+ * an annotation type declaration, the retention policy defaults to
+ * {@code RetentionPolicy.CLASS}.
+ *
+ * <p>A Retention meta-annotation has effect only if the
+ * meta-annotated type is used directly for annotation. It has no
+ * effect if the meta-annotated type is used as a member type in
+ * another annotation type.
+ *
+ * @author Joshua Bloch
+ * @since 1.5
+ */
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.ANNOTATION_TYPE)
+public @interface Retention {
+ RetentionPolicy value();
+}
Added: trunk/core/src/openjdk/java/java/lang/annotation/RetentionPolicy.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/annotation/RetentionPolicy.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/annotation/RetentionPolicy.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang.annotation;
+
+/**
+ * Annotation retention policy. The constants of this enumerated type
+ * describe the various policies for retaining annotations. They are used
+ * in conjunction with the {@link Retention} meta-annotation type to specify
+ * how long annotations are to be retained.
+ *
+ * @author Joshua Bloch
+ * @since 1.5
+ */
+public enum RetentionPolicy {
+ /**
+ * Annotations are to be discarded by the compiler.
+ */
+ SOURCE,
+
+ /**
+ * Annotations are to be recorded in the class file by the compiler
+ * but need not be retained by the VM at run time. This is the default
+ * behavior.
+ */
+ CLASS,
+
+ /**
+ * Annotations are to be recorded in the class file by the compiler and
+ * retained by the VM at run time, so they may be read reflectively.
+ *
+ * @see java.lang.reflect.AnnotatedElement
+ */
+ RUNTIME
+}
Added: trunk/core/src/openjdk/java/java/lang/annotation/Target.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/annotation/Target.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/annotation/Target.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang.annotation;
+
+/**
+ * Indicates the kinds of program element to which an annotation type
+ * is applicable. If a Target meta-annotation is not present on an
+ * annotation type declaration, the declared type may be used on any
+ * program element. If such a meta-annotation is present, the compiler
+ * will enforce the specified usage restriction.
+ *
+ * For example, this meta-annotation indicates that the declared type is
+ * itself a meta-annotation type. It can only be used on annotation type
+ * declarations:
+ * <pre>
+ * @Target(ElementType.ANNOTATION_TYPE)
+ * public @interface MetaAnnotationType {
+ * ...
+ * }
+ * </pre>
+ * This meta-annotation indicates that the declared type is intended solely
+ * for use as a member type in complex annotation type declarations. It
+ * cannot be used to annotate anything directly:
+ * <pre>
+ * @Target({})
+ * public @interface MemberType {
+ * ...
+ * }
+ * </pre>
+ * It is a compile-time error for a single ElementType constant to
+ * appear more than once in a Target annotation. For example, the
+ * following meta-annotation is illegal:
+ * <pre>
+ * @Target({ElementType.FIELD, ElementType.METHOD, ElementType.FIELD})
+ * public @interface Bogus {
+ * ...
+ * }
+ * </pre>
+ */
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.ANNOTATION_TYPE)
+public @interface Target {
+ ElementType[] value();
+}
Added: trunk/core/src/openjdk/java/java/lang/annotation/package-info.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/annotation/package-info.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/annotation/package-info.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * Provides library support for the Java programming language
+ * annotation facility.
+ *
+ * @version 1.8, 05/05/07
+ * @author Josh Bloch
+ * @since 1.5
+ */
+package java.lang.annotation;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|