harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r409579 - in /incubator/harmony/enhanced/classlib/trunk: depends/jars/ make/ modules/annotation/ modules/annotation/META-INF/ modules/annotation/make/ modules/annotation/make/common/ modules/annotation/src/ modules/annotation/src/main/ modu...
Date Fri, 26 May 2006 07:43:52 GMT
Author: mloenko
Date: Fri May 26 00:43:51 2006
New Revision: 409579

URL: http://svn.apache.org/viewvc?rev=409579&view=rev
Log:
integration of java.lang.annotation classes and infrastructure from HARMONY-513

Added:
    incubator/harmony/enhanced/classlib/trunk/modules/annotation/   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/annotation/META-INF/
    incubator/harmony/enhanced/classlib/trunk/modules/annotation/META-INF/MANIFEST.MF
    incubator/harmony/enhanced/classlib/trunk/modules/annotation/make/
    incubator/harmony/enhanced/classlib/trunk/modules/annotation/make/build.xml
    incubator/harmony/enhanced/classlib/trunk/modules/annotation/make/common/
    incubator/harmony/enhanced/classlib/trunk/modules/annotation/make/common/build.xml
    incubator/harmony/enhanced/classlib/trunk/modules/annotation/make/common/hyproperties.xml
    incubator/harmony/enhanced/classlib/trunk/modules/annotation/make/patternset.txt
    incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/
    incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/
    incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/
    incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/
    incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/
    incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/
    incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/Annotation.java
    incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/AnnotationFormatError.java
    incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/AnnotationTypeMismatchException.java
    incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/ElementType.java
    incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/IncompleteAnnotationException.java
    incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/RetentionPolicy.java
    incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/test/
    incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/test/java/
Modified:
    incubator/harmony/enhanced/classlib/trunk/depends/jars/   (props changed)
    incubator/harmony/enhanced/classlib/trunk/make/build-java.xml
    incubator/harmony/enhanced/classlib/trunk/make/build-test.xml

Propchange: incubator/harmony/enhanced/classlib/trunk/depends/jars/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri May 26 00:43:51 2006
@@ -1,6 +1,8 @@
+
 junit_3.8.1
 xalan-j_2.6.0
 xerces_2.6.2
 bcprov-jdk14-131
 bcprov-jdk14-132
 icu4j_3.4.4
+bcprov-jdk14-133

Modified: incubator/harmony/enhanced/classlib/trunk/make/build-java.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/make/build-java.xml?rev=409579&r1=409578&r2=409579&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/make/build-java.xml (original)
+++ incubator/harmony/enhanced/classlib/trunk/make/build-java.xml Fri May 26 00:43:51 2006
@@ -82,6 +82,7 @@
         <mkdir dir="${build.output}" />
 
         <javac destdir="${build.output}" source="${hy.javac.source}" target="${hy.javac.target}"
debug="on">
+            <src path="modules/annotation/src/main/java/" />
             <src path="modules/applet/src/main/java" />
             <src path="modules/archive/src/main/java" />
             <src path="modules/auth/src/main/java/${hy.os}" />

Modified: incubator/harmony/enhanced/classlib/trunk/make/build-test.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/make/build-test.xml?rev=409579&r1=409578&r2=409579&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/make/build-test.xml (original)
+++ incubator/harmony/enhanced/classlib/trunk/make/build-test.xml Fri May 26 00:43:51 2006
@@ -36,11 +36,20 @@
 
 	<!-- this list of components to test will grow to eventually be all modules -->
 	<target name="test-all"
-		depends="clean, test-archive, test-auth, test-beans, test-crypto, test-jndi, test-logging,
test-luni, test-math, test-nio, test-nio_char, test-prefs, test-regex, test-security, test-sql,
test-text, test-xnet, gen-report, check-test-result">
+		depends="clean, test-annotation, test-archive, test-auth, test-beans, test-crypto, test-jndi,
test-logging, test-luni, test-math, test-nio, test-nio_char, test-prefs, test-regex, test-security,
test-sql, test-text, test-xnet, gen-report, check-test-result">
 	</target>
 
 	<target name="clean">
 		<delete dir="${tests.output}" />
