FileDocCategorySizeDatePackage
LegacyPropertiesConfigurationProvider.javaAPI DocExample3263Mon Jul 23 13:26:54 BST 2007org.apache.struts2.config

LegacyPropertiesConfigurationProvider

public class LegacyPropertiesConfigurationProvider extends Object implements com.opensymphony.xwork2.config.ConfigurationProvider

Fields Summary
Constructors Summary
Methods Summary
public voiddestroy()

        Settings.reset();
    
public voidinit(com.opensymphony.xwork2.config.Configuration configuration)

        Settings.reset();
    
public voidloadPackages()

    
protected voidloadSettings(com.opensymphony.xwork2.util.location.LocatableProperties props, Settings settings)

param
props
param
settings

        // We are calling the impl methods to get around the single instance of Settings that is expected
        for (Iterator i = settings.listImpl(); i.hasNext(); ) {
            String name = (String) i.next();
            props.setProperty(name, settings.getImpl(name), settings.getLocationImpl(name));
        }
    
public booleanneedsReload()

        return false;
    
public voidregister(com.opensymphony.xwork2.inject.ContainerBuilder builder, com.opensymphony.xwork2.util.location.LocatableProperties props)

        
        final Settings settings = Settings.getInstance();
        
        loadSettings(props, settings);
        
        // Set default locale
        final Locale locale = settings.getLocale();
        builder.factory(Locale.class, new Factory() {
            public Object create(Context context) throws Exception {
                return locale;
            }
        });