org.apache.tiles.locale.LocaleResolver Java Examples

The following examples show how to use org.apache.tiles.locale.LocaleResolver. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TilesConfigurer.java    From spring-analysis-note with MIT License 6 votes vote down vote up
@Override
protected DefinitionsFactory createDefinitionsFactory(ApplicationContext applicationContext,
		LocaleResolver resolver) {

	if (definitionsFactoryClass != null) {
		DefinitionsFactory factory = BeanUtils.instantiateClass(definitionsFactoryClass);
		if (factory instanceof ApplicationContextAware) {
			((ApplicationContextAware) factory).setApplicationContext(applicationContext);
		}
		BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(factory);
		if (bw.isWritableProperty("localeResolver")) {
			bw.setPropertyValue("localeResolver", resolver);
		}
		if (bw.isWritableProperty("definitionDAO")) {
			bw.setPropertyValue("definitionDAO", createLocaleDefinitionDao(applicationContext, resolver));
		}
		return factory;
	}
	else {
		return super.createDefinitionsFactory(applicationContext, resolver);
	}
}
 
Example #2
Source File: TilesConfigurer.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
@Override
protected DefinitionsFactory createDefinitionsFactory(TilesApplicationContext applicationContext,
		TilesRequestContextFactory contextFactory, LocaleResolver resolver) {
	if (definitionsFactoryClass != null) {
		DefinitionsFactory factory = BeanUtils.instantiate(definitionsFactoryClass);
		if (factory instanceof TilesApplicationContextAware) {
			((TilesApplicationContextAware) factory).setApplicationContext(applicationContext);
		}
		BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(factory);
		if (bw.isWritableProperty("localeResolver")) {
			bw.setPropertyValue("localeResolver", resolver);
		}
		if (bw.isWritableProperty("definitionDAO")) {
			bw.setPropertyValue("definitionDAO",
					createLocaleDefinitionDao(applicationContext, contextFactory, resolver));
		}
		if (factory instanceof Refreshable) {
			((Refreshable) factory).refresh();
		}
		return factory;
	}
	else {
		return super.createDefinitionsFactory(applicationContext, contextFactory, resolver);
	}
}
 
Example #3
Source File: TilesConfigurer.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
@Override
protected DefinitionsFactory createDefinitionsFactory(ApplicationContext applicationContext,
		LocaleResolver resolver) {

	if (definitionsFactoryClass != null) {
		DefinitionsFactory factory = BeanUtils.instantiate(definitionsFactoryClass);
		if (factory instanceof ApplicationContextAware) {
			((ApplicationContextAware) factory).setApplicationContext(applicationContext);
		}
		BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(factory);
		if (bw.isWritableProperty("localeResolver")) {
			bw.setPropertyValue("localeResolver", resolver);
		}
		if (bw.isWritableProperty("definitionDAO")) {
			bw.setPropertyValue("definitionDAO", createLocaleDefinitionDao(applicationContext, resolver));
		}
		return factory;
	}
	else {
		return super.createDefinitionsFactory(applicationContext, resolver);
	}
}
 
Example #4
Source File: TilesConfigurer.java    From java-technology-stack with MIT License 6 votes vote down vote up
@Override
protected DefinitionsFactory createDefinitionsFactory(ApplicationContext applicationContext,
		LocaleResolver resolver) {

	if (definitionsFactoryClass != null) {
		DefinitionsFactory factory = BeanUtils.instantiateClass(definitionsFactoryClass);
		if (factory instanceof ApplicationContextAware) {
			((ApplicationContextAware) factory).setApplicationContext(applicationContext);
		}
		BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(factory);
		if (bw.isWritableProperty("localeResolver")) {
			bw.setPropertyValue("localeResolver", resolver);
		}
		if (bw.isWritableProperty("definitionDAO")) {
			bw.setPropertyValue("definitionDAO", createLocaleDefinitionDao(applicationContext, resolver));
		}
		return factory;
	}
	else {
		return super.createDefinitionsFactory(applicationContext, resolver);
	}
}
 
