author | jfranck |
Tue, 29 Jan 2013 10:32:49 +0100 | |
changeset 15510 | 898d924a7efd |
parent 5506 | 202f599c92aa |
permissions | -rw-r--r-- |
2 | 1 |
/* |
15510
898d924a7efd
8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
5506
diff
changeset
|
2 |
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package sun.reflect; |
|
27 |
||
28 |
import java.lang.reflect.*; |
|
29 |
||
30 |
/** An interface which gives privileged packages Java-level access to |
|
31 |
internals of java.lang.reflect. */ |
|
32 |
||
33 |
public interface LangReflectAccess { |
|
34 |
/** Creates a new java.lang.reflect.Field. Access checks as per |
|
35 |
java.lang.reflect.AccessibleObject are not overridden. */ |
|
3959
05a07c0a273b
5062288: (reflect) Core reflection uses raw types when it could be using wildcards
darcy
parents:
2
diff
changeset
|
36 |
public Field newField(Class<?> declaringClass, |
2 | 37 |
String name, |
3959
05a07c0a273b
5062288: (reflect) Core reflection uses raw types when it could be using wildcards
darcy
parents:
2
diff
changeset
|
38 |
Class<?> type, |
2 | 39 |
int modifiers, |
40 |
int slot, |
|
41 |
String signature, |
|
42 |
byte[] annotations); |
|
43 |
||
44 |
/** Creates a new java.lang.reflect.Method. Access checks as per |
|
45 |
java.lang.reflect.AccessibleObject are not overridden. */ |
|
3959
05a07c0a273b
5062288: (reflect) Core reflection uses raw types when it could be using wildcards
darcy
parents:
2
diff
changeset
|
46 |
public Method newMethod(Class<?> declaringClass, |
2 | 47 |
String name, |
3959
05a07c0a273b
5062288: (reflect) Core reflection uses raw types when it could be using wildcards
darcy
parents:
2
diff
changeset
|
48 |
Class<?>[] parameterTypes, |
05a07c0a273b
5062288: (reflect) Core reflection uses raw types when it could be using wildcards
darcy
parents:
2
diff
changeset
|
49 |
Class<?> returnType, |
05a07c0a273b
5062288: (reflect) Core reflection uses raw types when it could be using wildcards
darcy
parents:
2
diff
changeset
|
50 |
Class<?>[] checkedExceptions, |
2 | 51 |
int modifiers, |
52 |
int slot, |
|
53 |
String signature, |
|
54 |
byte[] annotations, |
|
55 |
byte[] parameterAnnotations, |
|
56 |
byte[] annotationDefault); |
|
57 |
||
58 |
/** Creates a new java.lang.reflect.Constructor. Access checks as |
|
59 |
per java.lang.reflect.AccessibleObject are not overridden. */ |
|
60 |
public <T> Constructor<T> newConstructor(Class<T> declaringClass, |
|
3959
05a07c0a273b
5062288: (reflect) Core reflection uses raw types when it could be using wildcards
darcy
parents:
2
diff
changeset
|
61 |
Class<?>[] parameterTypes, |
05a07c0a273b
5062288: (reflect) Core reflection uses raw types when it could be using wildcards
darcy
parents:
2
diff
changeset
|
62 |
Class<?>[] checkedExceptions, |
2 | 63 |
int modifiers, |
64 |
int slot, |
|
65 |
String signature, |
|
66 |
byte[] annotations, |
|
67 |
byte[] parameterAnnotations); |
|
68 |
||
69 |
/** Gets the MethodAccessor object for a java.lang.reflect.Method */ |
|
70 |
public MethodAccessor getMethodAccessor(Method m); |
|
71 |
||
72 |
/** Sets the MethodAccessor object for a java.lang.reflect.Method */ |
|
73 |
public void setMethodAccessor(Method m, MethodAccessor accessor); |
|
74 |
||
75 |
/** Gets the ConstructorAccessor object for a |
|
76 |
java.lang.reflect.Constructor */ |
|
3959
05a07c0a273b
5062288: (reflect) Core reflection uses raw types when it could be using wildcards
darcy
parents:
2
diff
changeset
|
77 |
public ConstructorAccessor getConstructorAccessor(Constructor<?> c); |
2 | 78 |
|
79 |
/** Sets the ConstructorAccessor object for a |
|
80 |
java.lang.reflect.Constructor */ |
|
3959
05a07c0a273b
5062288: (reflect) Core reflection uses raw types when it could be using wildcards
darcy
parents:
2
diff
changeset
|
81 |
public void setConstructorAccessor(Constructor<?> c, |
2 | 82 |
ConstructorAccessor accessor); |
83 |
||
15510
898d924a7efd
8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
5506
diff
changeset
|
84 |
/** Gets the byte[] that encodes TypeAnnotations on an Executable. */ |
898d924a7efd
8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
5506
diff
changeset
|
85 |
public byte[] getExecutableTypeAnnotationBytes(Executable ex); |
898d924a7efd
8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
5506
diff
changeset
|
86 |
|
2 | 87 |
/** Gets the "slot" field from a Constructor (used for serialization) */ |
3959
05a07c0a273b
5062288: (reflect) Core reflection uses raw types when it could be using wildcards
darcy
parents:
2
diff
changeset
|
88 |
public int getConstructorSlot(Constructor<?> c); |
2 | 89 |
|
90 |
/** Gets the "signature" field from a Constructor (used for serialization) */ |
|
3959
05a07c0a273b
5062288: (reflect) Core reflection uses raw types when it could be using wildcards
darcy
parents:
2
diff
changeset
|
91 |
public String getConstructorSignature(Constructor<?> c); |
2 | 92 |
|
93 |
/** Gets the "annotations" field from a Constructor (used for serialization) */ |
|
3959
05a07c0a273b
5062288: (reflect) Core reflection uses raw types when it could be using wildcards
darcy
parents:
2
diff
changeset
|
94 |
public byte[] getConstructorAnnotations(Constructor<?> c); |
2 | 95 |
|
96 |
/** Gets the "parameterAnnotations" field from a Constructor (used for serialization) */ |
|
3959
05a07c0a273b
5062288: (reflect) Core reflection uses raw types when it could be using wildcards
darcy
parents:
2
diff
changeset
|
97 |
public byte[] getConstructorParameterAnnotations(Constructor<?> c); |
2 | 98 |
|
99 |
// |
|
100 |
// Copying routines, needed to quickly fabricate new Field, |
|
101 |
// Method, and Constructor objects from templates |
|
102 |
// |
|
103 |
||
104 |
/** Makes a "child" copy of a Method */ |
|
105 |
public Method copyMethod(Method arg); |
|
106 |
||
107 |
/** Makes a "child" copy of a Field */ |
|
108 |
public Field copyField(Field arg); |
|
109 |
||
110 |
/** Makes a "child" copy of a Constructor */ |
|
111 |
public <T> Constructor<T> copyConstructor(Constructor<T> arg); |
|
112 |
} |