f0abceb77ad1ec491a5f3f3a6102c9fc9d11adc9
[cacao.git] / src / native / vm / reflect.h
1 /* src/native/vm/reflect.h - helper functions for java/lang/reflect
2
3    Copyright (C) 2007, 2008
4    CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5
6    This file is part of CACAO.
7
8    This program is free software; you can redistribute it and/or
9    modify it under the terms of the GNU General Public License as
10    published by the Free Software Foundation; either version 2, or (at
11    your option) any later version.
12
13    This program is distributed in the hope that it will be useful, but
14    WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16    General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21    02110-1301, USA.
22
23 */
24
25
26 #ifndef _REFLECT_H
27 #define _REFLECT_H
28
29 #include "config.h"
30
31 #include <stdint.h>
32
33 #include "native/jni.h"
34 #include "native/native.h"
35
36 /* Keep this order of the native includes. */
37
38 #include "native/include/java_lang_String.h"
39
40 #if defined(ENABLE_JAVASE)
41 # if defined(WITH_CLASSPATH_SUN)
42 #  include "native/include/java_nio_ByteBuffer.h"       /* required by j.l.CL */
43 # endif
44 # include "native/include/java_lang_ClassLoader.h"
45 #endif
46
47 #include "native/include/java_lang_Object.h"
48 #include "native/include/java_lang_Class.h"
49
50 #if defined(ENABLE_JAVASE)
51 # include "native/include/java_lang_reflect_Constructor.h"
52 # include "native/include/java_lang_reflect_Field.h"
53 # include "native/include/java_lang_reflect_Method.h"
54 #endif
55
56 #include "vmcore/field.h"
57 #include "vmcore/method.h"
58
59
60 /* function prototypes ********************************************************/
61
62 java_lang_reflect_Constructor *reflect_constructor_new(methodinfo *m);
63 java_lang_reflect_Field       *reflect_field_new(fieldinfo *f);
64 java_lang_reflect_Method      *reflect_method_new(methodinfo *m);
65 java_handle_t                 *reflect_constructor_newinstance(methodinfo *m, java_handle_objectarray_t *args, bool override);
66 java_handle_t                 *reflect_method_invoke(methodinfo *m, java_handle_t *o, java_handle_objectarray_t *args, bool override);
67
68 #if defined(WITH_CLASSPATH_GNU) && defined(ENABLE_ANNOTATIONS)
69 struct java_util_Map* reflect_get_declaredannotatios(
70         java_handle_bytearray_t *annotations,
71         java_lang_Class         *declaringClass,
72         classinfo               *referer);
73
74 java_handle_objectarray_t* reflect_get_parameterannotations(
75         java_handle_t   *parameterAnnotations,
76         int32_t          slot,
77         java_lang_Class *declaringClass,
78         classinfo       *referer);
79 #endif
80
81 #endif /* _REFLECT_H */
82
83
84 /*
85  * These are local overrides for various environment variables in Emacs.
86  * Please do not remove this and leave it at the end of the file, where
87  * Emacs will automagically detect them.
88  * ---------------------------------------------------------------------
89  * Local variables:
90  * mode: c
91  * indent-tabs-mode: t
92  * c-basic-offset: 4
93  * tab-width: 4
94  * End:
95  * vim:noexpandtab:sw=4:ts=4:
96  */