public void generateMethods(ClassNode root, FormattedFileWriter writer)
            throws java.io.IOException {
        writer.outputLine("private static native void init();");
        writer.outputLine("private native void releasePeer();");
        writer.newLine(1);
        writer.outputLine("protected void finalize()");
        writer.incTabLevel();
        writer.outputLine("throws Throwable");
        writer.decTabLevel();
        writer.outputLine("{");
        writer.incTabLevel();
        writer.outputLine("releasePeer();");
        writer.decTabLevel();
        writer.outputLine("}");
        writer.newLine(1);
        writer.outputLine("// methods");
        Iterator it = root.getMethods();
        while (it.hasNext() == true) {
            int currentIndex = 0;
            MethodNode node = (MethodNode) it.next();
            String className = node.getReturnType().getFullyQualifiedClassName();
            writer.output("public native " + className + " ");
            writer.output(node.getName() + "(");
            Iterator params = node.getParameterList();
            while (params.hasNext() == true) {
                if (currentIndex != 0) {
                    writer.output(", ");
                }
                ClassNode currentParam = (ClassNode) params.next();
                writer.output(currentParam.getFullyQualifiedClassName());
                writer.output(" p" + currentIndex++);
            }
            writer.outputLine(");");
        }

        writer.newLine(1);
    }