// Path: resourcebinder_enhance/src/main/java/org/studio/maizi/ripened/IAnimation.java
// public interface IAnimation extends IPlugin {
// 
//     /**
//      * the name of this plugin.
//      */
//     String NAME = "Animation";
//     /**
//      * the type name of animation resource.
//      */
//     String RES_ANIM_NAME = "anim";
//     /**
//      * the type name of interpolator resource.
//      */
//     String RES_INTERPOLATOR_NAME = "interpolator";
// 
//     /**
//      * set the animation to the specify view object.
//      *
//      * @param view         the object of view which need animation setting
//      * @param animResId    the resource id of animation
//      * @param duration     the duration of animation
//      * @param startOffset  the start offset of the animation
//      * @param interpolator the interpolator of the animation
//      * @param repeatCount  the repeatCount of the animation
//      * @param fillAfter    is fillAfter or not
//      */
//     void setAnimation(View view, int animResId, int duration, int startOffset, int interpolator, int repeatCount, boolean fillAfter, Field field);
// }
// 
// 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 android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import org.studio.maizi.ripened.IAnimation;
import org.studio.maizi.ripened.anno.Anim;
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.Field;
import android.content.res.Resources;
import android.view.View;
/*
 *  $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 IAnimation.<br />
 * Powered by Maizi-Studio.<br />
 * Design by maizi.<br />
 * Created on 15-11-6.
 */
public class AnimationSetter implements IAnimation {

    private static final String NOT_VIEW_INSTANCE = "Field: %s is not an instance of View, please check your code...";
    private static final String WRONG_RES_ID = "Field: %s's annotation of Anim with the wrong ResId value: %d, please check your code...";
    private static final String WRONG_ANIM_DURATION = "Field: %s's annotation of Anim with the wrong duration value: %d, it should be >0 & <3000, please check your code...";
// Path: resourcebinder_enhance/src/main/java/org/studio/maizi/ripened/IAnimation.java
// public interface IAnimation extends IPlugin {
// 
//     /**
//      * the name of this plugin.
//      */
//     String NAME = "Animation";
//     /**
//      * the type name of animation resource.
//      */
//     String RES_ANIM_NAME = "anim";
//     /**
//      * the type name of interpolator resource.
//      */
//     String RES_INTERPOLATOR_NAME = "interpolator";
// 
//     /**
//      * set the animation to the specify view object.
//      *
//      * @param view         the object of view which need animation setting
//      * @param animResId    the resource id of animation
//      * @param duration     the duration of animation
//      * @param startOffset  the start offset of the animation
//      * @param interpolator the interpolator of the animation
//      * @param repeatCount  the repeatCount of the animation
//      * @param fillAfter    is fillAfter or not
//      */
//     void setAnimation(View view, int animResId, int duration, int startOffset, int interpolator, int repeatCount, boolean fillAfter, Field field);
// }
// 
// 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: resourcebinder_enhance/src/main/java/org/studio/maizi/ripened/impl/AnimationSetter.java
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import org.studio.maizi.ripened.IAnimation;
import org.studio.maizi.ripened.anno.Anim;
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.Field;
import android.content.res.Resources;
import android.view.View;

/*
 *  $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 IAnimation.<br />
 * Powered by Maizi-Studio.<br />
 * Design by maizi.<br />
 * Created on 15-11-6.
 */
public class AnimationSetter implements IAnimation {

    private static final String NOT_VIEW_INSTANCE = "Field: %s is not an instance of View, please check your code...";
    private static final String WRONG_RES_ID = "Field: %s's annotation of Anim with the wrong ResId value: %d, please check your code...";
    private static final String WRONG_ANIM_DURATION = "Field: %s's annotation of Anim with the wrong duration value: %d, it should be >0 & <3000, please check your code...";
    private static final String WRONG_ANIM_START_OFFSET = "Field: %s's annotation of Anim with the wrong startOffset value: %d, it should be >0 & <3000, please check your code...";