@@ -0,0 +1,1903 @@
+package com.kevinquan.android.utils;%0A%0Aimport java.lang.reflect.Field;%0A%0Aimport android.text.TextUtils;%0Aimport android.util.Log;%0A%0A/**%0A * A collection of utilities using reflection%0A * @author Kevin Quan (kevin.quan@gmail.com)%0A *%0A */%0Apublic class ReflectionUtils %7B%0A%0A    private static final String TAG = ReflectionUtils.class.getSimpleName();%0A%0A    /**%0A     * Retrieve an inaccessible field (i.e., private, protected, default visibility) from a class.%0A     * @param object The object to retrieve the field from%0A     * @param fieldName The name of the field%0A     * @return The contents of the field%0A     */%0A    public static Object getHiddenField(Object object, String fieldName) %7B%0A        if (TextUtils.isEmpty(fieldName)) %7B%0A            return null;%0A        %7D%0A        Class%3C? extends Object%3E objectClass = object.getClass();%0A        try %7B%0A            Field hiddenField = null;%0A            boolean terminate = false;%0A            while (!terminate) %7B%0A                try %7B%0A                    // Will throw exception if not found%0A                    hiddenField = objectClass.getDeclaredField(fieldName);%0A                    terminate = true;%0A                %7D catch (NoSuchFieldException nsfe) %7B%0A                    if (objectClass.getSuperclass() != null) %7B%0A                        // Check in parent class%0A                        objectClass = objectClass.getSuperclass();%0A                    %7D else %7B%0A                        // Terminate condition%0A                        terminate = true;%0A                    %7D%0A                %7D%0A            %7D%0A            if (hiddenField != null) %7B%0A                hiddenField.setAccessible(true);%0A                return hiddenField.get(object);%0A            %7D%0A        %7D catch (Exception e) %7B%0A            Log.e(TAG, %22Could not retrieve hidden field: %22+fieldName+%22 in object of class %22+object.getClass() +%22 or its parent classes%22, e);%0A        %7D%0A        return null;%0A    %7D%0A%7D%0A

Add utilities for reflection