Android Open Source - PrettyBundle Extra Binder Provider






From Project

Back to project page PrettyBundle.

License

The source code is released under:

Apache License

If you think the Android project PrettyBundle listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.tale.prettybundle;
//  w w w  .j a v a2s  .  c  o m
/**
 * Created by giang on 2/24/15.
 */
public class ExtraBinderProvider {
    public static ExtraBinder get(String dataType) {
        if ("java.lang.String".equals(dataType)) {
            return ExtraBinder.STRING;
        } else if ("java.lang.CharSequence".equals(dataType)) {
            return ExtraBinder.CHAR_SEQUENCE;
        } else if ("int".equals(dataType) || "java.lang.Integer".equals(dataType)) {
            return ExtraBinder.INTEGER;
        } else if ("long".equals(dataType) || "java.lang.Long".equals(dataType)) {
            return ExtraBinder.LONG;
        } else if ("float".equals(dataType) || "java.lang.Float".equals(dataType)) {
            return ExtraBinder.FLOAT;
        } else if ("double".equals(dataType) || "java.lang.Double".equals(dataType)) {
            return ExtraBinder.DOUBLE;
        } else if ("boolean".equals(dataType) || "java.lang.Boolean".equals(dataType)) {
            return ExtraBinder.BOOLEAN;
        } else if ("byte".equals(dataType) || "java.lang.Byte".equals(dataType)) {
            return ExtraBinder.BYTE;
        } else if ("char".equals(dataType) || "java.lang.Character".equals(dataType)) {
            return ExtraBinder.CHAR;
        } else if ("short".equals(dataType) || "java.lang.Short".equals(dataType)) {
            return ExtraBinder.SHORT;
        } else if ("android.os.Parcelable".equals(dataType)) {
            return ExtraBinder.PARCELABLE;
        } else if ("int[]".equals(dataType) || "java.lang.Integer[]".equals(dataType)) {
            return ExtraBinder.INTEGER_ARRAY;
        } else if ("long[]".equals(dataType) || "java.lang.Long[]".equals(dataType)) {
            return ExtraBinder.LONG_ARRAY;
        } else if ("float[]".equals(dataType) || "java.lang.Float[]".equals(dataType)) {
            return ExtraBinder.FLOAT_ARRAY;
        } else if ("double[]".equals(dataType) || "java.lang.Double[]".equals(dataType)) {
            return ExtraBinder.DOUBLE_ARRAY;
        } else if ("boolean[]".equals(dataType) || "java.lang.Boolean[]".equals(dataType)) {
            return ExtraBinder.BOOLEAN_ARRAY;
        } else if ("byte[]".equals(dataType) || "java.lang.Byte[]".equals(dataType)) {
            return ExtraBinder.BYTE_ARRAY;
        } else if ("char[]".equals(dataType) || "java.lang.Character[]".equals(dataType)) {
            return ExtraBinder.CHAR_ARRAY;
        } else if ("short[]".equals(dataType) || "java.lang.Short[]".equals(dataType)) {
            return ExtraBinder.SHORT_ARRAY;
        } else if ("java.lang.String[]".equals(dataType)) {
            return ExtraBinder.STRING_ARRAY;
        } else if ("java.lang.CharSequence[]".equals(dataType)) {
            return ExtraBinder.CHAR_SEQUENCE_ARRAY;
        } else if ("android.os.Parcelable[]".equals(dataType)) {
            return ExtraBinder.PARCELABLE_ARRAY;
        }
        return ExtraBinder.NOP;
    }

}




Java Source Code List

com.tale.prettybundle.ExtraBinderProvider.java
com.tale.prettybundle.ExtraBinder.java
com.tale.prettybundle.Extra.java
com.tale.prettybundle.Injector.java
com.tale.prettybundle.PrettyBundle.java
com.tale.prettybundle.internal.ExtraAnnotatedClass.java
com.tale.prettybundle.internal.ExtraClassesGrouped.java
com.tale.prettybundle.internal.ExtraInjectorClassBuilder.java
com.tale.prettybundle.internal.ExtraUtilityClassBuilder.java
com.tale.prettybundle.internal.PrettyBundleProcessor.java
com.tale.prettybundle.internal.SupportedType.java
com.tale.prettybundle.sample.ActivitiesClassTest.java
com.tale.prettybundle.sample.ActivitiesTest.java
com.tale.prettybundle.sample.ApplicationTest.java
com.tale.prettybundle.sample.BaseActivityUnitTestCase.java
com.tale.prettybundle.sample.InjectArrayExtrasTest.java
com.tale.prettybundle.sample.InjectParcelableExtrasTest.java
com.tale.prettybundle.sample.InjectPrimaryTypeExtrasFragmentTest.java
com.tale.prettybundle.sample.InjectPrimaryTypeExtrasTest.java
com.tale.prettybundle.sample.InjectStringExtrasTest.java
com.tale.prettybundle.sample.MainActivity.java
com.tale.prettybundle.sample.MenuActivity.java
com.tale.prettybundle.sample.TestArrayExtrasActivity.java
com.tale.prettybundle.sample.TestExtraOnFragmentActivity.java
com.tale.prettybundle.sample.TestParcelableActivity.java
com.tale.prettybundle.sample.TestPrimaryTypeDisplayActivity.java
com.tale.prettybundle.sample.TestPrimaryTypeSetterActivity.java
com.tale.prettybundle.sample.TestStringExtra1Activity.java
com.tale.prettybundle.sample.TestStringExtra2Activity.java
com.tale.prettybundle.sample.data.Person.java
com.tale.prettybundle.sample.espresso.ExtViewActions.java
com.tale.prettybundle.sample.fragments.TestPrimaryExtraFragment.java
com.tale.prettybundle.sample.services.TestPrimaryTypeService.java