// 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;
/*
 *  $HomePage: https://github.com/maizi0122/ $
 *  $Revision: 000001 $
 *  $Date: 2015-10-18 09:05:31 -0000 (Sun, 18 Oct 2015) $
 *
 *  ====================================================================
 *  Copyright (C) 2015 The Maizi-Studio Open Source Project
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License.
 *  ====================================================================
 *
 *  This project powered by Maizi-Studio, but works with the
 *  license of apache,so you should abide by this license.
 *  Any question contacting with email below:
 *  maizi0122@gmail.com
 */

package org.studio.maizi.ripened.impl;




/**
 * an implementation of IAdapter.<br />
 * Powered by Maizi-Studio.<br />
 * Design by maizi.<br />
 * Created on 15-11-5.
 */
@SuppressWarnings("all")
public class AdapterSetter implements IAdapter {

    private static final String NOT_ADAPTER_VIEW = "Field: %s is not a sub class of AdapterView, please check your code...";
    private static final String NO_MATCH_ADAPTER = "Field: %s's annotation of Adapter which it's param class have no empty-constructor or your forget pass it instance manually...";
    private static final String INSTACE_ERROR = "Field : %s's RegistListener annotation param %s.class have no empty-params constructor or it is a illegal parameter, please check your code...";

    @Override
    public String getName() {
        return NAME;
    }

// 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;

/*
 *  $HomePage: https://github.com/maizi0122/ $
 *  $Revision: 000001 $
 *  $Date: 2015-10-18 09:05:31 -0000 (Sun, 18 Oct 2015) $
 *
 *  ====================================================================
 *  Copyright (C) 2015 The Maizi-Studio Open Source Project
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License.
 *  ====================================================================
 *
 *  This project powered by Maizi-Studio, but works with the
 *  license of apache,so you should abide by this license.
 *  Any question contacting with email below:
 *  maizi0122@gmail.com
 */

package org.studio.maizi.ripened.impl;




/**
 * an implementation of IAdapter.<br />
 * Powered by Maizi-Studio.<br />
 * Design by maizi.<br />
 * Created on 15-11-5.
 */
@SuppressWarnings("all")
public class AdapterSetter implements IAdapter {

    private static final String NOT_ADAPTER_VIEW = "Field: %s is not a sub class of AdapterView, please check your code...";
    private static final String NO_MATCH_ADAPTER = "Field: %s's annotation of Adapter which it's param class have no empty-constructor or your forget pass it instance manually...";
    private static final String INSTACE_ERROR = "Field : %s's RegistListener annotation param %s.class have no empty-params constructor or it is a illegal parameter, please check your code...";

    @Override
    public String getName() {
        return NAME;
    }

    @Override