harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r410024 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/
Date Mon, 29 May 2006 05:27:09 GMT
Author: mloenko
Date: Sun May 28 22:27:08 2006
New Revision: 410024

URL: http://svn.apache.org/viewvc?rev=410024&view=rev
Log:
HARMONY-520 patch applied 
([classlib][luni] java.lang.refleft Java 5 updates)

Added:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/AnnotatedElement.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/GenericArrayType.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/GenericSignatureFormatError.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/MalformedParameterizedTypeException.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/ParameterizedType.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/WildcardType.java

Added: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/AnnotatedElement.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/AnnotatedElement.java?rev=410024&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/AnnotatedElement.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/AnnotatedElement.java
Sun May 28 22:27:08 2006
@@ -0,0 +1,78 @@
+/*
+ * 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.reflect;
+
+import java.lang.annotation.Annotation;
+
+/**
+ * <p>
+ * An interface implemented an annotated element to enable reflective access to
+ * annotation information.
+ * </p>
+ * 
+ * @since 1.5
+ */
+public interface AnnotatedElement {
+
+    /**
+     * <p>
+     * Gets the {@link Annotation} for this element for the annotation type
+     * passed, if it exists.
+     * </p>
+     * 
+     * @param annotationType The Class instance of the annotation to search for.
+     * @return The {@link Annotation} for this element or <code>null</code>.
+     * @throws NullPointerException if <code>annotationType</code> is
+     *         <code>null</code>.
+     */
+    <T extends Annotation> T getAnnotation(Class<T> annotationType);
+
+    /**
+     * <p>
+     * Gets all {@link Annotation}s for this element.
+     * </p>
+     * 
+     * @return An array of {@link Annotation}s, which may be empty, but never
+     *         <code>null</code>.
+     */
+    Annotation[] getAnnotations();
+
+    /**
+     * <p>
+     * Gets all {@link Annotation}s that are explicitly declared by this
+     * element (not inherited).
+     * </p>
+     * 
+     * @return An array of {@link Annotation}s, which may be empty, but never
+     *         <code>null</code>.
+     */
+    Annotation[] getDeclaredAnnotations();
+
+    /**
+     * <p>
+     * Determines if this element has an annotation for the annotation type
+     * passed.
+     * </p>
+     * 
+     * @param annotationType The class instance of the annotation to search for.
+     * @return <code>true</code> if the annotation exists, otherwise
+     *         <code>false</code>.
+     * @throws NullPointerException if <code>annotationType</code> is
+     *         <code>null</code>.
+     */
+    boolean isAnnotationPresent(Class<? extends Annotation> annotationType);
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/GenericArrayType.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/GenericArrayType.java?rev=410024&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/GenericArrayType.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/GenericArrayType.java
Sun May 28 22:27:08 2006
@@ -0,0 +1,40 @@
+/*
+ * 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.reflect;
+
+/**
+ * <p>
+ * Represents an array type with a component type that is parameterized or a
+ * type variable.
+ * </p>
+ * 
+ * @since 1.5
+ */
+public interface GenericArrayType extends Type {
+    /**
+     * <p>
+     * The {@link Type} that represents the component type of the array.
+     * </p>
+     * 
+     * @return A {@link Type} instance.
+     * @throws TypeNotPresentException if the component type points to a missing
+     *         type.
+     * @throws MalformedParameterizedTypeException if the component type points
+     *         to a type that can't be instantiated for some reason.
+     */
+    Type getGenericComponentType();
+}
\ No newline at end of file

Added: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/GenericSignatureFormatError.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/GenericSignatureFormatError.java?rev=410024&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/GenericSignatureFormatError.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/GenericSignatureFormatError.java
Sun May 28 22:27:08 2006
@@ -0,0 +1,33 @@
+/*
+ * 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.reflect;
+
+/**
+ * <p>
+ * Indicates that a malformed signature has been encountered via a reflective
+ * method.
+ * </p>
+ * 
+ * @since 1.5
+ */
+public class GenericSignatureFormatError extends ClassFormatError {
+    private static final long serialVersionUID = 6709919147137911034L;
+
+    public GenericSignatureFormatError() {
+        super();
+    }
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/MalformedParameterizedTypeException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/MalformedParameterizedTypeException.java?rev=410024&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/MalformedParameterizedTypeException.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/MalformedParameterizedTypeException.java
Sun May 28 22:27:08 2006
@@ -0,0 +1,36 @@
+/*
+ * 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.reflect;
+
+/**
+ * <p>
+ * Indicates that a malformed parameterized type has been accessed by a
+ * reflected method.
+ * </p>
+ * 
+ * @since 1.5
+ */
+public class MalformedParameterizedTypeException extends RuntimeException {
+    private static final long serialVersionUID = -5696557788586220964L;
+
+    /**
+     * <p>Constructs an instance.</p>
+     */
+    public MalformedParameterizedTypeException() {
+        super();
+    }
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/ParameterizedType.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/ParameterizedType.java?rev=410024&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/ParameterizedType.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/ParameterizedType.java
Sun May 28 22:27:08 2006
@@ -0,0 +1,62 @@
+/*
+ * 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.reflect;
+
+/**
+ * <p>
+ * Represents a parameterized type.
+ * </p>
+ * 
+ * @since 1.5
+ */
+public interface ParameterizedType extends Type {
+    /**
+     * <p>
+     * Gets the type arguments for this type.
+     * </p>
+     * 
+     * @return An array of {@link Type}, which may be empty.
+     * @throws TypeNotPresentException if one of the type arguments can't be
+     *         found.
+     * @throws MalformedParameterizedTypeException if one of the type arguments
+     *         can't be instantiated for some reason.
+     */
+    Type[] getActualTypeArguments();
+
+    /**
+     * <p>
+     * Gets the parent/owner type, if this type is an inner type, otherwise
+     * <code>null</code> is returned if this is a top-level type.
+     * </p>
+     * 
+     * @return An instance of {@link Type} or <code>null</code>.
+     * @throws TypeNotPresentException if one of the type arguments can't be
+     *         found.
+     * @throws MalformedParameterizedTypeException if one of the type arguments
+     *         can't be instantiated for some reason.
+     */
+    Type getOwnerType();
+
+    /**
+     * <p>
+     * Gets the raw type of this type.
+     * </p>
+     * 
+     * @return An instance of {@link Type}.
+     */
+    Type getRawType();
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/WildcardType.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/WildcardType.java?rev=410024&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/WildcardType.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/reflect/WildcardType.java
Sun May 28 22:27:08 2006
@@ -0,0 +1,56 @@
+/*
+ * 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.reflect;
+
+/**
+ * <p>
+ * Represents a wildcard type, such as <code>?</code> or
+ * <code>? extends Comparable</code>.
+ * </p>
+ * 
+ * @since 1.5
+ */
+public interface WildcardType extends Type {
+    /**
+     * <p>
+     * Gets the array of types that represent the upper bounds of this type. The
+     * default upper bound is {@link Object}.
+     * </p>
+     * 
+     * @return An array of {@link Type} instances.
+     * @throws TypeNotPresentException if the component type points to a missing
+     *         type.
+     * @throws MalformedParameterizedTypeException if the component type points
+     *         to a type that can't be instantiated for some reason.
+     */
+    Type[] getUpperBounds();
+
+    /**
+     * <p>
+     * Gets the array of types that represent the lower bounds of this type. The
+     * default lower bound is <code>null</code>, in which case a empty array
+     * is returned.
+     * </p>
+     * 
+     * @return An array of {@link Type} instances.
+     * @throws TypeNotPresentException if the component type points to a missing
+     *         type.
+     * @throws MalformedParameterizedTypeException if the component type points
+     *         to a type that can't be instantiated for some reason.
+     */
+    Type[] getLowerBounds();
+}



Mime
View raw message