urbanairship-core/src/main/java/com/urbanairship/AirshipConfigOptions.java
private void applyConfigParser(Context context, ConfigParser configParser) {
            for (int i = 0; i < configParser.getCount(); i++) {
                try {
                    switch (configParser.getName(i)) {
                        case FIELD_PRODUCTION_APP_KEY:
                            this.setProductionAppKey(configParser.getString(i));
                            break;

                        case FIELD_PRODUCTION_APP_SECRET:
                            this.setProductionAppSecret(configParser.getString(i));
                            break;

                        case FIELD_DEVELOPMENT_APP_KEY:
                            this.setDevelopmentAppKey(configParser.getString(i));
                            break;

                        case FIELD_DEVELOPMENT_APP_SECRET:
                            this.setDevelopmentAppSecret(configParser.getString(i));
                            break;

                        case FIELD_HOST_URL:
                            this.setHostURL(configParser.getString(i));
                            break;

                        case FIELD_ANALYTICS_SERVER:
                            this.setAnalyticsServer(configParser.getString(i));
                            break;

                        case FIELD_LANDING_PAGE_CONTENT_URL:
                            this.setLandingPageContentURL(configParser.getString(i));
                            break;

                        case FIELD_REMOTE_DATA_URL:
                            this.setRemoteDataURL(configParser.getString(i));
                            break;

                        case FIELD_GCM_SENDER:
                            this.setGcmSender(configParser.getString(i));
                            break;

                        case FIELD_ALLOWED_TRANSPORTS:
                            this.setAllowedTransports(configParser.getStringArray(i));
                            break;

                        case FIELD_WHITELIST:
                            this.setWhitelist(configParser.getStringArray(i));
                            break;

                        case FIELD_IN_PRODUCTION:
                            this.setInProduction(configParser.getBoolean(i));
                            break;

                        case FIELD_ANALYTICS_ENABLED:
                            this.setAnalyticsEnabled(configParser.getBoolean(i));
                            break;

                        case FIELD_BACKGROUND_REPORTING_INTERVAL_MS:
                            this.setBackgroundReportingIntervalMS(configParser.getLong(i));
                            break;

                        case FIELD_CLEAR_NAMED_USER:
                            this.setClearNamedUser(configParser.getBoolean(i));
                            break;

                        case FIELD_DEVELOPMENT_LOG_LEVEL:
                            this.setDevelopmentLogLevel(Logger.parseLogLevel(configParser.getString(i), AirshipConfigOptions.DEFAULT_DEVELOPMENT_LOG_LEVEL));
                            break;

                        case FIELD_PRODUCTION_LOG_LEVEL:
                            this.setProductionLogLevel(Logger.parseLogLevel(configParser.getString(i), AirshipConfigOptions.DEFAULT_PRODUCTION_LOG_LEVEL));
                            break;

                        case FIELD_AUTO_LAUNCH_APPLICATION:
                            this.setAutoLaunchApplication(configParser.getBoolean(i));
                            break;

                        case FIELD_CHANNEL_CREATION_DELAY_ENABLED:
                            this.setChannelCreationDelayEnabled(configParser.getBoolean(i));
                            break;

                        case FIELD_CHANNEL_CAPTURE_ENABLED:
                            this.setChannelCaptureEnabled(configParser.getBoolean(i));
                            break;

                        case FIELD_NOTIFICATION_ICON:
                            this.setNotificationIcon(configParser.getDrawableResourceId(i));
                            break;

                        case FIELD_NOTIFICATION_ACCENT_COLOR:
                            this.setNotificationAccentColor(configParser.getColor(i));
                            break;

                        case FIELD_WALLET_URL:
                            this.setWalletUrl(configParser.getString(i));
                            break;

                        case FIELD_NOTIFICATION_CHANNEL:
                            this.setNotificationChannel(configParser.getString(i));
                            break;

                        case FIELD_FCM_SENDER_ID:
                            this.setFcmSenderId(configParser.getString(i));
                            break;

                        case FIELD_DEVELOPMENT_FCM_SENDER_ID:
                            this.setDevelopmentFcmSenderId(configParser.getString(i));
                            break;

                        case FIELD_PRODUCTION_FCM_SENDER_ID:
                            this.setProductionFcmSenderId(configParser.getString(i));
                            break;

                        case FIELD_ENABLE_URL_WHITELISTING:
                            this.setEnableUrlWhitelisting(configParser.getBoolean(i));
                            break;

                        case FIELD_CUSTOM_PUSH_PROVIDER:
                            String className = configParser.getString(i);
                            Class<? extends PushProvider> providerClass = Class.forName(className).asSubclass(PushProvider.class);
                            this.setCustomPushProvider(providerClass.newInstance());
                            break;

                        case FIELD_APP_STORE_URI:
                            this.setAppStoreUri(Uri.parse(configParser.getString(i)));
                            break;
                    }
                } catch (Exception e) {
                    Logger.error("Unable to set config field '" + configParser.getName(i) + "' due to invalid configuration value.", e);
                }
            }

            // Determine build mode if not specified in config file.
            if (inProduction == null) {
                detectProvisioningMode(context);
            }
        }
