// Path: adapter_enhance/src/main/java/org/studio/maizi/ripened/IAdapter.java
// public interface IAdapter extends IPlugin {
// 
//     /**
//      * the name of this plugin.
//      */
//     String NAME = "Adapter";
// 
//     /**
//      * set the adapter
//      *
//      * @param obj               may be an instance of activity|fragment|hodler
//      * @param adapter           the adapter
//      * @param field             current field scanning
//      * @param cls               the class of current obj,in case current runtime.
//      * @param adapter_listeners additional params, when your class of listener have no empty-parameter constructor, you should pass the listener object manually...
//      */
//     void setAdapter(Object obj, Object adapter, Field field, Class<?> cls, Object... adapter_listeners);
// }
// 
// Path: ripened/src/main/java/org/studio/maizi/ripened/dto/ActionParams.java
// public class ActionParams {
//     /**
//      * an instance of activity or fragment or holder of an adapter.
//      */
//     private Object obj;
//     /**
//      * when the init param start with an adapter,this object is adapter for transfer.
//      */
//     private Object transfer;
//     /**
//      * the field current scanning.
//      */
//     private Field field;
//     /**
//      * the ResId's value of which field current scanning with the annotation of ResId
//      */
//     private int resId;
//     /**
//      * the holder of an adapter.
//      */
//     private Object holder;
//     /**
//      * all the listeners.
//      */
//     private Object[] listeners;
// 
//     public ActionParams(Object obj, Object transfer, Field field, int resId, Object holder, Object[] listeners) {
//         this.obj = obj;
//         this.transfer = transfer;
//         this.field = field;
//         this.resId = resId;
//         this.holder = holder;
//         this.listeners = listeners;
//     }
// 
//     public Object getObj() {
//         return obj;
//     }
// 
//     public void setObj(Object obj) {
//         this.obj = obj;
//     }
// 
//     public Object getTransfer() {
//         return transfer;
//     }
// 
//     public void setTransfer(Object transfer) {
//         this.transfer = transfer;
//     }
// 
//     public Field getField() {
//         return field;
//     }
// 
//     public void setField(Field field) {
//         this.field = field;
//     }
// 
//     public int getResId() {
//         return resId;
//     }
// 
//     public void setResId(int resId) {
//         this.resId = resId;
//     }
// 
//     public Object getHolder() {
//         return holder;
//     }
// 
//     public void setHolder(Object holder) {
//         this.holder = holder;
//     }
// 
//     public Object[] getListeners() {
//         return listeners;
//     }
// 
//     public void setListeners(Object[] listeners) {
//         this.listeners = listeners;
//     }
// }
// 
// Path: ripened/src/main/java/org/studio/maizi/ripened/exception/VIRuntimeException.java
// public class VIRuntimeException extends RuntimeException {
// 
//     public VIRuntimeException(String detailMessage) { super(detailMessage); }
// 
//     public VIRuntimeException(String detailMessage, Throwable throwable) { super(detailMessage, throwable); }
// }
// 
// Path: ripened/src/main/java/org/studio/maizi/ripened/util/StringFormatter.java
// public class StringFormatter {
// 
//     /**
//      * format the string.
//      * @param str the string which will be format
//      * @param obj the object which match each place with it's turn.
//      * @return the string formatted
//      */
//     public static String format(String str, Object... obj) {
//         return new Formatter().format(str, obj).toString();
//     }
// }