+	</target>
+
+	<target name="test-annotation" depends="compile-support">
+        <echo message="=================================="/>
+        <echo message="Running tests for module annotation"/>
+        <echo message="=================================="/>
+
+        <ant antfile="make/build.xml" dir="modules/annotation" target="test" />
+
 	</target>
 
 	<target name="test-luni" depends="compile-support">

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/annotation/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri May 26 00:43:51 2006
@@ -0,0 +1,2 @@
+
+bin

Added: incubator/harmony/enhanced/classlib/trunk/modules/annotation/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/annotation/META-INF/MANIFEST.MF?rev=409579&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/annotation/META-INF/MANIFEST.MF (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/annotation/META-INF/MANIFEST.MF Fri
May 26 00:43:51 2006
@@ -0,0 +1,10 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Harmony Annotation
+Bundle-SymbolicName: org.apache.harmony.annotation
+Bundle-Version: 1.0.0
+Bundle-ClassPath: .
+Eclipse-JREBundle: true
+Import-Package: 
+ java.lang,
+Export-Package: java.lang.annotation

Added: incubator/harmony/enhanced/classlib/trunk/modules/annotation/make/build.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/annotation/make/build.xml?rev=409579&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/annotation/make/build.xml (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/annotation/make/build.xml Fri May 26
00:43:51 2006
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Copyright 2005, 2006 The Apache Software Foundation or its licensors, as applicable.
+  
+    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.
+-->
+
+<project name="ANNOTATION Build" default="build" basedir="..">
+    <description>Build for ANNOTATION component</description>
+
+    <!-- import common properties -->
+    <import file="${basedir}/../../make/properties.xml" />
+
+    <!-- set global properties for this build. -->
+    <xmlproperty file="make/common/hyproperties.xml" semanticAttributes="true" />
+    <!-- Set build.compiler to "org.eclipse.jdt.core.JDTCompilerAdapter" to
+	     use the Eclipse Java compiler. But it does not support jsr14 target -->
+    <property name="build.compiler" value="modern" />
+
+    <target name="init">
+        <tstamp>
+            <format property="build-date" pattern="yyyyMMdd" locale="en" />
+        </tstamp>
+        <tstamp>
+            <format property="build-time" pattern="yyyyMMdd_HHmm" />
+        </tstamp>
+        <echo message="build-date=${build-date}" />
+        <echo message="build-time=${build-time}" />
+        <echo message="on platform=${os.name} version=${os.version} arch=${os.arch}" />
+
+        <property name="java.debug.option" value="on" />
+        <property name="native.debug.option" value="on" />
+
+    </target>
+
+    <!-- ANNOTATION TARGETS -->
+
+    <target name="build" depends="init">
+        <ant dir="make/common" target="compile.java" />
+        <ant dir="make/common" target="build.jar" />
+        <ant dir="make/common" target="copy.resources" />
+    </target>
+
+
+    <target name="test" depends="build">
+        <ant dir="make/common" target="compile.tests" />
+        <ant dir="make/common" target="run.tests" />
+    </target>
+
+    <target name="clean">
+        <delete dir="${hy.annotation.bin.main}" />
+        <delete dir="${hy.annotation.bin.test}" />
+    </target>
+
+</project>

Added: incubator/harmony/enhanced/classlib/trunk/modules/annotation/make/common/build.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/annotation/make/common/build.xml?rev=409579&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/annotation/make/common/build.xml (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/annotation/make/common/build.xml Fri
May 26 00:43:51 2006
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Copyright 2006 The Apache Software Foundation or its licensors, as applicable.
+  
+    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.
+-->
+
+<project name="Common_ANNOTATION_Build">
+
+    <target name="compile.java" description="Compile ANNOTATION java code">
+        <echo message="Compiling ANNOTATION classes from ${hy.annotation.src.main.java}"
/>
+
+        <mkdir dir="${hy.build}" />
+
+        <javac sourcepath=""
+            srcdir="${hy.annotation.src.main.java}"
+            destdir="${hy.build}"
+            source="${hy.javac.source}"
+            target="${hy.javac.target}"
+            debug="${java.debug.option}">
+
+            <bootclasspath>
+                <fileset dir="${hy.target}/jre/lib/boot">
+                    <include name="**/*.jar" />
+                </fileset>
+            </bootclasspath>
+        </javac>
+    </target>
+
+    <target name="build.jar">
+        <jar destfile="${hy.target}/jre/lib/boot/${hy.annotation.packaging.jarname}.jar"
+             manifest="${hy.annotation}/META-INF/MANIFEST.MF">
+            <fileset dir="${hy.build}"
+                     includesfile="${hy.annotation}/make/patternset.txt" />
+        </jar>
+    </target>
+
+
+    <target name="compile.tests">
+        <echo message="Compiling ANNOTATION tests from ${hy.annotation.src.test.java}"
/>
+
+        <mkdir dir="${hy.annotation.bin.test}" />
+
+        <javac srcdir="${hy.annotation.src.test.java}"
+            destdir="${hy.annotation.bin.test}"
+            sourcepath=""
+            source="${hy.javac.source}"
+            target="${hy.javac.target}"
+            debug="${java.debug.option}">
+
+            <bootclasspath>
+                <fileset dir="${hy.target}/jre/lib/boot">
+                    <include name="**/*.jar" />
+                </fileset>
+            </bootclasspath>
+            <classpath location="../../../../build/tests" />
+        </javac>
+    </target>
+
+
+    <target name="run.tests">
+
+        <mkdir dir="${hy.tests.reports}" />
+
+        <property name="test.jre.home" value="${hy.target}/jre" />
+
+        <junit fork="yes"
+            forkmode="once"
+            printsummary="withOutAndErr"
+            errorproperty="test.errors"
+            failureproperty="test.failures"
+            showoutput="on"
+            dir="${hy.annotation.bin.test}"
+            jvm="${test.jre.home}/bin/java">
+
+            <jvmarg value="-showversion"/>
+
+            <env key="JAVA_HOME" value="${test.jre.home}"/>
+
+            <classpath>
+                <pathelement path="${hy.annotation.bin.test}"/>
+            </classpath>
+
+            <formatter type="xml" />
+
+            <test name="${test.case}" todir="${hy.tests.reports}" if="test.case" />
+            <batchtest todir="${hy.tests.reports}" haltonfailure="no"
+                unless="test.case">
+
+                <fileset dir="${hy.annotation.src.test.java}"/>
+            </batchtest>
+        </junit>
+        <antcall target="touch-failures-file" />
+        <antcall target="touch-errors-file" />
+    </target>
+
+    <target name="touch-failures-file" if="test.failures">
+        <echo file="${hy.tests.reports}/test.failures"
+            append="true" >annotation
+</echo>
+    </target>
+    <target name="touch-errors-file" if="test.errors">
+        <echo file="${hy.tests.reports}/test.errors"
+            append="true" >annotation
+</echo>
+    </target>
+
+    <target name="copy.resources">
+        <!-- Nothing for ANNOTATION -->
+    </target>
+</project>
+

Added: incubator/harmony/enhanced/classlib/trunk/modules/annotation/make/common/hyproperties.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/annotation/make/common/hyproperties.xml?rev=409579&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/annotation/make/common/hyproperties.xml
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/annotation/make/common/hyproperties.xml
Fri May 26 00:43:51 2006
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Copyright 2006 The Apache Software Foundation or its licensors, as applicable.
+  
+    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.
+-->
+
+<hy>
+   <annotation location=".">
+      <src>
+         <main>
+            <java location="src/main/java" />
+        	<resources location="src/main/resources" />
+         </main>
+         <test>
+            <java location="src/test/java" />
+            <resources location="src/test/resources" />
+         </test>
+         <natives location="src/natives" />
+      </src>
+      <bin>
+        <main location="bin/main" />
+        <test location="bin/test" />
+      </bin>
+      <packaging>
+        <jarname>annotation</jarname>
+      </packaging>
+   </annotation>
+
+   <target location="../../deploy" />
+   <build location="../../build" />
+
+   <tests>
+      <reports location="../../build/test_report" />
+   </tests>
+</hy>

Added: incubator/harmony/enhanced/classlib/trunk/modules/annotation/make/patternset.txt
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/annotation/make/patternset.txt?rev=409579&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/annotation/make/patternset.txt (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/annotation/make/patternset.txt Fri May
26 00:43:51 2006
@@ -0,0 +1,15 @@
+# Copyright 2006 The Apache Software Foundation or its licensors, as applicable
+# 
+# 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.
+ 
+java/lang/annotation/*

Added: incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/Annotation.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/Annotation.java?rev=409579&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/Annotation.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/Annotation.java
Fri May 26 00:43:51 2006
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * 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 java.lang.annotation;
+
+/**
+ * <p>
+ * The interface implemented by all annotations. This interface is NOT an
+ * annotation itself and any interface that extends this one is NOT an
+ * annotation either.
+ * </p>
+ * 
+ * @since 1.5
+ */
+public interface Annotation {
+
+    /**
+     * <p>
+     * Returns the type of this annotation.
+     * </p>
+     * 
+     * @return A Class instance.
+     */
+    Class<? extends Annotation> annotationType();
+
+    /**
+     * <p>
+     * Determines whether or not this annotation is equivalent to the annotation
+     * passed.
+     * </p>
+     * 
+     * @param obj The object to compare to.
+     * @return <code>true</code> if <code>obj</code> is equal to
this,
+     *         otherwise <code>false</code>.
+     */
+    boolean equals(Object obj);
+
+    /**
+     * <p>
+     * Returns the hash value of this annotation.
+     * </p>
+     * 
+     * @return The hash value.
+     */
+    int hashCode();
+
+    /**
+     * <p>
+     * Returns a String representation of this annotation.
+     * </p>
+     * 
+     * @return The String that represents this annotation.
+     */
+    String toString();
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/AnnotationFormatError.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/AnnotationFormatError.java?rev=409579&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/AnnotationFormatError.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/AnnotationFormatError.java
Fri May 26 00:43:51 2006
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * 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 java.lang.annotation;
+
+/**
+ * <p>
+ * Indicates that an annotation in a class file is incorrectly formatted.
+ * </p>
+ * 
+ * @since 1.5
+ */
+public class AnnotationFormatError extends Error {
+
+    private static final long serialVersionUID = -4256701562333669892L;
+
+    /**
+     * <p>
+     * Constructs an instance with the message provided.
+     * </p>
+     * 
+     * @param message The details of the error.
+     */
+    public AnnotationFormatError(String message) {
+        super(message);
+    }
+
+    /**
+     * <p>
+     * Constructs an instance with a message and a cause.
+     * </p>
+     * 
+     * @param message The details of the error.
+     * @param cause The cause of the error or <code>null</code> if none.
+     */
+    public AnnotationFormatError(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    /**
+     * <p>
+     * Constructs an instance with a cause. If the cause is NOT
+     * <code>null</code>, then <code>cause.toString()</code> is used
as the
+     * error's message.
+     * </p>
+     * 
+     * @param cause The cause of the error or <code>null</code> if none.
+     */
+    public AnnotationFormatError(Throwable cause) {
+        super(cause == null ? null : cause.toString(), cause);
+    }
+
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/AnnotationTypeMismatchException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/AnnotationTypeMismatchException.java?rev=409579&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/AnnotationTypeMismatchException.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/AnnotationTypeMismatchException.java
Fri May 26 00:43:51 2006
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * 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 java.lang.annotation;
+
+import java.lang.reflect.Method;
+
+/**
+ * <p>
+ * Indicates that an annotation type has changed since it was compiled or
+ * serialized.
+ * </p>
+ * 
+ * @since 1.5
+ */
+public class AnnotationTypeMismatchException extends RuntimeException {
+
+    private static final long serialVersionUID = 8125925355765570191L;
+
+    private Method element;
+
+    private String foundType;
+
+    /**
+     * <p>
+     * Constructs an instance for the given type element and the type found.
+     * </p>
+     * 
+     * @param element The annotation type element.
+     * @param foundType The invalid type that was found.
+     */
+    public AnnotationTypeMismatchException(Method element, String foundType) {
+        super("The annotation element, " + element
+                + ", doesn't match the type " + foundType + ".");
+        this.element = element;
+        this.foundType = foundType;
+    }
+
+    /**
+     * <p>
+     * The method object for the invalid type.
+     * </p>
+     * 
+     * @return A {@link Method} instance.
+     */
+    public Method element() {
+        return element;
+    }
+
+    /**
+     * <p>
+     * The invalid type.
+     * </p>
+     * 
+     * @return A String describing the invalid data.
+     */
+    public String foundType() {
+        return foundType;
+    }
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/ElementType.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/ElementType.java?rev=409579&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/ElementType.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/ElementType.java
Fri May 26 00:43:51 2006
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * 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 java.lang.annotation;
+
+/**
+ * <p>
+ * An enumeration of element types.
+ * </p>
+ * 
+ * @since 1.5
+ */
+public enum ElementType {
+    /**
+     * <p>
+     * Class, interface or enum declaration.
+     * </p>
+     */
+    TYPE,
+    /**
+     * <p>
+     * Field declaration.
+     * </p>
+     */
+    FIELD,
+    /**
+     * <p>
+     * Method declaration.
+     * </p>
+     */
+    METHOD,
+    /**
+     * <p>
+     * Parameter declaration.
+     * </p>
+     */
+    PARAMETER,
+    /**
+     * <p>
+     * Constructor declaration.
+     * </p>
+     */
+    CONSTRUCTOR,
+    /**
+     * <p>
+     * Local variable declaration.
+     * </p>
+     */
+    LOCAL_VARIABLE,
+    /**
+     * <p>
+     * Annotation type declaration.
+     * </p>
+     */
+    ANNOTATION_TYPE,
+    /**
+     * <p>
+     * Package declaration.
+     * </p>
+     */
+    PACKAGE
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/IncompleteAnnotationException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/IncompleteAnnotationException.java?rev=409579&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/IncompleteAnnotationException.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/IncompleteAnnotationException.java
Fri May 26 00:43:51 2006
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * 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 java.lang.annotation;
+
+/**
+ * <p>
+ * Indicates that an element of an annotation type was accessed that was added
+ * after the type was compiled or serialized. This does not apply to new
+ * elements that have default values.
+ * </p>
+ * 
+ * @since 1.5
+ */
+public class IncompleteAnnotationException extends RuntimeException {
+
+    private static final long serialVersionUID = 8445097402741811912L;
+
+    private Class<? extends Annotation> annotationType;
+
+    private String elementName;
+
+    /**
+     * <p>
+     * Constructs an instance with the incomplete annotation type and the name
+     * of the element that's missing.
+     * </p>
+     * 
+     * @param annotationType The annotation type.
+     * @param elementName The name of the incomplete element.
+     */
+    public IncompleteAnnotationException(
+            Class<? extends Annotation> annotationType, String elementName) {
+        super("The element, " + elementName
+                + ", is not complete for the annotation " + annotationType
+                + ".");
+        this.annotationType = annotationType;
+        this.elementName = elementName;
+    }
+
+    /**
+     * <p>
+     * The annotation type.
+     * </p>
+     * 
+     * @return A Class instance.
+     */
+    public Class<? extends Annotation> annotationType() {
+        return annotationType;
+    }
+
+    /**
+     * <p>
+     * The incomplete element's name.
+     * </p>
+     * 
+     * @return The name of the element.
+     */
+    public String elementName() {
+        return elementName;
+    }
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/RetentionPolicy.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/RetentionPolicy.java?rev=409579&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/RetentionPolicy.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/annotation/src/main/java/java/lang/annotation/RetentionPolicy.java
Fri May 26 00:43:51 2006
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * 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 java.lang.annotation;
+
+/**
+ * <p>
+ * An enumeration for annotation retention policies.
+ * </p>
+ * 
+ * @since 1.5
+ */
+public enum RetentionPolicy {
+    /**
+     * <p>
+     * Annotation is only available in the source code.
+     * </p>
+     */
+    SOURCE,
+    /**
+     * <p>
+     * Annotation is available in the source code and in the class file, but not
+     * at runtime. This is the default policy.
+     * </p>
+     */
+    CLASS,
+    /**
+     * <p>
+     * Annotation is available in the source code, the class file and is
+     * available at runtime.
+     * </p>
+     */
+    RUNTIME
+}



Mime
View raw message