2 * Licensed under the Apache License, Version 2.0 (the "License");
3 * you may not use this file except in compliance with the License.
4 * You may obtain a copy of the License at
6 * http://www.apache.org/licenses/LICENSE-2.0
8 * Unless required by applicable law or agreed to in writing, software
9 * distributed under the License is distributed on an "AS IS" BASIS,
10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 * See the License for the specific language governing permissions and
12 * limitations under the License.
17 #include "java/lang/Object.h"
18 #include "java/lang/Class.h"
19 #include "java/io/PrintWriter.h"
29 java::lang::Class *PrintWriter::class$ = NULL;
30 jmethodID *PrintWriter::_mids = NULL;
32 jclass PrintWriter::initializeClass()
36 jclass cls = env->findClass("java/io/PrintWriter");
38 _mids = new jmethodID[max_mid];
40 env->getMethodID(cls, "<init>", "(Ljava/io/Writer;)V");
42 class$ = (java::lang::Class *) new JObject(cls);
45 return (jclass) class$->this$;
48 PrintWriter::PrintWriter(Writer writer) : Writer(env->newObject(initializeClass, &_mids, mid__init_, writer.this$)) {
54 #include "structmember.h"
55 #include "functions.h"
61 static int t_PrintWriter_init(t_PrintWriter *self,
62 PyObject *args, PyObject *kwds);
64 static PyMethodDef t_PrintWriter__methods_[] = {
65 { NULL, NULL, 0, NULL }
68 DECLARE_TYPE(PrintWriter, t_PrintWriter, Writer,
69 java::io::PrintWriter, t_PrintWriter_init,
72 static int t_PrintWriter_init(t_PrintWriter *self,
73 PyObject *args, PyObject *kwds)
75 Writer writer((jobject) NULL);
77 if (!parseArgs(args, "j", Writer::class$, &writer))
79 INT_CALL(self->object = PrintWriter(writer));
83 PyErr_SetString(PyExc_ValueError, "invalid args");