public int getDimensions() {
        if (!isArray()) return 0;

        String name = clazz.getName();
        int pos = name.length() - 2;
        int count = 0;
        while (name.charAt(pos) == '[' ) {
            pos -= 2;
            count++;
        }

        return count;
    }