org.loom.guice
Class LoomModule

java.lang.Object
  extended by com.google.inject.AbstractModule
      extended by org.loom.guice.LoomModule
All Implemented Interfaces:
com.google.inject.Module

public class LoomModule
extends com.google.inject.AbstractModule

Configures Loom using Guice. Extend this class to override the default config.


Constructor Summary
LoomModule(javax.servlet.ServletContext servletContext)
           
 
Method Summary
protected  void configure()
           
protected  void initActionMappingRepository()
           
protected  void initAnnotationProcessors()
           
protected  void initConverterFactory()
           
protected  void initDefaultCompiler(java.lang.String name, WebResourceType type)
           
protected  void initExceptionHandler()
           
protected  void initExpressionLanguageProxy()
           
protected  void initFileParameterFactory()
           
protected  void initFlashContextFactory()
           
protected  void initLocaleResolver()
           
protected  void initLookup()
           
protected  void initMessagesRepositoryFactory()
           
protected  void initNodeFactory()
           
protected  void initObjectMapper()
           
protected  void initResolutionFactory()
           
protected  void initResourceLoader()
           
protected  void initServletContext()
           
protected  void initWebResourceBundleFactory()
           
 LoomModule withActionClasses(java.lang.Iterable<java.lang.Class<? extends Action>> actionClasses)
          Registers the action classes into the ActionMappingRepository
 LoomModule withDefaultLocale(java.util.Locale defaultLocale)
          Sets the default Locale to apply to requests if the user-selected locale is not supported by the application
 LoomModule withDevelopment(boolean development)
          Sets a development value.
 LoomModule withMessagesLocations(java.lang.String... messagesLocations)
          Sets the location of i18n messages.
 
Methods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoomModule

public LoomModule(javax.servlet.ServletContext servletContext)
Method Detail

withDevelopment

public LoomModule withDevelopment(boolean development)
Sets a development value. If true, changes to messages.properties and web resources (css, js files) will be detected automatically, and if JRebel is present action classes will also be reloaded on-the-fly.

Returns:
this same instance

withDefaultLocale

public LoomModule withDefaultLocale(java.util.Locale defaultLocale)
Sets the default Locale to apply to requests if the user-selected locale is not supported by the application

Parameters:
defaultLocale - the default locale to apply. If unspecified, Locale.getDefault() will be used
Returns:
this same instance

withMessagesLocations

public LoomModule withMessagesLocations(java.lang.String... messagesLocations)
Sets the location of i18n messages.

Parameters:
messagesLocations - the locations of i18n messages, without the locale or ".properties" parts. Defaults to "classpath:resources/loom-messages", "WEB-INF/classes/resources/messages"
Returns:
this same instance

withActionClasses

public LoomModule withActionClasses(java.lang.Iterable<java.lang.Class<? extends Action>> actionClasses)
Registers the action classes into the ActionMappingRepository

Parameters:
actionClasses - the action classes to use
Returns:
this same instance

configure

protected void configure()
Specified by:
configure in class com.google.inject.AbstractModule

initServletContext

protected void initServletContext()

initResourceLoader

protected void initResourceLoader()

initActionMappingRepository

protected void initActionMappingRepository()

initConverterFactory

protected void initConverterFactory()

initExpressionLanguageProxy

protected void initExpressionLanguageProxy()

initExceptionHandler

protected void initExceptionHandler()

initFileParameterFactory

protected void initFileParameterFactory()

initResolutionFactory

protected void initResolutionFactory()

initFlashContextFactory

protected void initFlashContextFactory()

initLocaleResolver

protected void initLocaleResolver()

initMessagesRepositoryFactory

protected void initMessagesRepositoryFactory()

initNodeFactory

protected void initNodeFactory()

initObjectMapper

protected void initObjectMapper()

initWebResourceBundleFactory

protected void initWebResourceBundleFactory()

initDefaultCompiler

protected void initDefaultCompiler(java.lang.String name,
                                   WebResourceType type)

initLookup

protected void initLookup()

initAnnotationProcessors

protected void initAnnotationProcessors()