/**
         * Applies a value to the builder.
         *
         * @param configParser The config parser.
         */
Applies a value to the builder.
@param configParser The config parser.
Applies a value to the builder . @param configParser The config parser .
private void applyConfigParser(Context context, ConfigParser configParser) {
            for (int i = 0; i < configParser.getCount(); i++) {
                try {
                    switch (configParser.getName(i)) {
                        case FIELD_PRODUCTION_APP_KEY:
                            this.setProductionAppKey(configParser.getString(i));
                            break;
                        case FIELD_PRODUCTION_APP_SECRET:
                            this.setProductionAppSecret(configParser.getString(i));
                            break;
                        case FIELD_DEVELOPMENT_APP_KEY:
                            this.setDevelopmentAppKey(configParser.getString(i));
                            break;
                        case FIELD_DEVELOPMENT_APP_SECRET:
                            this.setDevelopmentAppSecret(configParser.getString(i));
                            break;
                        case FIELD_HOST_URL:
                            this.setHostURL(configParser.getString(i));
                            break;
                        case FIELD_ANALYTICS_SERVER:
                            this.setAnalyticsServer(configParser.getString(i));
                            break;
                        case FIELD_LANDING_PAGE_CONTENT_URL:
                            this.setLandingPageContentURL(configParser.getString(i));
                            break;
                        case FIELD_REMOTE_DATA_URL:
                            this.setRemoteDataURL(configParser.getString(i));
                            break;
                        case FIELD_GCM_SENDER:
                            this.setGcmSender(configParser.getString(i));
                            break;
                        case FIELD_ALLOWED_TRANSPORTS:
                            this.setAllowedTransports(configParser.getStringArray(i));
                            break;
                        case FIELD_WHITELIST:
                            this.setWhitelist(configParser.getStringArray(i));
                            break;
                        case FIELD_IN_PRODUCTION:
                            this.setInProduction(configParser.getBoolean(i));
                            break;
                        case FIELD_ANALYTICS_ENABLED:
                            this.setAnalyticsEnabled(configParser.getBoolean(i));
                            break;
                        case FIELD_BACKGROUND_REPORTING_INTERVAL_MS:
                            this.setBackgroundReportingIntervalMS(configParser.getLong(i));
                            break;
                        case FIELD_CLEAR_NAMED_USER:
                            this.setClearNamedUser(configParser.getBoolean(i));
                            break;
                        case FIELD_DEVELOPMENT_LOG_LEVEL:
                            this.setDevelopmentLogLevel(Logger.parseLogLevel(configParser.getString(i), AirshipConfigOptions.DEFAULT_DEVELOPMENT_LOG_LEVEL));
                            break;
                        case FIELD_PRODUCTION_LOG_LEVEL:
                            this.setProductionLogLevel(Logger.parseLogLevel(configParser.getString(i), AirshipConfigOptions.DEFAULT_PRODUCTION_LOG_LEVEL));
                            break;
                        case FIELD_AUTO_LAUNCH_APPLICATION:
                            this.setAutoLaunchApplication(configParser.getBoolean(i));
                            break;
                        case FIELD_CHANNEL_CREATION_DELAY_ENABLED:
                            this.setChannelCreationDelayEnabled(configParser.getBoolean(i));
                            break;
                        case FIELD_CHANNEL_CAPTURE_ENABLED:
                            this.setChannelCaptureEnabled(configParser.getBoolean(i));
                            break;
                        case FIELD_NOTIFICATION_ICON:
                            this.setNotificationIcon(configParser.getDrawableResourceId(i));
                            break;
                        case FIELD_NOTIFICATION_ACCENT_COLOR:
                            this.setNotificationAccentColor(configParser.getColor(i));
                            break;
                        case FIELD_WALLET_URL:
                            this.setWalletUrl(configParser.getString(i));
                            break;
                        case FIELD_NOTIFICATION_CHANNEL:
                            this.setNotificationChannel(configParser.getString(i));
                            break;
                        case FIELD_FCM_SENDER_ID:
                            this.setFcmSenderId(configParser.getString(i));
                            break;
                        case FIELD_DEVELOPMENT_FCM_SENDER_ID:
                            this.setDevelopmentFcmSenderId(configParser.getString(i));
                            break;
                        case FIELD_PRODUCTION_FCM_SENDER_ID:
                            this.setProductionFcmSenderId(configParser.getString(i));
                            break;
                        case FIELD_ENABLE_URL_WHITELISTING:
                            this.setEnableUrlWhitelisting(configParser.getBoolean(i));
                            break;
                        case FIELD_CUSTOM_PUSH_PROVIDER:
                            String className = configParser.getString(i);
                            Class<? extends PushProvider> providerClass = Class.forName(className).asSubclass(PushProvider.class);
                            this.setCustomPushProvider(providerClass.newInstance());
                            break;
                        case FIELD_APP_STORE_URI:
                            this.setAppStoreUri(Uri.parse(configParser.getString(i)));
                            break;
                    }
                } catch (Exception e) {
                    Logger.error("Unable to set config field '" + configParser.getName(i) + "' due to invalid configuration value.", e);
                }
            }
            if (inProduction == null) {
                detectProvisioningMode(context);
            }
        }