import org.studio.maizi.ripened.IAdapter;
import org.studio.maizi.ripened.dto.ActionParams;
import org.studio.maizi.ripened.exception.VIRuntimeException;
import org.studio.maizi.ripened.util.StringFormatter;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import android.widget.AdapterView;
                    break;
                }
            }
            if (constructor == null)
                throw new InstantiationException(StringFormatter.format(INSTACE_ERROR, field.toString(), cls.getSimpleName()));
            if (paramsLen == 0)
                target = constructor.newInstance();
            else if (paramsLen == 1)
                target = constructor.newInstance(obj);
            AdapterView.class.cast(field.get(obj)).setAdapter(android.widget.Adapter.class.cast(target));
        } catch (IllegalAccessException e) {
            //can't reach
            e.printStackTrace();
        } catch (InstantiationException e) {//represent no matching empty-constructor,attempt to find instance obj pass by user manually.
            boolean isFind = false;
            android.widget.Adapter target = null;
            for (Object object : adapter_listeners) {
                if (object instanceof android.widget.Adapter) {
                    target = android.widget.Adapter.class.cast(object);
                    try {
                        AdapterView.class.cast(field.get(obj)).setAdapter(target);
                    } catch (IllegalAccessException e1) {
                        //can't reach
                        e1.printStackTrace();
                    }
                    isFind = true;
                    break;
                }
            }
            if (!isFind)
// Path: adapter_enhance/src/main/java/org/studio/maizi/ripened/IAdapter.java
// public interface IAdapter extends IPlugin {
// 
//     /**
//      * the name of this plugin.
//      */
//     String NAME = "Adapter";
// 
//     /**
//      * set the adapter
//      *
//      * @param obj               may be an instance of activity|fragment|hodler
//      * @param adapter           the adapter
//      * @param field             current field scanning
//      * @param cls               the class of current obj,in case current runtime.
//      * @param adapter_listeners additional params, when your class of listener have no empty-parameter constructor, you should pass the listener object manually...
//      */
//     void setAdapter(Object obj, Object adapter, Field field, Class<?> cls, Object... adapter_listeners);
// }
// 
// Path: ripened/src/main/java/org/studio/maizi/ripened/dto/ActionParams.java
// public class ActionParams {
//     /**
//      * an instance of activity or fragment or holder of an adapter.
//      */
//     private Object obj;
//     /**
//      * when the init param start with an adapter,this object is adapter for transfer.
//      */
//     private Object transfer;
//     /**
//      * the field current scanning.
//      */
//     private Field field;
//     /**
//      * the ResId's value of which field current scanning with the annotation of ResId
//      */
//     private int resId;
//     /**
//      * the holder of an adapter.
//      */
//     private Object holder;
//     /**
//      * all the listeners.
//      */
//     private Object[] listeners;
// 
//     public ActionParams(Object obj, Object transfer, Field field, int resId, Object holder, Object[] listeners) {
//         this.obj = obj;
//         this.transfer = transfer;
//         this.field = field;
//         this.resId = resId;
//         this.holder = holder;
//         this.listeners = listeners;
//     }
// 
//     public Object getObj() {
//         return obj;
//     }
// 
//     public void setObj(Object obj) {
//         this.obj = obj;
//     }
// 
//     public Object getTransfer() {
//         return transfer;
//     }
// 
//     public void setTransfer(Object transfer) {
//         this.transfer = transfer;
//     }
// 
//     public Field getField() {
//         return field;
//     }
// 
//     public void setField(Field field) {
//         this.field = field;
//     }
// 
//     public int getResId() {
//         return resId;
//     }
// 
//     public void setResId(int resId) {
//         this.resId = resId;
//     }
// 
//     public Object getHolder() {
//         return holder;
//     }
// 
//     public void setHolder(Object holder) {
//         this.holder = holder;
//     }
// 
//     public Object[] getListeners() {
//         return listeners;
//     }
// 
//     public void setListeners(Object[] listeners) {
//         this.listeners = listeners;
//     }
// }
// 
// Path: ripened/src/main/java/org/studio/maizi/ripened/exception/VIRuntimeException.java
// public class VIRuntimeException extends RuntimeException {
// 
//     public VIRuntimeException(String detailMessage) { super(detailMessage); }
// 
//     public VIRuntimeException(String detailMessage, Throwable throwable) { super(detailMessage, throwable); }
// }
// 
// Path: ripened/src/main/java/org/studio/maizi/ripened/util/StringFormatter.java
// public class StringFormatter {
// 
//     /**
//      * format the string.
//      * @param str the string which will be format
//      * @param obj the object which match each place with it's turn.
//      * @return the string formatted
//      */
//     public static String format(String str, Object... obj) {
//         return new Formatter().format(str, obj).toString();
//     }
// }


// Path: adapter_enhance/src/main/java/org/studio/maizi/ripened/impl/AdapterSetter.java
import org.studio.maizi.ripened.IAdapter;
import org.studio.maizi.ripened.dto.ActionParams;
import org.studio.maizi.ripened.exception.VIRuntimeException;
import org.studio.maizi.ripened.util.StringFormatter;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import android.widget.AdapterView;

                    break;
                }
            }
            if (constructor == null)
                throw new InstantiationException(StringFormatter.format(INSTACE_ERROR, field.toString(), cls.getSimpleName()));
            if (paramsLen == 0)
                target = constructor.newInstance();
            else if (paramsLen == 1)
                target = constructor.newInstance(obj);
            AdapterView.class.cast(field.get(obj)).setAdapter(android.widget.Adapter.class.cast(target));
        } catch (IllegalAccessException e) {
            //can't reach
            e.printStackTrace();
        } catch (InstantiationException e) {//represent no matching empty-constructor,attempt to find instance obj pass by user manually.
            boolean isFind = false;
            android.widget.Adapter target = null;
            for (Object object : adapter_listeners) {
                if (object instanceof android.widget.Adapter) {
                    target = android.widget.Adapter.class.cast(object);
                    try {
                        AdapterView.class.cast(field.get(obj)).setAdapter(target);
                    } catch (IllegalAccessException e1) {
                        //can't reach
                        e1.printStackTrace();
                    }
                    isFind = true;
                    break;
                }
            }
            if (!isFind)
                throw new VIRuntimeException(StringFormatter.format(NO_MATCH_ADAPTER, field.getType().getName()));