public static String getJNIType()

in modules/jdktools/src/main/java/org/apache/harmony/tools/javah/ClazzMethod.java [259:303]


    public static String getJNIType(Type type) {
        StringBuffer result = new StringBuffer();

        String suffix = "";
        if (type instanceof ArrayType) {
            suffix = "Array";
            type = ((ArrayType) type).getElementType();
        }

        if (type instanceof ObjectType) {
            String objectType = "jobject";
            // The suffix length is 0 only if the given type is not an array.
            if (suffix.length() == 0) {
                if (type.equals(Type.STRING)) {
                    objectType = "jstring";
                } else if (type.equals(Type.THROWABLE)) {
                    objectType = "jthrowable";
                } else if (((ObjectType) type).getClassName()
                        .equals("java.lang.Class")) {
                    objectType = "jclass";
                }
            }
            result.append(objectType);
        } else if (type == Type.INT) {
            result.append("jint");
        } else if (type == Type.BYTE) {
            result.append("jbyte");
        } else if (type == Type.LONG) {
            result.append("jlong");
        } else if (type == Type.FLOAT) {
            result.append("jfloat");
        } else if (type == Type.DOUBLE) {
            result.append("jdouble");
        } else if (type == Type.SHORT) {
            result.append("jshort");
        } else if (type == Type.CHAR) {
            result.append("jchar");
        } else if (type == Type.BOOLEAN) {
            result.append("jboolean");
        } else if (type == Type.VOID) {
            result.append("void");
        }

        return result.append(suffix).toString();
    }