Example #5
Source File: TilesConfigurer.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected DefinitionsFactory createDefinitionsFactory(TilesApplicationContext applicationContext,
		TilesRequestContextFactory contextFactory, LocaleResolver resolver) {
	if (definitionsFactoryClass != null) {
		DefinitionsFactory factory = BeanUtils.instantiate(definitionsFactoryClass);
		if (factory instanceof TilesApplicationContextAware) {
			((TilesApplicationContextAware) factory).setApplicationContext(applicationContext);
		}
		BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(factory);
		if (bw.isWritableProperty("localeResolver")) {
			bw.setPropertyValue("localeResolver", resolver);
		}
		if (bw.isWritableProperty("definitionDAO")) {
			bw.setPropertyValue("definitionDAO",
					createLocaleDefinitionDao(applicationContext, contextFactory, resolver));
		}
		if (factory instanceof Refreshable) {
			((Refreshable) factory).refresh();
		}
		return factory;
	}
	else {
		return super.createDefinitionsFactory(applicationContext, contextFactory, resolver);
	}
}
 
Example #6
Source File: TilesConfigurer.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected DefinitionsFactory createDefinitionsFactory(ApplicationContext applicationContext,
		LocaleResolver resolver) {

	if (definitionsFactoryClass != null) {
		DefinitionsFactory factory = BeanUtils.instantiate(definitionsFactoryClass);
		if (factory instanceof ApplicationContextAware) {
			((ApplicationContextAware) factory).setApplicationContext(applicationContext);
		}
		BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(factory);
		if (bw.isWritableProperty("localeResolver")) {
			bw.setPropertyValue("localeResolver", resolver);
		}
		if (bw.isWritableProperty("definitionDAO")) {
			bw.setPropertyValue("definitionDAO", createLocaleDefinitionDao(applicationContext, resolver));
		}
		return factory;
	}
	else {
		return super.createDefinitionsFactory(applicationContext, resolver);
	}
}
 
Example #7
Source File: TilesConfigurer.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected BaseLocaleUrlDefinitionDAO instantiateLocaleDefinitionDao(TilesApplicationContext applicationContext,
		TilesRequestContextFactory contextFactory, LocaleResolver resolver) {
	BaseLocaleUrlDefinitionDAO dao = super.instantiateLocaleDefinitionDao(
			applicationContext, contextFactory, resolver);
	if (checkRefresh && dao instanceof CachingLocaleUrlDefinitionDAO) {
		((CachingLocaleUrlDefinitionDAO) dao).setCheckRefresh(true);
	}
	return dao;
}
 
Example #8
Source File: TilesConfigurer.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Override
protected BaseLocaleUrlDefinitionDAO instantiateLocaleDefinitionDao(TilesApplicationContext applicationContext,
		TilesRequestContextFactory contextFactory, LocaleResolver resolver) {
	BaseLocaleUrlDefinitionDAO dao = super.instantiateLocaleDefinitionDao(
			applicationContext, contextFactory, resolver);
	if (checkRefresh && dao instanceof CachingLocaleUrlDefinitionDAO) {
		((CachingLocaleUrlDefinitionDAO) dao).setCheckRefresh(true);
	}
	return dao;
}
 
Example #9
Source File: TilesConfigurer.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Override
protected BaseLocaleUrlDefinitionDAO instantiateLocaleDefinitionDao(ApplicationContext applicationContext,
		LocaleResolver resolver) {
	BaseLocaleUrlDefinitionDAO dao = super.instantiateLocaleDefinitionDao(applicationContext, resolver);
	if (checkRefresh && dao instanceof CachingLocaleUrlDefinitionDAO) {
		((CachingLocaleUrlDefinitionDAO) dao).setCheckRefresh(true);
	}
	return dao;
}
 
