// Path: src/com/kk/binding/util/BindLog.java
// public class BindLog {
//     private static boolean inDesignMode = false;
//     private static StringBuilder fullLog;
//     private static boolean logOpen = true;
// 
//     public static void d(String tag, String log) {
//         if (inDesignMode) {
//             designLog(tag, log);
//         } else if (logOpen) {
//             Log.d(tag, log);
//         }
//     }
// 
//     public static void i(String tag, String log) {
//         if (inDesignMode) {
//             designLog(tag, log);
//         } else if (logOpen) {
//             Log.i(tag, log);
//         }
//     }
// 
//     public static void v(String tag, String log) {
//         if (inDesignMode) {
//             designLog(tag, log);
//         } else if (logOpen) {
//             Log.v(tag, log);
//         }
//     }
// 
//     public static void e(String tag, String log) {
//         if (inDesignMode) {
//             designLog(tag, log);
//         } else if (logOpen) {
//             Log.e(tag, log);
//         }
//     }
// 
//     public static void w(String tag, String log) {
//         if (inDesignMode) {
//             designLog(tag, log);
//         } else if (logOpen) {
//             Log.w(tag, log);
//         }
//     }
// 
//     private static void designLog(String tag, String log) {
//         if (fullLog != null) {
//             fullLog.append("\nTAG: ").append(tag).append(" ");
//             fullLog.append(log);
//             fullLog.append("\n");
//         }
//     }
// 
//     public static void throwDesignLog() {
//         if (inDesignMode) {
//             throw new RuntimeException(fullLog != null ? fullLog.toString() : null);
//         }
//     }
// 
//     public static void setInDesignMode(boolean inDesignMode) {
//         BindLog.inDesignMode = inDesignMode;
//         if (inDesignMode) {
//             fullLog = new StringBuilder(1024 * 10);
//         }
//     }
// 
//     public static boolean isInDesignMode() {
//         return inDesignMode;
//     }
// 
//     public static void setBindLogOpen(boolean open) {
//         logOpen = open;
//     }
// 
//     public static boolean isLogOpen() {
//         return logOpen;
//     }
// }


import com.kk.binding.util.BindLog;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;

/*
 * Copyright (C) 2014 kk-team.com.
 *
 * 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.
 */
package com.kk.binding.register;



/**
 * @author xuanjue.hk
 * @date 2014-1-7
 */
public class MethodCache {
    private static final String TAG = "Binding-MethodCache";
    private static HashMap<Class<?>, HashMap<String, Method>> methodCache;

    private static HashMap<Class<?>, HashMap<String, Method>> getMethodCache() {
        if (methodCache == null) {
            methodCache = new HashMap<Class<?>, HashMap<String, Method>>(256);
        }
        return methodCache;
    }

    public static Method obtain(String methodName, Class<?> clazz) {
        HashMap<String, Method> methodHashMap = getMethodCache().get(clazz);

// Path: src/com/kk/binding/util/BindLog.java
// public class BindLog {
//     private static boolean inDesignMode = false;
//     private static StringBuilder fullLog;
//     private static boolean logOpen = true;
// 
//     public static void d(String tag, String log) {
//         if (inDesignMode) {
//             designLog(tag, log);
//         } else if (logOpen) {
//             Log.d(tag, log);
//         }
//     }
// 
//     public static void i(String tag, String log) {
//         if (inDesignMode) {
//             designLog(tag, log);
//         } else if (logOpen) {
//             Log.i(tag, log);
//         }
//     }
// 
//     public static void v(String tag, String log) {
//         if (inDesignMode) {
//             designLog(tag, log);
//         } else if (logOpen) {
//             Log.v(tag, log);
//         }
//     }
// 
//     public static void e(String tag, String log) {
//         if (inDesignMode) {
//             designLog(tag, log);
//         } else if (logOpen) {
//             Log.e(tag, log);
//         }
//     }
// 
//     public static void w(String tag, String log) {
//         if (inDesignMode) {
//             designLog(tag, log);
//         } else if (logOpen) {
//             Log.w(tag, log);
//         }
//     }
// 
//     private static void designLog(String tag, String log) {
//         if (fullLog != null) {
//             fullLog.append("\nTAG: ").append(tag).append(" ");
//             fullLog.append(log);
//             fullLog.append("\n");
//         }
//     }
// 
//     public static void throwDesignLog() {
//         if (inDesignMode) {
//             throw new RuntimeException(fullLog != null ? fullLog.toString() : null);
//         }
//     }
// 
//     public static void setInDesignMode(boolean inDesignMode) {
//         BindLog.inDesignMode = inDesignMode;
//         if (inDesignMode) {
//             fullLog = new StringBuilder(1024 * 10);
//         }
//     }
// 
//     public static boolean isInDesignMode() {
//         return inDesignMode;
//     }
// 
//     public static void setBindLogOpen(boolean open) {
//         logOpen = open;
//     }
// 
//     public static boolean isLogOpen() {
//         return logOpen;
//     }
// }


// Path: src/com/kk/binding/register/MethodCache.java
import com.kk.binding.util.BindLog;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;

/*
 * Copyright (C) 2014 kk-team.com.
 *
 * 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.
 */
package com.kk.binding.register;



/**
 * @author xuanjue.hk
 * @date 2014-1-7
 */
public class MethodCache {
    private static final String TAG = "Binding-MethodCache";
    private static HashMap<Class<?>, HashMap<String, Method>> methodCache;

    private static HashMap<Class<?>, HashMap<String, Method>> getMethodCache() {
        if (methodCache == null) {
            methodCache = new HashMap<Class<?>, HashMap<String, Method>>(256);
        }
        return methodCache;
    }

    public static Method obtain(String methodName, Class<?> clazz) {
        HashMap<String, Method> methodHashMap = getMethodCache().get(clazz);

        BindLog.d(TAG, "obtain method: methodName = " + methodName
