// 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/util/StringUtil.java
// public class StringUtil {
//     public static boolean isNullOrEmpty(String str) {
//         return str == null || str.isEmpty();
//     }
// 
//     public static boolean compare(String str1, String str2) {
//         return (str1 == null || str2 == null) ? str1 == str2 : str1.equals(str2);
//     }
// }


import android.content.Context;
import com.kk.binding.util.BindLog;
import com.kk.binding.util.StringUtil;
/*
 * Copyright (C) 2013 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.kernel;



/**
 * Created by hk on 13-12-10.
 */
public class BindEngine {
    private static final String TAG = "BindEngine";
    private static BindEngine bindEngine;
    private static IBindValueSetter bindValueSetter;
    private static String propertyDeclareClass = "";
    private Context mContext;

    public static BindEngine instance() {
        if (bindEngine == null) {
            bindEngine = new BindEngine();
        }
        return bindEngine;
    }

    private BindEngine() {
    }

    public void init(Context context) {
        mContext = context;
    }

    public Context getContext() {
        return mContext;
    }

    public static void setBindValueSetter(IBindValueSetter bindValueSetter) {
        BindEngine.bindValueSetter = bindValueSetter;
    }

    public static IBindValueSetter getBindValueSetter() {
        return bindValueSetter;
    }

    /**
     * @param propertyDeclareClassName
     */
// 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/util/StringUtil.java
// public class StringUtil {
//     public static boolean isNullOrEmpty(String str) {
//         return str == null || str.isEmpty();
//     }
// 
//     public static boolean compare(String str1, String str2) {
//         return (str1 == null || str2 == null) ? str1 == str2 : str1.equals(str2);
//     }
// }


// Path: src/com/kk/binding/kernel/BindEngine.java
import android.content.Context;
import com.kk.binding.util.BindLog;
import com.kk.binding.util.StringUtil;

/*
 * Copyright (C) 2013 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.kernel;



/**
 * Created by hk on 13-12-10.
 */
public class BindEngine {
    private static final String TAG = "BindEngine";
    private static BindEngine bindEngine;
    private static IBindValueSetter bindValueSetter;
    private static String propertyDeclareClass = "";
    private Context mContext;

    public static BindEngine instance() {
        if (bindEngine == null) {
            bindEngine = new BindEngine();
        }
        return bindEngine;
    }

    private BindEngine() {
    }

    public void init(Context context) {
        mContext = context;
    }

    public Context getContext() {
        return mContext;
    }

    public static void setBindValueSetter(IBindValueSetter bindValueSetter) {
        BindEngine.bindValueSetter = bindValueSetter;
    }

    public static IBindValueSetter getBindValueSetter() {
        return bindValueSetter;
    }

    /**
     * @param propertyDeclareClassName
     */
    public static void registerPropertyDeclareClass(String propertyDeclareClassName) {