// Path: src/com/kk/binding/converter/FalseToVisibleConverter.java
// public class FalseToVisibleConverter implements IValueConverter {
// 
//     /*
//      * (non-Javadoc)
//      *
//      * @see binding.kernel.IConverter#converter(java.lang.Object)
//      */
//     @Override
//     public Object converter(Object source) {
//         return (!Boolean.parseBoolean(String.valueOf(source))) ? View.VISIBLE : View.GONE;
//     }
// }
// 
// Path: src/com/kk/binding/converter/NotNullToVisibleConverter.java
// public class NotNullToVisibleConverter implements IValueConverter {
// 
//     /*
//      * (non-Javadoc)
//      *
//      * @see binding.kernel.IConverter#converter(java.lang.Object)
//      */
//     @Override
//     public Object converter(Object source) {
//         return source != null ? View.VISIBLE : View.GONE;
//     }
// }
// 
// Path: src/com/kk/binding/converter/NullToVisibleConverter.java
// public class NullToVisibleConverter implements IValueConverter {
// 
//     /*
//      * (non-Javadoc)
//      *
//      * @see binding.kernel.IConverter#converter(java.lang.Object)
//      */
//     @Override
//     public Object converter(Object source) {
//         return source == null ? View.VISIBLE : View.GONE;
//     }
// }
// 
// Path: src/com/kk/binding/converter/TrueToVisibleConverter.java
// public class TrueToVisibleConverter implements IValueConverter {
// 
//     /*
//      * (non-Javadoc)
//      *
//      * @see binding.kernel.IConverter#converter(java.lang.Object)
//      */
//     @Override
//     public Object converter(Object source) {
//         return Boolean.parseBoolean(String.valueOf(source)) ? View.VISIBLE : View.GONE;
//     }
// }
// 
// Path: src/com/kk/binding/converter/IValueConverter.java
// public interface IValueConverter {
//     public Object converter(Object source) throws Exception;
// }
// 
// 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 com.kk.binding.converter.FalseToVisibleConverter;
import com.kk.binding.converter.NotNullToVisibleConverter;
import com.kk.binding.converter.NullToVisibleConverter;
import com.kk.binding.converter.TrueToVisibleConverter;
import com.kk.binding.converter.IValueConverter;
import com.kk.binding.util.StringUtil;
import java.util.HashMap;
/*
 * 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;



/**
 * Created by xj on 14-1-6.
 */
public class ConverterRegister {
    private static final String TAG = "Binding-ConverterRegister";
    private static HashMap<String, Class<? extends IValueConverter>> converters;

    public static HashMap<String, Class<? extends IValueConverter>> getConverters() {
        if (converters == null) {
            converters = new HashMap<String, Class<? extends IValueConverter>>(32);
            registerInner();
        }
        return converters;
    }

    private static void registerInner() {
        register("TrueToVisibleConverter", TrueToVisibleConverter.class);
        register("FalseToVisibleConverter", FalseToVisibleConverter.class);
// Path: src/com/kk/binding/converter/FalseToVisibleConverter.java
// public class FalseToVisibleConverter implements IValueConverter {
// 
//     /*
//      * (non-Javadoc)
//      *
//      * @see binding.kernel.IConverter#converter(java.lang.Object)
//      */
//     @Override
//     public Object converter(Object source) {
//         return (!Boolean.parseBoolean(String.valueOf(source))) ? View.VISIBLE : View.GONE;
//     }
// }
// 
// Path: src/com/kk/binding/converter/NotNullToVisibleConverter.java
// public class NotNullToVisibleConverter implements IValueConverter {
// 
//     /*
//      * (non-Javadoc)
//      *
//      * @see binding.kernel.IConverter#converter(java.lang.Object)
//      */
//     @Override
//     public Object converter(Object source) {
//         return source != null ? View.VISIBLE : View.GONE;
//     }
// }
// 
// Path: src/com/kk/binding/converter/NullToVisibleConverter.java
// public class NullToVisibleConverter implements IValueConverter {
// 
//     /*
//      * (non-Javadoc)
//      *
//      * @see binding.kernel.IConverter#converter(java.lang.Object)
//      */
//     @Override
//     public Object converter(Object source) {
//         return source == null ? View.VISIBLE : View.GONE;
//     }
// }
// 
// Path: src/com/kk/binding/converter/TrueToVisibleConverter.java
// public class TrueToVisibleConverter implements IValueConverter {
// 
//     /*
//      * (non-Javadoc)
//      *
//      * @see binding.kernel.IConverter#converter(java.lang.Object)
//      */
//     @Override
//     public Object converter(Object source) {
//         return Boolean.parseBoolean(String.valueOf(source)) ? View.VISIBLE : View.GONE;
//     }
// }
// 
// Path: src/com/kk/binding/converter/IValueConverter.java
// public interface IValueConverter {
//     public Object converter(Object source) throws Exception;
// }
// 
// 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/register/ConverterRegister.java
import com.kk.binding.converter.FalseToVisibleConverter;
import com.kk.binding.converter.NotNullToVisibleConverter;
import com.kk.binding.converter.NullToVisibleConverter;
import com.kk.binding.converter.TrueToVisibleConverter;
import com.kk.binding.converter.IValueConverter;
import com.kk.binding.util.StringUtil;
import java.util.HashMap;

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



/**
 * Created by xj on 14-1-6.
 */
public class ConverterRegister {
    private static final String TAG = "Binding-ConverterRegister";
    private static HashMap<String, Class<? extends IValueConverter>> converters;

    public static HashMap<String, Class<? extends IValueConverter>> getConverters() {
        if (converters == null) {
            converters = new HashMap<String, Class<? extends IValueConverter>>(32);
            registerInner();
        }
        return converters;
    }

    private static void registerInner() {
        register("TrueToVisibleConverter", TrueToVisibleConverter.class);
        register("FalseToVisibleConverter", FalseToVisibleConverter.class);
        register("NullToVisibleConverter", NullToVisibleConverter.class);