@Override
    public Decoder getDecoder(final BootstrapConfiguration bootstrap, final Decoder defaultDecoder)
    {
        final String DECODER_CONFIG_KEY = "CAF_CONFIG_DECODER";

        final String decoder;
        try {
            // Return the specified default Decoder if none has been configured
            if (!bootstrap.isConfigurationPresent(DECODER_CONFIG_KEY)) {
                return defaultDecoder;
            }

            // Lookup the Decoder to use
            decoder = bootstrap.getConfiguration(DECODER_CONFIG_KEY);

        } catch (final ConfigurationException ex) {
            // Throw a RuntimeException since this shouldn't happen
            // (since isConfigurationPresent() has already been called)
            throw new RuntimeException(ex);
        }

        try {
            // Retrieve the Decoder using the ModuleProvider
            return ModuleProvider.getInstance().getModule(Decoder.class, decoder);
        } catch (final NullPointerException ex) {
            throw new RuntimeException("Unable to get Decoder using " + DECODER_CONFIG_KEY + " value: " + decoder, ex);
        }
    }
@ Override public Decoder getDecoder ( final BootstrapConfiguration bootstrap , final Decoder defaultDecoder ) { final String DECODER_CONFIG_KEY = "CAF_CONFIG_DECODER" ; final String decoder ; try { if ( ! bootstrap . isConfigurationPresent ( DECODER_CONFIG_KEY ) ) { return defaultDecoder ; } decoder = bootstrap . getConfiguration ( DECODER_CONFIG_KEY ) ; } catch ( final ConfigurationException ex ) { throw new RuntimeException ( ex ) ; } try { return ModuleProvider . getInstance ( ) . getModule ( Decoder . class , decoder ) ; } catch ( final NullPointerException ex ) { throw new RuntimeException ( "Unable to get Decoder using " + DECODER_CONFIG_KEY + " value: " + decoder , ex ) ; } }
Returns the Decoder that should be used to interpret the configuration files.

@param bootstrap used to provide basic, initial startup configuration
@param defaultDecoder the Decoder to use if one is not configured
@return the Decoder that should be used to interpret the configuration files