private void applyConfigParser ( Context context , ConfigParser configParser ) { for ( int i = 0 ; i < configParser . getCount ( ) ; i ++ ) { try { switch ( configParser . getName ( i ) ) { case FIELD_PRODUCTION_APP_KEY : this . setProductionAppKey ( configParser . getString ( i ) ) ; break ; case FIELD_PRODUCTION_APP_SECRET : this . setProductionAppSecret ( configParser . getString ( i ) ) ; break ; case FIELD_DEVELOPMENT_APP_KEY : this . setDevelopmentAppKey ( configParser . getString ( i ) ) ; break ; case FIELD_DEVELOPMENT_APP_SECRET : this . setDevelopmentAppSecret ( configParser . getString ( i ) ) ; break ; case FIELD_HOST_URL : this . setHostURL ( configParser . getString ( i ) ) ; break ; case FIELD_ANALYTICS_SERVER : this . setAnalyticsServer ( configParser . getString ( i ) ) ; break ; case FIELD_LANDING_PAGE_CONTENT_URL : this . setLandingPageContentURL ( configParser . getString ( i ) ) ; break ; case FIELD_REMOTE_DATA_URL : this . setRemoteDataURL ( configParser . getString ( i ) ) ; break ; case FIELD_GCM_SENDER : this . setGcmSender ( configParser . getString ( i ) ) ; break ; case FIELD_ALLOWED_TRANSPORTS : this . setAllowedTransports ( configParser . getStringArray ( i ) ) ; break ; case FIELD_WHITELIST : this . setWhitelist ( configParser . getStringArray ( i ) ) ; break ; case FIELD_IN_PRODUCTION : this . setInProduction ( configParser . getBoolean ( i ) ) ; break ; case FIELD_ANALYTICS_ENABLED : this . setAnalyticsEnabled ( configParser . getBoolean ( i ) ) ; break ; case FIELD_BACKGROUND_REPORTING_INTERVAL_MS : this . setBackgroundReportingIntervalMS ( configParser . getLong ( i ) ) ; break ; case FIELD_CLEAR_NAMED_USER : this . setClearNamedUser ( configParser . getBoolean ( i ) ) ; break ; case FIELD_DEVELOPMENT_LOG_LEVEL : this . setDevelopmentLogLevel ( Logger . parseLogLevel ( configParser . getString ( i ) , AirshipConfigOptions . DEFAULT_DEVELOPMENT_LOG_LEVEL ) ) ; break ; case FIELD_PRODUCTION_LOG_LEVEL : this . setProductionLogLevel ( Logger . parseLogLevel ( configParser . getString ( i ) , AirshipConfigOptions . DEFAULT_PRODUCTION_LOG_LEVEL ) ) ; break ; case FIELD_AUTO_LAUNCH_APPLICATION : this . setAutoLaunchApplication ( configParser . getBoolean ( i ) ) ; break ; case FIELD_CHANNEL_CREATION_DELAY_ENABLED : this . setChannelCreationDelayEnabled ( configParser . getBoolean ( i ) ) ; break ; case FIELD_CHANNEL_CAPTURE_ENABLED : this . setChannelCaptureEnabled ( configParser . getBoolean ( i ) ) ; break ; case FIELD_NOTIFICATION_ICON : this . setNotificationIcon ( configParser . getDrawableResourceId ( i ) ) ; break ; case FIELD_NOTIFICATION_ACCENT_COLOR : this . setNotificationAccentColor ( configParser . getColor ( i ) ) ; break ; case FIELD_WALLET_URL : this . setWalletUrl ( configParser . getString ( i ) ) ; break ; case FIELD_NOTIFICATION_CHANNEL : this . setNotificationChannel ( configParser . getString ( i ) ) ; break ; case FIELD_FCM_SENDER_ID : this . setFcmSenderId ( configParser . getString ( i ) ) ; break ; case FIELD_DEVELOPMENT_FCM_SENDER_ID : this . setDevelopmentFcmSenderId ( configParser . getString ( i ) ) ; break ; case FIELD_PRODUCTION_FCM_SENDER_ID : this . setProductionFcmSenderId ( configParser . getString ( i ) ) ; break ; case FIELD_ENABLE_URL_WHITELISTING : this . setEnableUrlWhitelisting ( configParser . getBoolean ( i ) ) ; break ; case FIELD_CUSTOM_PUSH_PROVIDER : String className = configParser . getString ( i ) ; Class < ? extends PushProvider > providerClass = Class . forName ( className ) . asSubclass ( PushProvider . class ) ; this . setCustomPushProvider ( providerClass . newInstance ( ) ) ; break ; case FIELD_APP_STORE_URI : this . setAppStoreUri ( Uri . parse ( configParser . getString ( i ) ) ) ; break ; } } catch ( Exception e ) { Logger . error ( "Unable to set config field '" + configParser . getName ( i ) + "' due to invalid configuration value." , e ) ; } } if ( inProduction == null ) { detectProvisioningMode ( context ) ; } }
Applies a value to the builder.
Applies a value to the builder .
// Determine build mode if not specified in config file.