Example #10
Source File: TilesConfigurer.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Override
protected BaseLocaleUrlDefinitionDAO instantiateLocaleDefinitionDao(ApplicationContext applicationContext,
		LocaleResolver resolver) {
	BaseLocaleUrlDefinitionDAO dao = super.instantiateLocaleDefinitionDao(applicationContext, resolver);
	if (checkRefresh && dao instanceof CachingLocaleUrlDefinitionDAO) {
		((CachingLocaleUrlDefinitionDAO) dao).setCheckRefresh(true);
	}
	return dao;
}
 
Example #11
Source File: TilesConfigurer.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected BaseLocaleUrlDefinitionDAO instantiateLocaleDefinitionDao(ApplicationContext applicationContext,
		LocaleResolver resolver) {
	BaseLocaleUrlDefinitionDAO dao = super.instantiateLocaleDefinitionDao(applicationContext, resolver);
	if (checkRefresh && dao instanceof CachingLocaleUrlDefinitionDAO) {
		((CachingLocaleUrlDefinitionDAO) dao).setCheckRefresh(true);
	}
	return dao;
}
 
Example #12
Source File: TilesConfigurer.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Override
protected BaseLocaleUrlDefinitionDAO instantiateLocaleDefinitionDao(ApplicationContext applicationContext,
		LocaleResolver resolver) {
	BaseLocaleUrlDefinitionDAO dao = super.instantiateLocaleDefinitionDao(applicationContext, resolver);
	if (checkRefresh && dao instanceof CachingLocaleUrlDefinitionDAO) {
		((CachingLocaleUrlDefinitionDAO) dao).setCheckRefresh(true);
	}
	return dao;
}
 
Example #13
Source File: TilesConfigurer.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected LocaleResolver createLocaleResolver(ApplicationContext context) {
	return new SpringLocaleResolver();
}
 
Example #14
Source File: TilesConfigurer.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected LocaleResolver createLocaleResolver(ApplicationContext applicationContext) {
	return new SpringLocaleResolver();
}
 
Example #15
Source File: TilesConfigurer.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
protected LocaleResolver createLocaleResolver(ApplicationContext applicationContext) {
	return new SpringLocaleResolver();
}
 
Example #16
Source File: TilesConfigurer.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected LocaleResolver createLocaleResolver(TilesApplicationContext applicationContext,
		TilesRequestContextFactory contextFactory) {
	return new SpringLocaleResolver();
}
 
Example #17
Source File: TilesConfigurer.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected LocaleResolver createLocaleResolver(TilesApplicationContext applicationContext,
		TilesRequestContextFactory contextFactory) {
	return new SpringLocaleResolver();
}
 
Example #18
Source File: TilesConfigurer.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
protected LocaleResolver createLocaleResolver(ApplicationContext context) {
	return new SpringLocaleResolver();
}
 
Example #19
Source File: TilesConfigurer.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
protected LocaleResolver createLocaleResolver(ApplicationContext context) {
	return new SpringLocaleResolver();
}
 
Example #20
Source File: TilesConfigurer.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
protected LocaleResolver createLocaleResolver(ApplicationContext applicationContext) {
	return new SpringLocaleResolver();
}
 
Example #21
Source File: TilesConfigurer.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
protected LocaleResolver createLocaleResolver(ApplicationContext applicationContext) {
	return new SpringLocaleResolver();
}
 
Example #22
Source File: TilesConfigurer.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
protected LocaleResolver createLocaleResolver(ApplicationContext context) {
	return new SpringLocaleResolver();
}
 
Example #23
Source File: TilesConfigurer.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
protected LocaleResolver createLocaleResolver(TilesApplicationContext applicationContext,
		TilesRequestContextFactory contextFactory) {
	return new SpringLocaleResolver();
}
 
Example #24
Source File: TilesConfigurer.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
protected LocaleResolver createLocaleResolver(TilesApplicationContext applicationContext,
		TilesRequestContextFactory contextFactory) {
	return new SpringLocaleResolver();
}